记得上下班打卡 | git大法好,push需谨慎

Commit 3a682417 authored by 张国柄's avatar 张国柄

完善参数校验部分;

parent 4ed7ec6c
......@@ -13,9 +13,7 @@ import java.io.Serializable;
public class AdamMemberOrderCodeParam implements Serializable {
private static final long serialVersionUID = 2500742355642406263L;
@ApiModelProperty(position = 10, required = true, value = "类型:2-会员码,3-礼包码", example = "3")
@NotNull(message = "兑换码类型不能位空")
@Min(value = 2, message = "兑换码类型无效")
@Max(value = 3, message = "兑换码类型无效")
@Pattern(regexp = "^[2-3]$", message = "类型无效")
private Integer mode;
@ApiModelProperty(position = 11, required = true, value = "兑换码")
@NotBlank(message = "兑换码不能为空")
......
......@@ -19,10 +19,8 @@ public class AdamMemberOrderParam implements Serializable {
@ApiModelProperty(position = 11, required = true, value = "会员价格ID", example = "1")
@NotBlank(message = "会员价格ID不能为空")
private String memberPriceId;
@ApiModelProperty(position = 12, required = true, value = "购买方式:0-购买会员,1-购买会员码", allowableValues = "0,1")
@NotNull(message = "购买方式不能为空")
@Min(value = 0, message = "购买方式无效")
@Max(value = 1, message = "购买方式无效")
@ApiModelProperty(position = 12, required = true, value = "类型:0-购买会员,1-购买会员码", allowableValues = "0,1")
@Pattern(regexp = "^[0-1]$", message = "类型无效")
private Integer mode;
@ApiModelProperty(position = 13, required = true, value = "应付金额", example = "0.01")
@DecimalMin(value = "0.01", message = "应付金额有误")
......@@ -34,10 +32,10 @@ public class AdamMemberOrderParam implements Serializable {
@Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "生日格式有误")
private String birthday;
@ApiModelProperty(position = 16, required = true, value = "支付终端", allowableValues = "app,wap,js,applet")
@NotBlank(message = "支付终端不能为空")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY_TERMINAL, message = "支付终端类型无效")
private String deviceFrom;
@ApiModelProperty(position = 17, required = true, value = "支付方式", allowableValues = "alipay,wepay")
@NotBlank(message = "支付方式不能为空")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_PAY, message = "支付方式无效")
private String payType;
@ApiModelProperty(position = 18, required = false, value = "App内Apple支付必传")
private String productId;
......
......@@ -22,9 +22,7 @@ public class AdamMemberPriceParam implements Serializable {
@NotBlank(message = "会员类型ID不能为空")
private String memberId;
@ApiModelProperty(position = 3, value = "状态:0-不可用,1-上线中,2-已下线", allowableValues = "0,1,2")
@NotNull(message = "状态不能为空")
@Min(value = 1, message = "状态无效")
@Max(value = 2, message = "状态无效")
@Pattern(regexp = "^[0-2]$", message = "状态无效")
private Integer state;
@ApiModelProperty(position = 4, value = "会员价格包名称", example = "年卡")
@Size(min = 1, max = 30, message = "会员价格包名称长度限制1-30位")
......
......@@ -23,7 +23,7 @@ public class AdamThirdPartParam implements Serializable {
@Size(max = 255, message = "已超出头像链接长度限制")
private String avatar;
@ApiModelProperty(position = 14, required = true, value = "平台类型[255]", allowableValues = "WEIBO,WECHAT,QQ")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_ACC_FOR_ULGOIN, message = "平台类型无效")
@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_ULGOIN, message = "平台类型无效")
private String platform;
@ApiModelProperty(position = 15, required = false, value = "手机号[新账号时必传]")
private String mobile;
......
......@@ -69,9 +69,17 @@ public class LnsRegex {
/**
* 用户中心:登录注册:支持的第三方账号平台类型
* 支持的第三方账号平台类型(用户中心:登录注册)
*/
public static final String TRIPLE_ACC_FOR_ULGOIN = "\\b(WEIBO|WECHAT|QQ)\\b";
public static final String TRIPLE_PF_FOR_ULGOIN = "\\b(WEIBO|WECHAT|QQ)\\b";
/**
* 支持的支付终端
*/
public static final String TRIPLE_PF_FOR_PAY_TERMINAL = "\\b(app|wap|js|applet)\\b";
/**
* 支持的支付方式
*/
public static final String TRIPLE_PF_FOR_PAY = "\\b(alipay|wepay)\\b";
/* ======================================================================= | */
......
......@@ -275,7 +275,7 @@ public class AdamUserController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "platform", value = "平台类型", allowableValues = "WEIBO,WECHAT,QQ"),
})
@PostMapping(value = {"tpa/unbind/{platform}"})
public ResponseDto<List<AdamThirdPartInfoVo>> unbindTpa(@Pattern(regexp = LnsRegex.Valid.TRIPLE_ACC_FOR_ULGOIN, message = "平台类型无效")
public ResponseDto<List<AdamThirdPartInfoVo>> unbindTpa(@Pattern(regexp = LnsRegex.Valid.TRIPLE_PF_FOR_ULGOIN, message = "平台类型无效")
@PathVariable String platform) {
String currentUid = CurrentUtil.getCurrentUid();
log.debug("unbind tpa.platform:{},uid:{}", platform, currentUid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment