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

Commit f82a4e16 authored by 张国柄's avatar 张国柄

fix param valid for adam;

parent c172557b
...@@ -5,9 +5,7 @@ import io.swagger.annotations.ApiModel; ...@@ -5,9 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.*;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
@ApiModel(value = "AdamAddressesParam", description = "添加/编辑收获地址入参") @ApiModel(value = "AdamAddressesParam", description = "添加/编辑收获地址入参")
@Data @Data
...@@ -16,7 +14,7 @@ public class AdamAddressesParam implements java.io.Serializable { ...@@ -16,7 +14,7 @@ public class AdamAddressesParam implements java.io.Serializable {
@ApiModelProperty(position = 10, required = false, value = "收获地址ID,编辑时必传[64]") @ApiModelProperty(position = 10, required = false, value = "收获地址ID,编辑时必传[64]")
private String addressesId; private String addressesId;
@ApiModelProperty(position = 11, required = true, value = "姓名[50]", example = "Swagger") @ApiModelProperty(position = 11, required = true, value = "姓名[50]", example = "Swagger")
@Size(min = 1, max = 30, message = "姓名长度限制1~30位字符") @Size(min = 1, max = 30)
private String name; private String name;
@ApiModelProperty(position = 12, required = true, value = "手机号[11]", example = "13111111111") @ApiModelProperty(position = 12, required = true, value = "手机号[11]", example = "13111111111")
@Pattern(regexp = "\\d{11}", message = "手机号格式有误") @Pattern(regexp = "\\d{11}", message = "手机号格式有误")
...@@ -25,13 +23,13 @@ public class AdamAddressesParam implements java.io.Serializable { ...@@ -25,13 +23,13 @@ public class AdamAddressesParam implements java.io.Serializable {
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "省份必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "省份必须为2~30位汉字")
private String province; private String province;
@ApiModelProperty(position = 14, required = true, value = "城市[30]", example = "北京城区") @ApiModelProperty(position = 14, required = true, value = "城市[30]", example = "北京城区")
@NotNull(message = "城市不能为空") @NotNull()
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "城市必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "城市必须为2~30位汉字")
private String city; private String city;
@ApiModelProperty(position = 15, required = true, value = "区县[30]", example = "朝阳区") @ApiModelProperty(position = 15, required = true, value = "区县[30]", example = "朝阳区")
@Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "区县必须为2~30位汉字") @Pattern(regexp = LnsRegex.Valid.CHINESE_PCD, message = "区县必须为2~30位汉字")
private String county; private String county;
@ApiModelProperty(position = 16, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区") @ApiModelProperty(position = 16, required = true, value = "详细地址[100]", example = "广渠路1号创1958园区")
@Size(max = 100, message = "详细地址长度最长100位") @Size(max = 100)
private String address; private String address;
} }
...@@ -5,8 +5,7 @@ import io.swagger.annotations.ApiModel; ...@@ -5,8 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.Pattern; import javax.validation.constraints.*;
import javax.validation.constraints.Size;
@ApiModel(value = "AdamEntersParam", description = "添加/编辑入场人入参") @ApiModel(value = "AdamEntersParam", description = "添加/编辑入场人入参")
@Data @Data
...@@ -21,7 +20,7 @@ public class AdamEntersParam implements java.io.Serializable { ...@@ -21,7 +20,7 @@ public class AdamEntersParam implements java.io.Serializable {
@Pattern(regexp = "\\d{11}", message = "手机号格式有误") @Pattern(regexp = "\\d{11}", message = "手机号格式有误")
private String mobile; private String mobile;
@ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5") @ApiModelProperty(position = 13, required = true, value = "证件类型:1-大陆身份证,2-港澳通行证,3-台胞证,4-护照,5-军官证", allowableValues = "1,2,3,4,5")
@Pattern(regexp = "\\b(1,2,3,4,5)\\b", message = "证件类型无效") @NotNull @Min(1) @Max(5)
private Integer type; private Integer type;
@ApiModelProperty(position = 14, required = true, value = "入场人证件号[11]", example = "110101110001010111") @ApiModelProperty(position = 14, required = true, value = "入场人证件号[11]", example = "110101110001010111")
@Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误") @Pattern(regexp = LnsRegex.Valid.CHINESE_ID_CARD, message = "身份证号格式有误")
......
...@@ -11,9 +11,9 @@ import java.util.List; ...@@ -11,9 +11,9 @@ import java.util.List;
@Data @Data
public class AdamMemberParam implements Serializable { public class AdamMemberParam implements Serializable {
private static final long serialVersionUID = -7411934614249221021L; private static final long serialVersionUID = -7411934614249221021L;
@ApiModelProperty(position = 0, required = false, value = "会员ID[50]", example = "62960077673504768") @ApiModelProperty(position = 0, required = false, value = "会员ID[50]")
private String memberId; private String memberId;
@ApiModelProperty(position = 1, required = false, value = "会员名称[50]", example = "摩登天空会员卡") @ApiModelProperty(position = 1, required = true, value = "会员名称[50]", example = "摩登天空会员卡")
private String name; private String name;
@ApiModelProperty(position = 2, required = true, value = "会员标题[50]", example = "摩登天空会员卡") @ApiModelProperty(position = 2, required = true, value = "会员标题[50]", example = "摩登天空会员卡")
private String title; private String title;
...@@ -21,7 +21,7 @@ public class AdamMemberParam implements Serializable { ...@@ -21,7 +21,7 @@ public class AdamMemberParam implements Serializable {
private String subTitle; private String subTitle;
@ApiModelProperty(position = 4, required = true, value = "icon图标[200]", example = "https://img.zhengzai.tv/files/2020/08/28/5f490418d30b4.png") @ApiModelProperty(position = 4, required = true, value = "icon图标[200]", example = "https://img.zhengzai.tv/files/2020/08/28/5f490418d30b4.png")
private String icon; private String icon;
@ApiModelProperty(position = 5, required = true, value = "会员头像[200]", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.pngv") @ApiModelProperty(position = 5, required = true, value = "会员头像[200]", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.png")
private String avatar; private String avatar;
@ApiModelProperty(position = 6, required = true, value = "权益详情[200]", example = "加入摩登天空会员您可享受到.....") @ApiModelProperty(position = 6, required = true, value = "权益详情[200]", example = "加入摩登天空会员您可享受到.....")
private String interestsDetail; private String interestsDetail;
......
...@@ -16,52 +16,20 @@ public class AdamMemberPriceParam implements Serializable { ...@@ -16,52 +16,20 @@ public class AdamMemberPriceParam implements Serializable {
private static final long serialVersionUID = -6432796310264973696L; private static final long serialVersionUID = -6432796310264973696L;
@ApiModelProperty(position = 0, required = false, value = "价格id") @ApiModelProperty(position = 0, required = false, value = "价格id")
private Integer mid; private Integer mid;
/**
* 会员价格ID
*/
@ApiModelProperty(position = 1, required = false, value = "会员价格ID") @ApiModelProperty(position = 1, required = false, value = "会员价格ID")
private String memberPriceId; private String memberPriceId;
/**
* 会员类型ID
*/
@ApiModelProperty(position = 2, required = false, value = "会员类型ID") @ApiModelProperty(position = 2, required = false, value = "会员类型ID")
private String memberId; private String memberId;
/**
* 状态 0 不可用 1上线中 2已下线
*/
@ApiModelProperty(position = 3, required = false, value = "状态0 不可用 1上线中 2已下线", allowableValues = "0,1,2") @ApiModelProperty(position = 3, required = false, value = "状态0 不可用 1上线中 2已下线", allowableValues = "0,1,2")
private Integer status; private Integer status;
/**
* 会员包名称
*/
@ApiModelProperty(position = 4, required = false, value = "会员价格包名称", example = "年卡") @ApiModelProperty(position = 4, required = false, value = "会员价格包名称", example = "年卡")
private String name; private String name;
/**
* 原价
*/
@ApiModelProperty(position = 5, required = false, value = "原价", example = "199") @ApiModelProperty(position = 5, required = false, value = "原价", example = "199")
private BigDecimal price; private BigDecimal price;
/**
* 折扣价
*/
@ApiModelProperty(position = 6, required = false, value = "折扣价", example = "199") @ApiModelProperty(position = 6, required = false, value = "折扣价", example = "199")
private BigDecimal priceFixed; private BigDecimal priceFixed;
/**
* 会员包有效天数
*/
@ApiModelProperty(position = 7, required = false, value = "会员包有效天数", example = "365") @ApiModelProperty(position = 7, required = false, value = "会员包有效天数", example = "365")
private Integer days; private Integer days;
/**
* 会员包须知
*/
@ApiModelProperty(position = 8, required = false, value = "会员包须知", example = "会员包须知") @ApiModelProperty(position = 8, required = false, value = "会员包须知", example = "会员包须知")
private String detail; private String detail;
} }
...@@ -17,13 +17,13 @@ public class AdamThirdPartParam implements Serializable { ...@@ -17,13 +17,13 @@ public class AdamThirdPartParam implements Serializable {
@ApiModelProperty(position = 11, required = true, value = "第三方OPENID[64]") @ApiModelProperty(position = 11, required = true, value = "第三方OPENID[64]")
private String openId; private String openId;
@ApiModelProperty(position = 12, required = true, value = "昵称[64]", example = "Swagger") @ApiModelProperty(position = 12, required = true, value = "昵称[64]", example = "Swagger")
@Size(min = 2, max = 64, message = "昵称字符长度限制2~64位") @Size(min = 2, max = 64)
private String nickname; private String nickname;
@ApiModelProperty(position = 13, required = true, value = "头像[255]", example = "http://pic.zhengzai.tv/default/avatar.png") @ApiModelProperty(position = 13, required = true, value = "头像[255]", example = "http://pic.zhengzai.tv/default/avatar.png")
@Size(max = 255, message = "头像字符长度大于255位") @Size(max = 255)
private String avatar; private String avatar;
@ApiModelProperty(position = 14, required = true, value = "平台类型[255]", allowableValues = "WEIBO,WECHAT,QQ") @ApiModelProperty(position = 14, required = true, value = "平台类型[255]", allowableValues = "WEIBO,WECHAT,QQ")
@Pattern(regexp = "\\b(WEIBO,WECHAT,QQ)\\b", message = "平台类型无效") //@Pattern(regexp = "\\b(WEIBO,WECHAT,QQ)\\b", message = "平台类型无效")
private String platform; private String platform;
@ApiModelProperty(position = 15, required = false, value = "手机号[新账号时必传]", example = "13111111111") @ApiModelProperty(position = 15, required = false, value = "手机号[新账号时必传]", example = "13111111111")
private String mobile; private String mobile;
......
...@@ -18,27 +18,27 @@ import java.util.List; ...@@ -18,27 +18,27 @@ import java.util.List;
public class AdamUserInfoParam implements java.io.Serializable { public class AdamUserInfoParam implements java.io.Serializable {
private static final long serialVersionUID = -1084524066864012398L; private static final long serialVersionUID = -1084524066864012398L;
@ApiModelProperty(position = 11, required = true, value = "头像[255]", example = "http://pic.zhengzai.tv/default/avatar.png") @ApiModelProperty(position = 11, required = true, value = "头像[255]", example = "http://pic.zhengzai.tv/default/avatar.png")
@Size(max = 255, message = "头像字符长度大于255位") @Size(max = 255)
private String avatar; private String avatar;
@ApiModelProperty(position = 12, required = true, value = "背景[255]", example = "https://img.zhengzai.tv/files/2021/01/13/5ffeab3584b7d.png") @ApiModelProperty(position = 12, required = true, value = "背景[255]", example = "https://img.zhengzai.tv/files/2021/01/13/5ffeab3584b7d.png")
@Size(max = 255, message = "背景字符长度大于255位") @Size(max = 255)
private String background; private String background;
@ApiModelProperty(position = 13, required = true, value = "昵称[32]", example = "Swagger") @ApiModelProperty(position = 13, required = true, value = "昵称[32]", example = "Swagger")
@Size(min = 2, max = 64, message = "昵称字符长度限制2~64位") @Size(min = 2, max = 64)
private String nickname; private String nickname;
@ApiModelProperty(position = 14, required = true, value = "性别[32]", example = "{\"val\":\"MS00\",\"desc\":\"其他性别\"}") @ApiModelProperty(position = 14, required = true, value = "性别[32]", example = "{\"val\":\"MS00\",\"desc\":\"其他性别\"}")
@NotNull(message = "性别标签不能为空") @NotNull
private AdamTagVo sex; private AdamTagVo sex;
@ApiModelProperty(position = 15, required = true, value = "生日[YYYY-MM-DD]", example = "2021-05-17") @ApiModelProperty(position = 15, required = true, value = "生日[YYYY-MM-DD]", example = "2021-05-17")
@Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "时间格式有误") @Pattern(regexp = LnsRegex.Valid.DATETIME_YMD, message = "时间格式有误")
private String birthday; private String birthday;
@ApiModelProperty(position = 16, required = true, value = "常住地/区域[100]", example = "北京 北京市 朝阳区") @ApiModelProperty(position = 16, required = true, value = "常住地/区域[100]", example = "北京 北京市 朝阳区")
@NotBlank(message = "常住地/区域不能为空") @NotBlank
private String area; private String area;
@ApiModelProperty(position = 17, required = true, value = "签名[255]", example = "...................") @ApiModelProperty(position = 17, required = true, value = "签名[255]", example = "...................")
@Size(max = 255, message = "签名过长") @Size(max = 255)
private String signature; private String signature;
@ApiModelProperty(position = 18, required = true, value = "标签[500]", example = "[{\"val\":\"MMS01\",\"desc\":\"民歌\",\"tagVos\":[{\"val\":\"MMS0101\",\"desc\":\"A\"},{\"val\":\"MMS0102\",\"desc\":\"B\"}]},{\"val\":\"MMS02\",\"desc\":\"house\",\"tagVos\":[{\"val\":\"MMS0201\",\"desc\":\"C\"}]}]") @ApiModelProperty(position = 18, required = true, value = "标签[500]", example = "[{\"val\":\"MMS01\",\"desc\":\"民歌\",\"tagVos\":[{\"val\":\"MMS0101\",\"desc\":\"A\"},{\"val\":\"MMS0102\",\"desc\":\"B\"}]},{\"val\":\"MMS02\",\"desc\":\"house\",\"tagVos\":[{\"val\":\"MMS0201\",\"desc\":\"C\"}]}]")
@NotNull(message = "风格标签不能为空") @NotNull
private List<AdamTagParentVo> tagMe; private List<AdamTagParentVo> tagMe;
} }
...@@ -63,6 +63,8 @@ public interface IAdamRdmService { ...@@ -63,6 +63,8 @@ public interface IAdamRdmService {
AdamMemberSimpleVo getMemberSimpleVo(); AdamMemberSimpleVo getMemberSimpleVo();
String getMemberAgreement();
boolean setTagsForSex(List<AdamTagVo> voList); boolean setTagsForSex(List<AdamTagVo> voList);
List<AdamTagVo> getTagsForSex(); List<AdamTagVo> getTagsForSex();
......
...@@ -11,14 +11,15 @@ import org.slf4j.Logger; ...@@ -11,14 +11,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException; import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.WebRequest;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
...@@ -37,24 +38,25 @@ public class RestControllerAdviceHandler { ...@@ -37,24 +38,25 @@ public class RestControllerAdviceHandler {
@ExceptionHandler(value = Exception.class) @ExceptionHandler(value = Exception.class)
@ResponseBody @ResponseBody
public ResponseEntity<Error> serviceExceptionHandler(Exception rex, WebRequest request) { public ResponseEntity<Error> serviceExceptionHandler(Exception rex, HttpServletRequest req) {
logger.error("serviceExceptionHandler request:{},param:{}", request.getContextPath(), JSON.toJSONString(request.getParameterMap())); logger.error("Handler.RestControllerEx:{},ex:{},request:{},param:{}",
if (rex instanceof ConstraintViolationException) { rex.getClass().getSimpleName(), rex.getLocalizedMessage(), req.getRequestURI(), JSON.toJSONString(req.getParameterMap()));
ConstraintViolationException ygex = ((ConstraintViolationException) rex);
String message = ((ConstraintViolation) ygex.getConstraintViolations().toArray()[0]).getMessage();
logger.error("ConstraintViolationException code:{},msg:{}", ErrorCode.HTTP_PARAM_ERROR.getCode(), message);
return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK);
}
if (rex instanceof MissingServletRequestParameterException) { if (rex instanceof MissingServletRequestParameterException) {
MissingServletRequestParameterException ygex = ((MissingServletRequestParameterException) rex); MissingServletRequestParameterException ygex = ((MissingServletRequestParameterException) rex);
String message = ygex.getMessage(); String message = ygex.getMessage();
logger.error("ConstraintViolationException code:{},msg:{}", ErrorCode.HTTP_PARAM_ERROR.getCode(), message); return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK);
}
if (rex instanceof ConstraintViolationException) {
ConstraintViolationException ygex = ((ConstraintViolationException) rex);
ConstraintViolation violation = (ConstraintViolation) ygex.getConstraintViolations().toArray()[0];
String violationNode = violation.getPropertyPath().toString();
String message = violationNode.substring(violationNode.indexOf(".") + 1) + violation.getMessage();
return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK); return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK);
} }
if (rex instanceof MethodArgumentNotValidException) { if (rex instanceof MethodArgumentNotValidException) {
MethodArgumentNotValidException ygex = ((MethodArgumentNotValidException) rex); MethodArgumentNotValidException ygex = ((MethodArgumentNotValidException) rex);
String message = ygex.getBindingResult().getFieldErrors().get(0).getDefaultMessage(); FieldError fieldError = ygex.getBindingResult().getFieldErrors().get(0);
logger.error("ConstraintViolationException code:{},msg:{}", ErrorCode.HTTP_PARAM_ERROR.getCode(), message); String message = fieldError.getField() + fieldError.getDefaultMessage();
return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK); return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_PARAM_ERROR.getCode(), message), HttpStatus.OK);
} }
if (rex instanceof LiquidnetFeignException) { if (rex instanceof LiquidnetFeignException) {
...@@ -62,7 +64,6 @@ public class RestControllerAdviceHandler { ...@@ -62,7 +64,6 @@ public class RestControllerAdviceHandler {
String errorCode = ygex.errorCode().getCode(); String errorCode = ygex.errorCode().getCode();
String message = ygex.getMessage(); String message = ygex.getMessage();
message = message == null ? ygex.errorCode().getMessage() : message; message = message == null ? ygex.errorCode().getMessage() : message;
logger.error("LiquidnetFeignException code:{},msg:{}", errorCode, ygex.getMessage());
return new ResponseEntity<Error>(new Error(errorCode, message), HttpStatus.OK); return new ResponseEntity<Error>(new Error(errorCode, message), HttpStatus.OK);
} }
if (rex instanceof LiquidnetServiceException) { if (rex instanceof LiquidnetServiceException) {
...@@ -70,10 +71,8 @@ public class RestControllerAdviceHandler { ...@@ -70,10 +71,8 @@ public class RestControllerAdviceHandler {
String errorCode = ygex.errorCode().getCode(); String errorCode = ygex.errorCode().getCode();
String message = ygex.getMessage(); String message = ygex.getMessage();
message = message == null ? ygex.errorCode().getMessage() : message; message = message == null ? ygex.errorCode().getMessage() : message;
logger.error("LiquidnetServiceException code:{},msg:{}", errorCode, ygex.getMessage());
return new ResponseEntity<Error>(new Error(errorCode, message), HttpStatus.OK); return new ResponseEntity<Error>(new Error(errorCode, message), HttpStatus.OK);
} else { } else {
logger.error("serviceExceptionHandler unknown exception", rex);
return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_SYSTEM_ERROR.getCode(), ErrorCode.HTTP_SYSTEM_ERROR.getMessage()), HttpStatus.OK); return new ResponseEntity<Error>(new Error(ErrorCode.HTTP_SYSTEM_ERROR.getCode(), ErrorCode.HTTP_SYSTEM_ERROR.getMessage()), HttpStatus.OK);
} }
} }
......
...@@ -20,7 +20,8 @@ public class AdamRedisConst { ...@@ -20,7 +20,8 @@ public class AdamRedisConst {
public static final String INFO_TAGS_SEX = INFO.concat("tags:sex"); public static final String INFO_TAGS_SEX = INFO.concat("tags:sex");
public static final String INFO_TAGS_MUSIC = INFO.concat("tags:sex"); public static final String INFO_TAGS_MUSIC = INFO.concat("tags:sex");
public static final String INFO_MEMBER_SIMPLE = INFO.concat("member_simple"); public static final String INFO_MEMBER_SIMPLE = INFO.concat("member:simple");
public static final String INFO_MEMBER_AGREEMENT = INFO.concat("member:agreement");
public static final String INFO_MEMBERS = ADAM.concat(":list:members"); public static final String INFO_MEMBERS = ADAM.concat(":list:members");
public static final String INFO_MEMBERS_INFO = ADAM.concat(":list:members:info:"); public static final String INFO_MEMBERS_INFO = ADAM.concat(":list:members:info:");
......
...@@ -81,7 +81,7 @@ public class AdamAddressesController { ...@@ -81,7 +81,7 @@ public class AdamAddressesController {
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "设置默认收货地址") @ApiOperation(value = "设置默认收货地址")
@PostMapping("def/{addrId}") @PostMapping("def/{addrId}")
public ResponseDto<Object> def(@NotBlank(message = "收货地址ID不能为空") @PathVariable String addrId) { public ResponseDto<Object> def(@NotBlank @PathVariable String addrId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
AdamAddresses addresses = adamRdmService.getAddressesByUidAddressesId(currentUid, addrId); AdamAddresses addresses = adamRdmService.getAddressesByUidAddressesId(currentUid, addrId);
...@@ -115,7 +115,7 @@ public class AdamAddressesController { ...@@ -115,7 +115,7 @@ public class AdamAddressesController {
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ApiOperation(value = "删除收获地址") @ApiOperation(value = "删除收获地址")
@PostMapping("del/{addrId}") @PostMapping("del/{addrId}")
public ResponseDto<Object> del(@NotBlank(message = "收货地址ID不能为空") @PathVariable String addrId) { public ResponseDto<Object> del(@NotBlank @PathVariable String addrId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
...@@ -129,8 +129,8 @@ public class AdamAddressesController { ...@@ -129,8 +129,8 @@ public class AdamAddressesController {
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "收货地址详情") @ApiOperation(value = "收货地址详情")
@PostMapping("query/{id}") @PostMapping("query/{id}")
public ResponseDto<AdamAddressesVo> query(@NotBlank(message = "收货地址ID不能为空") @PathVariable(name = "id") String addrId, public ResponseDto<AdamAddressesVo> query(@NotBlank @PathVariable(name = "id") String addrId,
@NotBlank(message = "用户ID不能为空") @RequestParam(required = false) String uid) { @NotBlank @RequestParam(required = false) String uid) {
AdamAddresses addresses = adamRdmService.getAddressesByUidAddressesId(StringUtils.isBlank(uid) ? CurrentUtil.getCurrentUid() : uid, addrId); AdamAddresses addresses = adamRdmService.getAddressesByUidAddressesId(StringUtils.isBlank(uid) ? CurrentUtil.getCurrentUid() : uid, addrId);
return null == addresses ? ResponseDto.failure(ErrorMapping.get(10105)) : ResponseDto.success(AdamAddressesVo.getNew().copy(addresses)); return null == addresses ? ResponseDto.failure(ErrorMapping.get(10105)) : ResponseDto.success(AdamAddressesVo.getNew().copy(addresses));
......
...@@ -44,9 +44,9 @@ public class AdamCollectionController { ...@@ -44,9 +44,9 @@ public class AdamCollectionController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[1,64]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[1,64]"),
}) })
@PostMapping("add") @PostMapping("add")
public ResponseDto<Object> add(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效") public ResponseDto<Object> add(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效")
@RequestParam String type, @RequestParam String type,
@Size(min = 1, max = 64, message = "内容ID长度限制为1~64位字符") @Size(min = 1, max = 64)
@RequestParam String contentId) { @RequestParam String contentId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
...@@ -69,9 +69,9 @@ public class AdamCollectionController { ...@@ -69,9 +69,9 @@ public class AdamCollectionController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentIds", value = "内容ID[多个ID用','分隔]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentIds", value = "内容ID[多个ID用','分隔]"),
}) })
@PostMapping("del") @PostMapping("del")
public ResponseDto<Object> del(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效") public ResponseDto<Object> del(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效")
@RequestParam String type, @RequestParam String type,
@NotBlank(message = "内容Id不能为空") @RequestParam String contentIds) { @NotBlank @RequestParam String contentIds) {
adamCollectionService.del(CurrentUtil.getCurrentUid(), type, contentIds.split(",")); adamCollectionService.del(CurrentUtil.getCurrentUid(), type, contentIds.split(","));
return ResponseDto.success(); return ResponseDto.success();
...@@ -85,7 +85,7 @@ public class AdamCollectionController { ...@@ -85,7 +85,7 @@ public class AdamCollectionController {
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "5"), @ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "5"),
}) })
@PostMapping("list") @PostMapping("list")
public ResponseDto<PageInfo<AdamCollectVo>> list(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效") public ResponseDto<PageInfo<AdamCollectVo>> list(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效")
@RequestParam String type, @RequestParam String type,
@RequestParam(defaultValue = "1", required = false) int pageNo, @RequestParam(defaultValue = "1", required = false) int pageNo,
@RequestParam(defaultValue = "5", required = false) int pageSize) { @RequestParam(defaultValue = "5", required = false) int pageSize) {
...@@ -117,9 +117,9 @@ public class AdamCollectionController { ...@@ -117,9 +117,9 @@ public class AdamCollectionController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[64]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[64]"),
}) })
@GetMapping("state") @GetMapping("state")
public ResponseDto<Boolean> state(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效") public ResponseDto<Boolean> state(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "收藏类型无效")
@RequestParam String type, @RequestParam String type,
@Size(min = 1, max = 64, message = "内容ID长度限制为1~64位字符") @Size(min = 1, max = 64)
@RequestParam String contentId) { @RequestParam String contentId) {
return ResponseDto.success(adamCollectionService.queryState(CurrentUtil.getCurrentUid(), type, contentId)); return ResponseDto.success(adamCollectionService.queryState(CurrentUtil.getCurrentUid(), type, contentId));
} }
......
...@@ -45,9 +45,9 @@ public class AdamDisposedController { ...@@ -45,9 +45,9 @@ public class AdamDisposedController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[1,64]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[1,64]"),
}) })
@PostMapping("add") @PostMapping("add")
public ResponseDto<Object> add(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效") public ResponseDto<Object> add(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效")
@RequestParam String type, @RequestParam String type,
@Size(min = 1, max = 64, message = "内容ID长度限制为1~64位字符") @Size(min = 1, max = 64)
@RequestParam String contentId) { @RequestParam String contentId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
...@@ -71,9 +71,9 @@ public class AdamDisposedController { ...@@ -71,9 +71,9 @@ public class AdamDisposedController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentIds", value = "内容ID[多个ID用','分隔]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentIds", value = "内容ID[多个ID用','分隔]"),
}) })
@PostMapping("del") @PostMapping("del")
public ResponseDto<Object> del(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效") public ResponseDto<Object> del(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效")
@RequestParam String type, @RequestParam String type,
@NotBlank(message = "内容Id不能为空") @RequestParam String contentIds) { @NotBlank @RequestParam String contentIds) {
adamDisposedService.del(CurrentUtil.getCurrentUid(), type, contentIds.split(",")); adamDisposedService.del(CurrentUtil.getCurrentUid(), type, contentIds.split(","));
return ResponseDto.success(); return ResponseDto.success();
...@@ -87,7 +87,7 @@ public class AdamDisposedController { ...@@ -87,7 +87,7 @@ public class AdamDisposedController {
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "5"), @ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "5"),
}) })
@PostMapping("list") @PostMapping("list")
public ResponseDto<PageInfo<AdamDisposedVo>> list(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效") public ResponseDto<PageInfo<AdamDisposedVo>> list(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效")
@RequestParam String type, @RequestParam String type,
@RequestParam(defaultValue = "1", required = false) int pageNo, @RequestParam(defaultValue = "1", required = false) int pageNo,
@RequestParam(defaultValue = "5", required = false) int pageSize) { @RequestParam(defaultValue = "5", required = false) int pageSize) {
...@@ -106,9 +106,9 @@ public class AdamDisposedController { ...@@ -106,9 +106,9 @@ public class AdamDisposedController {
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "10"), @ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "pageSize", value = "页展示条数", example = "10"),
}) })
@PostMapping("list/user") @PostMapping("list/user")
public ResponseDto<PageInfo<AdamDisposedUserVo>> listUser(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效") public ResponseDto<PageInfo<AdamDisposedUserVo>> listUser(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效")
@RequestParam String type, @RequestParam String type,
@Size(min = 1, max = 64, message = "内容ID长度限制为1~64位字符") @Size(min = 1, max = 64)
@RequestParam String contentId, @RequestParam String contentId,
@RequestParam(defaultValue = "1", required = false) int pageNo, @RequestParam(defaultValue = "1", required = false) int pageNo,
@RequestParam(defaultValue = "10", required = false) int pageSize) { @RequestParam(defaultValue = "10", required = false) int pageSize) {
...@@ -125,9 +125,9 @@ public class AdamDisposedController { ...@@ -125,9 +125,9 @@ public class AdamDisposedController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[64]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "contentId", value = "内容ID[64]"),
}) })
@GetMapping("state") @GetMapping("state")
public ResponseDto<Boolean> state(@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效") public ResponseDto<Boolean> state(//@Pattern(regexp = "\\b(TICKET,VIDEO)\\b", message = "想去类型无效")
@RequestParam String type, @RequestParam String type,
@Size(min = 1, max = 64, message = "内容ID长度限制为1~64位字符") @Size(min = 1, max = 64)
@RequestParam String contentId) { @RequestParam String contentId) {
return ResponseDto.success(adamDisposedService.queryState(CurrentUtil.getCurrentUid(), type, contentId)); return ResponseDto.success(adamDisposedService.queryState(CurrentUtil.getCurrentUid(), type, contentId));
} }
......
...@@ -81,7 +81,7 @@ public class AdamEntersController { ...@@ -81,7 +81,7 @@ public class AdamEntersController {
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "设置默认入场人") @ApiOperation(value = "设置默认入场人")
@PostMapping("def/{entersId}") @PostMapping("def/{entersId}")
public ResponseDto<Object> def(@NotBlank(message = "入场人ID不能为空") @PathVariable String entersId) { public ResponseDto<Object> def(@NotBlank @PathVariable String entersId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
AdamEnters enters = adamRdmService.getEntersByUidEntersId(currentUid, entersId); AdamEnters enters = adamRdmService.getEntersByUidEntersId(currentUid, entersId);
if (null == enters) return ResponseDto.failure(ErrorMapping.get("10105")); if (null == enters) return ResponseDto.failure(ErrorMapping.get("10105"));
...@@ -118,7 +118,7 @@ public class AdamEntersController { ...@@ -118,7 +118,7 @@ public class AdamEntersController {
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@ApiOperation(value = "删除入场人") @ApiOperation(value = "删除入场人")
@PostMapping("del/{entersId}") @PostMapping("del/{entersId}")
public ResponseDto<Object> del(@NotBlank(message = "入场人ID不能为空") @PathVariable String entersId) { public ResponseDto<Object> del(@NotBlank @PathVariable String entersId) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
AdamEnters enters = adamRdmService.getEntersByUidEntersId(currentUid, entersId); AdamEnters enters = adamRdmService.getEntersByUidEntersId(currentUid, entersId);
...@@ -130,9 +130,9 @@ public class AdamEntersController { ...@@ -130,9 +130,9 @@ public class AdamEntersController {
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@ApiOperation(value = "入场人详情") @ApiOperation(value = "入场人详情")
@PostMapping("query/{id}") @PostMapping("query/{entersId}")
public ResponseDto<AdamEntersVo> query(@NotBlank(message = "入场人ID不能为空") @PathVariable(name = "id") String entersId, public ResponseDto<AdamEntersVo> query(@NotBlank @PathVariable String entersId,
@NotBlank(message = "用户ID不能为空") @RequestParam(required = false) String uid) { @NotBlank @RequestParam(required = false) String uid) {
AdamEnters info = adamRdmService.getEntersByUidEntersId(StringUtils.isBlank(uid) ? CurrentUtil.getCurrentUid() : uid, entersId); AdamEnters info = adamRdmService.getEntersByUidEntersId(StringUtils.isBlank(uid) ? CurrentUtil.getCurrentUid() : uid, entersId);
return null == info ? ResponseDto.failure(ErrorMapping.get(10105)) : ResponseDto.success(AdamEntersVo.getNew().copy(info)); return null == info ? ResponseDto.failure(ErrorMapping.get(10105)) : ResponseDto.success(AdamEntersVo.getNew().copy(info));
......
...@@ -226,7 +226,7 @@ public class AdamUserController { ...@@ -226,7 +226,7 @@ public class AdamUserController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "platform", value = "平台类型", allowableValues = "WEIBO,WECHAT,QQ"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "platform", value = "平台类型", allowableValues = "WEIBO,WECHAT,QQ"),
}) })
@PostMapping(value = {"tpa/unbind/{platform}"}) @PostMapping(value = {"tpa/unbind/{platform}"})
public ResponseDto<List<AdamThirdPartInfoVo>> unbindTpa(@Pattern(regexp = "\\b(WEIBO,WECHAT,QQ)\\b", message = "平台类型无效") public ResponseDto<List<AdamThirdPartInfoVo>> unbindTpa(//@Pattern(regexp = "\\b(WEIBO,WECHAT,QQ)\\b", message = "平台类型无效")
@PathVariable String platform) { @PathVariable String platform) {
String currentUid = CurrentUtil.getCurrentUid(); String currentUid = CurrentUtil.getCurrentUid();
log.debug("unbind tpa.platform:{},uid:{}", platform, currentUid); log.debug("unbind tpa.platform:{},uid:{}", platform, currentUid);
......
...@@ -219,6 +219,7 @@ public class AdamRdmServiceImpl implements IAdamRdmService { ...@@ -219,6 +219,7 @@ public class AdamRdmServiceImpl implements IAdamRdmService {
public AdamMemberSimpleVo getMemberSimpleVo() { public AdamMemberSimpleVo getMemberSimpleVo() {
AdamMemberSimpleVo simpleVo = (AdamMemberSimpleVo) redisUtil.get(AdamRedisConst.INFO_MEMBER_SIMPLE); AdamMemberSimpleVo simpleVo = (AdamMemberSimpleVo) redisUtil.get(AdamRedisConst.INFO_MEMBER_SIMPLE);
if (null == simpleVo) { if (null == simpleVo) {
// TODO: 2021/6/8
List<AdamMemberSimpleVo> simpleVoList = mongoTemplate.findAll(AdamMemberSimpleVo.class, AdamMemberVo.class.getSimpleName()); List<AdamMemberSimpleVo> simpleVoList = mongoTemplate.findAll(AdamMemberSimpleVo.class, AdamMemberVo.class.getSimpleName());
simpleVo = CollectionUtils.isEmpty(simpleVoList) ? null : simpleVoList.get(0); simpleVo = CollectionUtils.isEmpty(simpleVoList) ? null : simpleVoList.get(0);
...@@ -228,6 +229,11 @@ public class AdamRdmServiceImpl implements IAdamRdmService { ...@@ -228,6 +229,11 @@ public class AdamRdmServiceImpl implements IAdamRdmService {
return simpleVo; return simpleVo;
} }
@Override
public String getMemberAgreement() {
return (String) redisUtil.get(AdamRedisConst.INFO_MEMBER_AGREEMENT);
}
@Override @Override
public boolean setTagsForSex(List<AdamTagVo> voList) { public boolean setTagsForSex(List<AdamTagVo> voList) {
return redisUtil.set(AdamRedisConst.INFO_TAGS_SEX, voList); return redisUtil.set(AdamRedisConst.INFO_TAGS_SEX, voList);
......
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