sms model
parent
4e0fd8a74e
commit
7c9c9291ca
|
|
@ -16,6 +16,7 @@ public class Constants {
|
|||
public static final String CHANNEL_NO = "X-SCFS-Channel-No";
|
||||
public static final String APP_NO = "X-SCFS-App-No";
|
||||
public static final String SIGNATURE = "X-SCFS-Signature";
|
||||
public static final String API_VERSION = "X-SCFS-Api-Version";
|
||||
// http 自定义字段
|
||||
public static final String TIMESTAMP = "X-SCFS-Timestamp";
|
||||
public static final String NONCE = "X-SCFS-Nonce";
|
||||
|
|
@ -30,4 +31,7 @@ public class Constants {
|
|||
public static final String GZIP_ENCODING = "gzip";
|
||||
public static final int HEX = 16;
|
||||
public static final String BASE_CHAR = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
// version
|
||||
public static final String V_1 = "1.0.0";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,12 @@
|
|||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.czcb.scfs</groupId>
|
||||
<artifactId>scfs-api-core</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.czcb.scfs.api.service;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author wangwei
|
||||
* @date 2024/3/13
|
||||
*/
|
||||
public @interface TransType {
|
||||
String value();
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.czcb.scfs.api.service.v1.account;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author wangwei
|
||||
* @date 2024/3/12
|
||||
*/
|
||||
public class OpenAccRequest implements Serializable {
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,11 @@ package com.czcb.scfs.api.service.v1.sms;
|
|||
import com.czcb.scfs.api.core.ApiClient;
|
||||
import com.czcb.scfs.api.core.http.HttpHeaders;
|
||||
import com.czcb.scfs.api.core.http.HttpResponse;
|
||||
import com.czcb.scfs.api.service.v1.sms.model.SmsRequest;
|
||||
import com.czcb.scfs.api.service.v1.sms.model.SmsResponse;
|
||||
import com.czcb.scfs.api.service.v1.sms.model.SendVerifySignRequest;
|
||||
import com.czcb.scfs.api.service.v1.sms.model.SendVerifySignResponse;
|
||||
|
||||
import static com.czcb.scfs.api.core.Constants.API_VERSION;
|
||||
import static com.czcb.scfs.api.core.Constants.V_1;
|
||||
|
||||
/**
|
||||
* 短信服务
|
||||
|
|
@ -18,10 +21,11 @@ public class SmsService {
|
|||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public SmsResponse send(SmsRequest request) {
|
||||
String url = "/send/test";
|
||||
public SendVerifySignResponse send(SendVerifySignRequest request) {
|
||||
String url = "/sms/sendVerifySign";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
HttpResponse<SmsResponse> httpResponse = apiClient.post(url, headers, request.toJsonRequest(), SmsResponse.class);
|
||||
headers.addHeader(API_VERSION, V_1);
|
||||
HttpResponse<SendVerifySignResponse> httpResponse = apiClient.post(url, headers, request.toJsonRequest(), SendVerifySignResponse.class);
|
||||
return httpResponse.getServiceResponse();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.czcb.scfs.api.service.v1.sms.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiRequest;
|
||||
import com.czcb.scfs.api.service.TransType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 短信验证码发送
|
||||
*
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TransType("100000")
|
||||
public class SendVerifySignRequest implements ApiRequest {
|
||||
@SerializedName("channel_no")
|
||||
private String channelNo;
|
||||
|
||||
@SerializedName("app_no")
|
||||
private String appNo;
|
||||
|
||||
@SerializedName("serial_no")
|
||||
private String serialNo;
|
||||
|
||||
@SerializedName("trade_no")
|
||||
private String tradeNo;
|
||||
|
||||
@SerializedName("model_no")
|
||||
private String modelNo;
|
||||
|
||||
@SerializedName("trade_type")
|
||||
private String tradeType;
|
||||
|
||||
@SerializedName("account_no")
|
||||
private String accountNo;
|
||||
|
||||
@SerializedName("amount")
|
||||
private String amount;
|
||||
|
||||
@SerializedName("card_no")
|
||||
private String cardNo;
|
||||
|
||||
@SerializedName("card_name")
|
||||
private String cardName;
|
||||
|
||||
@SerializedName("id_no")
|
||||
private String idNo;
|
||||
|
||||
@SerializedName("mobile")
|
||||
private String mobile;
|
||||
|
||||
@SerializedName("trans_date")
|
||||
private String transDate;
|
||||
|
||||
@SerializedName("trans_tradetime")
|
||||
private String transTradetime;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.czcb.scfs.api.service.v1.sms.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiResponse;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
@Data
|
||||
public class SendVerifySignResponse implements ApiResponse {
|
||||
/**
|
||||
* 000000:表示成功
|
||||
*/
|
||||
@SerializedName("recode")
|
||||
private String recode;
|
||||
|
||||
/**
|
||||
* 结果信息
|
||||
*/
|
||||
@SerializedName("recode_Info")
|
||||
private String recodeInfo;
|
||||
|
||||
/**
|
||||
* 系统日期(YYYY-MM-DD)
|
||||
*/
|
||||
@SerializedName("sys_date")
|
||||
private String sysDate;
|
||||
|
||||
/**
|
||||
* 系统时间(YYYY-MM-DD hh:mm:ss)
|
||||
*/
|
||||
@SerializedName("recode_Info")
|
||||
private String sysTime;
|
||||
|
||||
private String smsNo;
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.czcb.scfs.api.service.v1.sms.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiRequest;
|
||||
|
||||
/**
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class SmsRequest implements ApiRequest {
|
||||
private String mobile;
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
package com.czcb.scfs.api.service.v1.sms.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiResponse;
|
||||
|
||||
/**
|
||||
* @author wangwei
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public class SmsResponse implements ApiResponse {
|
||||
private String recode;
|
||||
|
||||
private String recodeInfo;
|
||||
|
||||
public String getRecode() {
|
||||
return recode;
|
||||
}
|
||||
|
||||
public void setRecode(String recode) {
|
||||
this.recode = recode;
|
||||
}
|
||||
|
||||
public String getRecodeInfo() {
|
||||
return recodeInfo;
|
||||
}
|
||||
|
||||
public void setRecodeInfo(String recodeInfo) {
|
||||
this.recodeInfo = recodeInfo;
|
||||
}
|
||||
|
||||
private String mobile;
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue