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

Commit 541d7213 authored by 张国柄's avatar 张国柄

+shumei valid impl;

parent bbb32532
...@@ -102,10 +102,8 @@ public class AdamLoginInfoVo implements Serializable, Cloneable { ...@@ -102,10 +102,8 @@ public class AdamLoginInfoVo implements Serializable, Cloneable {
} }
} }
public AdamLoginInfoVo desensitize() { public AdamLoginInfoVo desensitize(Boolean reviewUserInfo) {
this.userInfo.setPasswd(null); this.userInfo.desensitize(reviewUserInfo);
// this.userInfo.setPayCode(null);
this.userInfo.setMobile(SensitizeUtil.custom(userInfo.getMobile(), 3, 4));
return this; return this;
} }
} }
...@@ -9,8 +9,10 @@ import com.liquidnet.service.adam.dto.AdamUserInfoDto; ...@@ -9,8 +9,10 @@ import com.liquidnet.service.adam.dto.AdamUserInfoDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List; import java.util.List;
@ApiModel(value = "AdamUserInfoVo", description = "用户详情") @ApiModel(value = "AdamUserInfoVo", description = "用户详情")
...@@ -23,7 +25,7 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable { ...@@ -23,7 +25,7 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable {
private String mobile; private String mobile;
@ApiModelProperty(position = 12, value = "登录密码[64],只针对PHP老用户,新用户无此功能") @ApiModelProperty(position = 12, value = "登录密码[64],只针对PHP老用户,新用户无此功能")
private String passwd; private String passwd;
// @ApiModelProperty(position = 13, value = "支付密码[30],暂无此功能") // @ApiModelProperty(position = 13, value = "支付密码[30],暂无此功能")
// private String payCode; // private String payCode;
@ApiModelProperty(position = 14, value = "昵称[32]") @ApiModelProperty(position = 14, value = "昵称[32]")
private String nickname; private String nickname;
...@@ -44,13 +46,13 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable { ...@@ -44,13 +46,13 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable {
@ApiModelProperty(position = 22, value = "标签") @ApiModelProperty(position = 22, value = "标签")
private List<AdamTagParentVo> tagMe; private List<AdamTagParentVo> tagMe;
@ApiModelProperty(position = 23, value = "注册时间") @ApiModelProperty(position = 23, value = "注册时间")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime createAt; private LocalDateTime createAt;
@ApiModelProperty(position = 24, value = "最近一次更新时间") @ApiModelProperty(position = 24, value = "最近一次更新时间")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime updatedAt; private LocalDateTime updatedAt;
@ApiModelProperty(position = 25, value = "注销时间") @ApiModelProperty(position = 25, value = "注销时间")
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DateUtil.DATE_FULL_STR)
private LocalDateTime closedAt; private LocalDateTime closedAt;
@ApiModelProperty(position = 26, value = "完善信息进度[0-未完善,1-已完善]") @ApiModelProperty(position = 26, value = "完善信息进度[0-未完善,1-已完善]")
private Integer isComplete; private Integer isComplete;
...@@ -85,7 +87,8 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable { ...@@ -85,7 +87,8 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable {
this.setAvatar(source.getAvatar()); this.setAvatar(source.getAvatar());
this.setBackground(source.getBackground()); this.setBackground(source.getBackground());
this.setTagMe(JsonUtils.fromJson(source.getTagMe(), new TypeReference<List<AdamTagParentVo>>() {})); this.setTagMe(JsonUtils.fromJson(source.getTagMe(), new TypeReference<List<AdamTagParentVo>>() {
}));
this.setCreateAt(source.getCreateAt()); this.setCreateAt(source.getCreateAt());
this.setUpdatedAt(source.getUpdatedAt()); this.setUpdatedAt(source.getUpdatedAt());
this.setClosedAt(source.getClosedAt()); this.setClosedAt(source.getClosedAt());
...@@ -96,10 +99,42 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable { ...@@ -96,10 +99,42 @@ public class AdamUserInfoVo implements java.io.Serializable, Cloneable {
return this; return this;
} }
public AdamUserInfoVo desensitize() { public AdamUserInfoVo desensitize(Boolean reviewUserInfo) {
this.setPasswd(null); this.setPasswd(null);
// this.userInfo.setPayCode(null); // this.userInfo.setPayCode(null);
this.setMobile(SensitizeUtil.custom(this.getMobile(), 3, 4)); this.setMobile(SensitizeUtil.custom(this.getMobile(), 3, 4));
if (null != reviewUserInfo && reviewUserInfo) {
if (!StringUtils.startsWith(this.nickname, "宇航员")) {
this.setNickname(SensitizeUtil.custom(this.nickname, 1, 0) + "(审核中)");
}
if (StringUtils.isNotEmpty(this.signature)) {
this.setSignature(SensitizeUtil.custom(this.signature, 1, 0) + "(审核中)");
}
if (StringUtils.isNotEmpty(this.avatar)) {
List<String> defaultAvatarUrlList = Arrays.asList(
"https://img.zhengzai.tv/user/2021/07/27/a4cc2a4e6dcd44d1812dc60e079086b4.png",
"http://pic.zhengzai.tv/479639664.110103C8012C8595A200678A2C06D93D678A3D.png",
"http://pic.zhengzai.tv/default/avatar.png",
"http://img.zhengzai.tv/ticket/20171020/1508473543738.jpg"
);
if (!defaultAvatarUrlList.contains(this.avatar)) {
this.setAvatar("https://img.zhengzai.tv/headerreview.png");
}
}
if (StringUtils.isNotEmpty(this.background)) {
List<String> defaultBkgroudUrlList = Arrays.asList(
"https://img.zhengzai.tv/files/2021/01/13/5ffeab3584b7d.png",
"http://pic.zhengzai.tv/default/background.png",
"http://img.zhengzai.tv/album/20171027/1509106243302.png",
"https://img.zhengzai.tv/other/2021/07/27/150eeb0e20af4fc88e8a1ec57c46c362.png"
);
if (!defaultBkgroudUrlList.contains(this.background)) {
this.setBackground("https://img.zhengzai.tv/bkgroundreview.png");
}
}
}
return this; return this;
} }
} }
...@@ -60,6 +60,9 @@ import java.util.Objects; ...@@ -60,6 +60,9 @@ import java.util.Objects;
public class AdamLoginController { public class AdamLoginController {
@Autowired @Autowired
Environment env; Environment env;
@Value("${liquidnet.reviewer.user-info}")
private Boolean reviewUserInfo;
@Autowired @Autowired
RedisUtil redisUtil; RedisUtil redisUtil;
@Autowired @Autowired
...@@ -137,7 +140,7 @@ public class AdamLoginController { ...@@ -137,7 +140,7 @@ public class AdamLoginController {
loginInfoVo.setUserMemberVo(adamRdmService.getUserMemberVoByUid(userInfoVo.getUid())); loginInfoVo.setUserMemberVo(adamRdmService.getUserMemberVoByUid(userInfoVo.getUid()));
log.info(UserPathDto.setData("登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo)); log.info(UserPathDto.setData("登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo.desensitize()); return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
...@@ -174,7 +177,7 @@ public class AdamLoginController { ...@@ -174,7 +177,7 @@ public class AdamLoginController {
} }
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo)); log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo.desensitize()); return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
...@@ -201,7 +204,7 @@ public class AdamLoginController { ...@@ -201,7 +204,7 @@ public class AdamLoginController {
} }
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo)); log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo.desensitize()); return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
...@@ -252,7 +255,7 @@ public class AdamLoginController { ...@@ -252,7 +255,7 @@ public class AdamLoginController {
loginInfoVo.setWechatUnionid(wechatUnionid); loginInfoVo.setWechatUnionid(wechatUnionid);
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo)); log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo.desensitize()); return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
...@@ -286,7 +289,7 @@ public class AdamLoginController { ...@@ -286,7 +289,7 @@ public class AdamLoginController {
loginInfoVo.setToken(this.ssoProcess(loginInfoVo.getUserInfo())); loginInfoVo.setToken(this.ssoProcess(loginInfoVo.getUserInfo()));
log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo)); log.info(UserPathDto.setData(toRegister ? "注册" : "登录", ServletUtils.getRequest().getParameterMap(), loginInfoVo));
return ResponseDto.success(loginInfoVo.desensitize()); return ResponseDto.success(loginInfoVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
......
...@@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -25,6 +25,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -47,6 +48,9 @@ import java.util.Optional; ...@@ -47,6 +48,9 @@ import java.util.Optional;
public class AdamUserController { public class AdamUserController {
@Autowired @Autowired
Environment env; Environment env;
@Value("${liquidnet.reviewer.user-info}")
private Boolean reviewUserInfo;
@Autowired @Autowired
AdamRdmService adamRdmService; AdamRdmService adamRdmService;
@Autowired @Autowired
...@@ -136,8 +140,8 @@ public class AdamUserController { ...@@ -136,8 +140,8 @@ public class AdamUserController {
editVo.setIsComplete(1); editVo.setIsComplete(1);
adamUserInfoService.edit(editVo); adamUserInfoService.edit(editVo);
editVo.setMobile(SensitizeUtil.custom(editVo.getMobile(), 3, 4)); // editVo.setMobile(SensitizeUtil.custom(editVo.getMobile(), 3, 4));
return ResponseDto.success(editVo); return ResponseDto.success(editVo.desensitize(reviewUserInfo));
} }
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
...@@ -306,7 +310,7 @@ public class AdamUserController { ...@@ -306,7 +310,7 @@ public class AdamUserController {
Map<String, Object> map = CollectionUtil.mapStringObject(); Map<String, Object> map = CollectionUtil.mapStringObject();
AdamUserInfoVo userInfoVo = adamRdmService.getUserInfoVoByUid(currentUid); AdamUserInfoVo userInfoVo = adamRdmService.getUserInfoVoByUid(currentUid);
map.put("userInfo", userInfoVo.desensitize()); map.put("userInfo", userInfoVo.desensitize(reviewUserInfo));
map.put("realNameInfo", adamRdmService.getRealInfoVoByUid(currentUid)); map.put("realNameInfo", adamRdmService.getRealInfoVoByUid(currentUid));
map.put("thirdPartInfo", adamRdmService.getThirdPartVoListByUid(currentUid)); map.put("thirdPartInfo", adamRdmService.getThirdPartVoListByUid(currentUid));
map.put("userMemberVo", adamRdmService.getUserMemberVoByUid(currentUid)); map.put("userMemberVo", adamRdmService.getUserMemberVoByUid(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