feat: 优惠券
parent
e635f87d36
commit
4e3da42e09
|
|
@ -0,0 +1,32 @@
|
|||
package com.czcb.scfs.api.service.v1.coupon;
|
||||
|
||||
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.coupon.model.CouponLoanRequest;
|
||||
import com.czcb.scfs.api.service.v1.coupon.model.CouponLoanResponse;
|
||||
|
||||
import static com.czcb.scfs.api.core.Constants.API_VERSION;
|
||||
import static com.czcb.scfs.api.core.Constants.V_1;
|
||||
|
||||
public class CouponService {
|
||||
private final ApiClient apiClient;
|
||||
|
||||
public CouponService(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠发放
|
||||
*
|
||||
* @param couponLoanRequest CouponLoanRequest
|
||||
* @return CouponLoanResponse
|
||||
*/
|
||||
public CouponLoanResponse couponLoan(CouponLoanRequest couponLoanRequest) {
|
||||
String url = "/coupon/couponLoan";
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.addHeader(API_VERSION, V_1);
|
||||
HttpResponse<CouponLoanResponse> httpResponse = apiClient.post(url, headers, couponLoanRequest.toJsonRequest(), CouponLoanResponse.class);
|
||||
return httpResponse.getServiceResponse();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.czcb.scfs.api.service.v1.coupon.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;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@TransType("100094")
|
||||
public class CouponLoanRequest implements ApiRequest {
|
||||
/**
|
||||
* 渠道编号
|
||||
*/
|
||||
@SerializedName("channel_no")
|
||||
private String channelNo;
|
||||
|
||||
/**
|
||||
* 应用编号
|
||||
*/
|
||||
@SerializedName("app_no")
|
||||
private String appNo;
|
||||
|
||||
/**
|
||||
* 流水号
|
||||
*/
|
||||
@SerializedName("serial_no")
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 账号,优惠接收账号
|
||||
*/
|
||||
@SerializedName("account_no")
|
||||
private String accountNo;
|
||||
/**
|
||||
* 户名,优惠接收户名
|
||||
*/
|
||||
@SerializedName("account_name")
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 金额,优惠金额
|
||||
*/
|
||||
@SerializedName("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 操作日期
|
||||
*/
|
||||
@SerializedName("trans_date")
|
||||
private String transDate;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@SerializedName("trans_tradetime")
|
||||
private String transTradeTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.czcb.scfs.api.service.v1.coupon.model;
|
||||
|
||||
import com.czcb.scfs.api.core.ApiResponse;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class CouponLoanResponse 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("sys_time")
|
||||
private String sysTime;
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import com.czcb.scfs.api.service.echo.EchoService;
|
|||
import com.czcb.scfs.api.service.v1.account.AccountService;
|
||||
import com.czcb.scfs.api.service.v1.bills.BillService;
|
||||
import com.czcb.scfs.api.service.v1.bmd.BmdService;
|
||||
import com.czcb.scfs.api.service.v1.coupon.CouponService;
|
||||
import com.czcb.scfs.api.service.v1.face.FaceService;
|
||||
import com.czcb.scfs.api.service.v1.file.FileService;
|
||||
import com.czcb.scfs.api.service.v1.loan.LoanService;
|
||||
|
|
@ -72,6 +73,14 @@ public class ScfsAutoConfiguration {
|
|||
return new BmdService(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
@Bean
|
||||
public CouponService couponService(ApiClient apiClient) {
|
||||
return new CouponService(apiClient);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸识别
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import com.czcb.scfs.api.core.util.PemFile;
|
|||
import com.czcb.scfs.api.sm.SmProfile;
|
||||
import com.tencent.kona.KonaProvider;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -53,7 +53,7 @@ public class SmConfiguration extends AbstractAutoConfiguration {
|
|||
}
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConditionalOnMissingBean
|
||||
public SmProfile smProfile() {
|
||||
return new SmProfile.Builder()
|
||||
.channel(getChannel())
|
||||
|
|
|
|||
Loading…
Reference in New Issue