AliSmsPipeline.java
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.diligrp.assistant.sms.pipeline;
import com.diligrp.assistant.sms.client.AliSmsHttpClient;
import com.diligrp.assistant.sms.domain.SmsMessage;
import com.diligrp.assistant.sms.domain.SmsTemplate;
import com.diligrp.assistant.sms.type.PipelineType;
import com.diligrp.assistant.sms.type.TemplateState;
public class AliSmsPipeline extends SmsPipeline {
private AliSmsHttpClient client;
public AliSmsPipeline(int code, String name, String endPoint, String accessKeyId, String accessKeySecret) {
super(code, name, PipelineType.SMS_ALI);
this.client = new AliSmsHttpClient(endPoint, accessKeyId, accessKeySecret);
}
@Override
public boolean templateSupported() {
return true;
}
@Override
public String createSmsTemplate(SmsTemplate template) {
return this.client.createSmsTemplate(template);
}
@Override
public void modifySmsTemplate(SmsTemplate template) {
this.client.modifySmsTemplate(template);
}
@Override
public TemplateState querySmsTemplateState(String templateId) {
return this.client.querySmsTemplateState(templateId);
}
@Override
public void deleteSmsTemplate(String templateId) {
this.client.deleteSmsTemplate(templateId);
}
@Override
public String sendSmsMessage(SmsMessage message) {
return this.client.sendSmsMessage(message);
}
}