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

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

+api:用户身份信息获取、验证手机号;

parent 953bf34c
package com.liquidnet.service.adam.dto.vo;
import com.liquidnet.commons.lang.util.DESUtils;
import com.liquidnet.commons.lang.util.SensitizeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ApiModel(value = "AdamUserIdentityVo", description = "用户身份信息")
@Data
public class AdamUserIdentityInfoVo implements Serializable, Cloneable {
private static final long serialVersionUID = -5828611827493373384L;
@ApiModelProperty(position = 10, value = "用户ID[30]")
private String uid;
@ApiModelProperty(position = 11, value = "脱敏姓名[30]")
private String name;
@ApiModelProperty(position = 12, value = "脱敏手机号[11]")
private String mobile;
@ApiModelProperty(position = 15, value = "数据包")
private String packet;
private static final AdamUserIdentityInfoVo obj = new AdamUserIdentityInfoVo();
public static AdamUserIdentityInfoVo getNew() {
return obj.clone();
}
@Override
public AdamUserIdentityInfoVo clone() {
try {
return (AdamUserIdentityInfoVo) super.clone();
} catch (CloneNotSupportedException e) {
return new AdamUserIdentityInfoVo();
}
}
/**
* 脱敏处理
*
* @return AdamUserIdentityVo
*/
public AdamUserIdentityInfoVo desensitize() {
try {
this.packet = DESUtils.DES().encrypt(uid.concat(",").concat(name).concat(",").concat(mobile));
} catch (Exception e) {
this.packet = "Nil";
}
this.setName(SensitizeUtil.custom(this.getName(), 0, 1));
this.setMobile(SensitizeUtil.custom(this.getMobile(), 3, 4));
return this;
}
}
...@@ -171,6 +171,15 @@ public abstract class AbstractRedisUtil { ...@@ -171,6 +171,15 @@ public abstract class AbstractRedisUtil {
// ============================String============================= // ============================String=============================
public Long ttl(String key) {
if (null == key) {
return 0L;
}
key = this.fillingKey(key);
return this.getRedisConfig().getRedisTemplateByDb(this.getIndex(key)).opsForValue().getOperations().getExpire(key);
}
/** /**
* 普通缓存获取 * 普通缓存获取
* *
......
...@@ -499,6 +499,10 @@ alter table adam_addresses add town varchar(50) null comment '街道/镇' after ...@@ -499,6 +499,10 @@ alter table adam_addresses add town varchar(50) null comment '街道/镇' after
alter table adam_addresses add town_id varchar(20) null comment '街道行政编码' after town; alter table adam_addresses add town_id varchar(20) null comment '街道行政编码' after town;
alter table adam_addresses modify address varchar(255) not null comment '详细地址'; alter table adam_addresses modify address varchar(255) not null comment '详细地址';
alter table adam_addresses add full_address varchar(500) null comment '完整地址' after address; alter table adam_addresses add full_address varchar(500) null comment '完整地址' after address;
-- >>------------------------------------------------------------------------------------ |20220323三要素实名
alter table adam_real_name add node tinyint default 2 not null comment '认证节点[2-二要素|3-三要素]' after type;
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
-- >>------------------------------------------------------------------------------------ -- >>------------------------------------------------------------------------------------
\ No newline at end of file
...@@ -467,41 +467,38 @@ public class AdamUserController { ...@@ -467,41 +467,38 @@ public class AdamUserController {
} }
} }
// @ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
// @ApiOperation(value = "业务账号开通") @ApiOperation(value = "用户身份信息")
// @ApiImplicitParams({ @ApiImplicitParams({
// @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "bizCode", value = "业务码[NFT_ZX]", allowableValues = "NFT_ZX"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mobile", value = "手机号"),
// @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "name", value = "姓名"), })
// @ApiImplicitParam(type = "form", required = false, dataType = "String", name = "idCard", value = "身份证号"), @GetMapping(value = "info/identity")
// }) public ResponseDto<AdamUserIdentityInfoVo> identityInfoByMobile(@Pattern(regexp = "\\d{11}", message = "手机号格式有误")
// @PostMapping(value = "open/account") @RequestParam(name = "mobile", required = false) String mobile) {
// public ResponseDto<AdamUserBizAcctVo> openAccount(@Pattern(regexp = "\\b(NFT_ZX)\\b", message = "业务码无效") String uid = null == mobile ? CurrentUtil.getCurrentUid() : adamRdmService.getUidByMobile(mobile);
// @RequestParam String bizCode, AdamUserInfoVo userInfoVo;
// @RequestParam(required = false) String name, if (uid == null || null == (userInfoVo = adamRdmService.getUserInfoVoByUid(uid))) {
// @RequestParam(required = false) String idCard) { log.warn("###用户不存在[MOBILE:{},UID:{},TOKEN:{}]", mobile, uid, CurrentUtil.getToken());
// if (StringUtils.isNotBlank(name) && !name.contains("*")) { return ResponseDto.failure("账号不存在,请确认");
// if (!java.util.regex.Pattern.matches(LnsRegex.Valid.CN_HANZI, name)) { }
// return ResponseDto.failure(ErrorMapping.get("10103")); AdamRealInfoVo realInfoVoByUidPlain = adamRdmService.getRealInfoVoByUidPlain(uid);
// } AdamUserIdentityInfoVo userIdentityInfoVo = AdamUserIdentityInfoVo.getNew();
// if (!java.util.regex.Pattern.matches(LnsRegex.Valid.CN_ID_CARD_REF, idCard)) { userIdentityInfoVo.setUid(uid);
// return ResponseDto.failure(ErrorMapping.get("10104")); userIdentityInfoVo.setName(realInfoVoByUidPlain.getName());
// } userIdentityInfoVo.setMobile(mobile);
// if (IDCardUtil.getAge(idCard) < 18) { return ResponseDto.success(userIdentityInfoVo.desensitize());
// return ResponseDto.failure(ErrorMapping.get("10100")); }
// }
// } @ApiOperationSupport(order = 12)
// String currentUid = CurrentUtil.getCurrentUid(); @ApiOperation(value = "验证手机号")
// String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE); @ApiImplicitParams({
// try { @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mobile", value = "手机号[用于验证当前账户所绑定手机号]"),
// return adamUserBusiAcctService.openAccount(currentUid, bizCode, name, idCard, mobile); })
// } catch (Exception e) { @PostMapping(value = {"check/mobile"})
// if (e instanceof LiquidnetServiceException) { public ResponseDto<Object> checkMobile(@Pattern(regexp = "\\d{11}", message = "手机号格式有误") @RequestParam String mobile) {
// LiquidnetServiceException lsEx = (LiquidnetServiceException) e; String currentMobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE);
// return ResponseDto.failure(lsEx.getCode(), lsEx.getMessage()); return mobile.equals(currentMobile) ? ResponseDto.success() : ResponseDto.failure(ErrorMapping.get("10003"));
// } }
// return ResponseDto.failure(ErrorMapping.get("10113"));
// }
// }
/* ---------------------------- Internal Method ---------------------------- */ /* ---------------------------- Internal Method ---------------------------- */
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
10000=\u64CD\u4F5C\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5 10000=\u64CD\u4F5C\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5
10001=\u6388\u6743\u5931\u8D25 10001=\u6388\u6743\u5931\u8D25
10002=\u9A8C\u8BC1\u7801\u53D1\u9001\u5931\u8D25 10002=\u9A8C\u8BC1\u7801\u53D1\u9001\u5931\u8D25
10003=\u8BF7\u8F93\u5165\u6B63\u786E\u624B\u673A\u53F7 10003=\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7
10004=\u8BF7\u8F93\u5165\u6B63\u786E\u9A8C\u8BC1\u7801 10004=\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801
10005=\u624B\u673A\u53F7\u83B7\u53D6\u5931\u8D25\uFF0C\u8BF7\u66F4\u6362\u767B\u5F55\u65B9\u5F0F 10005=\u624B\u673A\u53F7\u83B7\u53D6\u5931\u8D25\uFF0C\u8BF7\u66F4\u6362\u767B\u5F55\u65B9\u5F0F
10006=\u7B2C\u4E09\u65B9\u8D26\u53F7\u672A\u6CE8\u518C 10006=\u7B2C\u4E09\u65B9\u8D26\u53F7\u672A\u6CE8\u518C
10007=\u8BE5\u7B2C\u4E09\u65B9\u8D26\u53F7\u5DF2\u7ECF\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A 10007=\u8BE5\u7B2C\u4E09\u65B9\u8D26\u53F7\u5DF2\u7ECF\u88AB\u5176\u4ED6\u7528\u6237\u7ED1\u5B9A
......
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