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

Commit cf0214a6 authored by jiangxiulong's avatar jiangxiulong

开通和获取整理

parent 0a5de099
...@@ -8,7 +8,7 @@ public class NftAccStatusEnum { ...@@ -8,7 +8,7 @@ public class NftAccStatusEnum {
ING("1000", "开通中"), ING("1000", "开通中"),
SUCCESS("2000", "开通成功"), SUCCESS("2000", "开通成功"),
FAILURE1("3000", "实名失败"), FAILURE1("3000", "实名失败"),
FAILURE2("3001", "开通失败 重试"), FAILURE2("3001", "开通失败重试"),
FAILURE3("3002", "该身份证已开通数字账号 不可重复操作"), FAILURE3("3002", "该身份证已开通数字账号 不可重复操作"),
; ;
private final String code; private final String code;
......
...@@ -15,7 +15,7 @@ public class GoblinUserNftAccInfoVo implements Serializable, Cloneable { ...@@ -15,7 +15,7 @@ public class GoblinUserNftAccInfoVo implements Serializable, Cloneable {
private static final long serialVersionUID = 9036417838200526658L; private static final long serialVersionUID = 9036417838200526658L;
@ApiModelProperty(position = 11, value = "状态码") @ApiModelProperty(position = 11, value = "状态码 1000开通中 2000开通成功 3000实名失败 3001开通失败可重试 3002该身份证已开通数字账号 不可重复操作")
private String code; private String code;
@ApiModelProperty(position = 12, value = "提示信息") @ApiModelProperty(position = 12, value = "提示信息")
private String msg; private String msg;
......
package com.liquidnet.service.goblin.service; package com.liquidnet.service.goblin.service;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo;
public interface IGoblinNftUserService { public interface IGoblinNftUserService {
...@@ -14,5 +15,5 @@ public interface IGoblinNftUserService { ...@@ -14,5 +15,5 @@ public interface IGoblinNftUserService {
* @param mobile 手机号 * @param mobile 手机号
* @return Integer[1-成功] * @return Integer[1-成功]
*/ */
ResponseDto<Integer> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile); ResponseDto<GoblinUserNftAccInfoVo> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile);
} }
...@@ -7,6 +7,7 @@ import com.liquidnet.commons.lang.util.CurrentUtil; ...@@ -7,6 +7,7 @@ import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.IDCardUtil; import com.liquidnet.commons.lang.util.IDCardUtil;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.NftAccStatusEnum;
import com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo; import com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo;
import com.liquidnet.service.goblin.service.IGoblinNftUserService; import com.liquidnet.service.goblin.service.IGoblinNftUserService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
...@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;
@Api(tags = "NFT:账号相关") @Api(tags = "NFT:账号相关")
@Slf4j @Slf4j
...@@ -39,7 +41,7 @@ public class GoblinNFTUserController { ...@@ -39,7 +41,7 @@ public class GoblinNFTUserController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "idCard", value = "身份证号"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "idCard", value = "身份证号"),
}) })
@PostMapping(value = "open/account") @PostMapping(value = "open/account")
public ResponseDto<Integer> openAccount(@Pattern(regexp = "\\b(NFT_ZX)\\b", message = "业务码无效") public ResponseDto<GoblinUserNftAccInfoVo> openAccount(@Pattern(regexp = "\\b(NFT_ZX)\\b", message = "业务码无效")
@RequestParam String bizCode, @RequestParam String bizCode,
@RequestParam(required = true) String name, @RequestParam(required = true) String name,
@RequestParam(required = true) String idCard) { @RequestParam(required = true) String idCard) {
...@@ -77,7 +79,11 @@ public class GoblinNFTUserController { ...@@ -77,7 +79,11 @@ public class GoblinNFTUserController {
@ApiOperation(value = "业务账号开通信息") @ApiOperation(value = "业务账号开通信息")
@GetMapping(value = "open/account/info") @GetMapping(value = "open/account/info")
public ResponseDto<GoblinUserNftAccInfoVo> openAccountInfo() { public ResponseDto<GoblinUserNftAccInfoVo> openAccountInfo() {
goblinRedisUtils.setOpenAccountInfo(CurrentUtil.getCurrentUid()); GoblinUserNftAccInfoVo nftAccInfoVo = GoblinUserNftAccInfoVo.getNew();
return ResponseDto.success(goblinRedisUtils.openAccountInfo(CurrentUtil.getCurrentUid())); nftAccInfoVo.setCode(NftAccStatusEnum.StatusAcc.ING.getCode());
nftAccInfoVo.setMsg(NftAccStatusEnum.StatusAcc.ING.getMsg());
nftAccInfoVo.setTime(LocalDateTime.now());
goblinRedisUtils.setOpenAccountInfo(CurrentUtil.getCurrentUid(), nftAccInfoVo);
return ResponseDto.success(goblinRedisUtils.getOpenAccountInfo(CurrentUtil.getCurrentUid()));
} }
} }
...@@ -9,6 +9,8 @@ import com.liquidnet.service.galaxy.constant.GalaxyEnum; ...@@ -9,6 +9,8 @@ import com.liquidnet.service.galaxy.constant.GalaxyEnum;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto; import com.liquidnet.service.galaxy.dto.param.GalaxyUserRegisterRespDto;
import com.liquidnet.service.galaxy.service.IGalaxyUserService; import com.liquidnet.service.galaxy.service.IGalaxyUserService;
import com.liquidnet.service.goblin.constant.NftAccStatusEnum;
import com.liquidnet.service.goblin.dto.GoblinUserNftAccInfoVo;
import com.liquidnet.service.goblin.service.IGoblinNftUserService; import com.liquidnet.service.goblin.service.IGoblinNftUserService;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.QueueUtils; import com.liquidnet.service.goblin.util.QueueUtils;
...@@ -30,8 +32,9 @@ public class GoblinNftUserServiceImpl implements IGoblinNftUserService { ...@@ -30,8 +32,9 @@ public class GoblinNftUserServiceImpl implements IGoblinNftUserService {
private IGalaxyUserService galaxyUserService; private IGalaxyUserService galaxyUserService;
@Override @Override
public ResponseDto<Integer> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile) { public ResponseDto<GoblinUserNftAccInfoVo> openNftAccount(String uid, String bizCode, String name, String idCard, String mobile) {
if (goblinRedisUtils.getNftNumAccount(uid)) return ResponseDto.success(1); GoblinUserNftAccInfoVo openAccountInfo = goblinRedisUtils.getOpenAccountInfo(uid);
if (null != openAccountInfo) return ResponseDto.success(openAccountInfo);
switch (bizCode) { switch (bizCode) {
case "NFT_ZX": case "NFT_ZX":
GalaxyUserRegisterReqDto userRegisterReqDto = GalaxyUserRegisterReqDto.getNew(); GalaxyUserRegisterReqDto userRegisterReqDto = GalaxyUserRegisterReqDto.getNew();
...@@ -44,14 +47,18 @@ public class GoblinNftUserServiceImpl implements IGoblinNftUserService { ...@@ -44,14 +47,18 @@ public class GoblinNftUserServiceImpl implements IGoblinNftUserService {
ResponseDto<GalaxyUserRegisterRespDto> userRegisterRespDto = galaxyUserService.userRegister(userRegisterReqDto); ResponseDto<GalaxyUserRegisterRespDto> userRegisterRespDto = galaxyUserService.userRegister(userRegisterReqDto);
if (userRegisterRespDto.isSuccess()) { if (userRegisterRespDto.isSuccess()) {
goblinRedisUtils.setNftNumAccount(uid); GoblinUserNftAccInfoVo nftAccInfoVo = GoblinUserNftAccInfoVo.getNew();
nftAccInfoVo.setCode(NftAccStatusEnum.StatusAcc.ING.getCode());
nftAccInfoVo.setMsg(NftAccStatusEnum.StatusAcc.ING.getMsg());
nftAccInfoVo.setTime(LocalDateTime.now());
goblinRedisUtils.setOpenAccountInfo(uid, nftAccInfoVo);
GalaxyUserRegisterRespDto userRegisterRespDtoData = userRegisterRespDto.getData(); GalaxyUserRegisterRespDto userRegisterRespDtoData = userRegisterRespDto.getData();
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_STORE.getKey(),
SqlMapping.get("adam_user_busi_acct.add", uid, AdamEnum.BizAcct.NFT_ZX.name(), userRegisterRespDtoData.getBlockChainAddress(), null, null, 1, LocalDateTime.now()) SqlMapping.get("adam_user_busi_acct.add", uid, AdamEnum.BizAcct.NFT_ZX.name(), userRegisterRespDtoData.getBlockChainAddress(), null, null, 1, LocalDateTime.now())
); );
return ResponseDto.success(1); return ResponseDto.success(nftAccInfoVo);
} }
break; break;
default: default:
......
...@@ -1756,7 +1756,7 @@ public class GoblinRedisUtils { ...@@ -1756,7 +1756,7 @@ public class GoblinRedisUtils {
} }
} }
public GoblinUserNftAccInfoVo openAccountInfo(String userId) { public GoblinUserNftAccInfoVo getOpenAccountInfo(String userId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO.concat(userId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO.concat(userId);
Object obj = redisUtil.get(redisKey); Object obj = redisUtil.get(redisKey);
if (obj == null) { if (obj == null) {
...@@ -1765,13 +1765,9 @@ public class GoblinRedisUtils { ...@@ -1765,13 +1765,9 @@ public class GoblinRedisUtils {
return (GoblinUserNftAccInfoVo) obj; return (GoblinUserNftAccInfoVo) obj;
} }
} }
public void setOpenAccountInfo(String userId) { public void setOpenAccountInfo(String userId, GoblinUserNftAccInfoVo nftAccInfoVo) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO.concat(userId); String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_NUM_ACCOUNT_INFO.concat(userId);
GoblinUserNftAccInfoVo nftAccInfoVo = GoblinUserNftAccInfoVo.getNew(); redisUtil.set(redisKey, nftAccInfoVo);
nftAccInfoVo.setCode(NftAccStatusEnum.StatusAcc.ING.getCode());
nftAccInfoVo.setMsg(NftAccStatusEnum.StatusAcc.ING.getMsg());
nftAccInfoVo.setTime(LocalDateTime.now());
Object obj = redisUtil.set(redisKey, nftAccInfoVo);
} }
public int getIsExchange(String skuId) { public int getIsExchange(String skuId) {
......
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