Commit a5d2e0d5 a5d2e0d5d69e91b1d927c3b9734baee35c71d596 by xianghan

1.优化部分接口的返回值

2.添加全局密码解密方法
1 parent f5ab3240
......@@ -49,11 +49,13 @@ public interface RedisKeyConstants {
// 历史完成的任务数量
String cacheTotalFinishTaskCount = "uce::totalCount::memberId";
// app账号信息
String cacheAppById = "uce:appInfo:id";
String CACHE_PLATFROMACCOUNT_PLAYDURATION = "uce::eventPlay::playduration";
String CACHE_TODAY_FINISH_COUNT = "todayFinishCount";
String CACHE_TOTAL_FINISH_COUNT = "totalFinishCount";
}
......
......@@ -194,7 +194,7 @@ public class UserAppController {
resources.setUserAppId(id);
}
return ResultInfo.success(this.userAppBindService.create(resources));
return this.userAppBindService.create(resources);
}
@PostMapping(value = "/updateValidStatusAndUserAppIdAndNickname")
......
package com.topdraw.business.module.user.app.service;
import com.topdraw.base.modules.common.ResultInfo;
import com.topdraw.business.module.user.app.domain.UserAppBind;
import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO;
......@@ -22,7 +23,7 @@ public interface UserAppBindService {
*
* @param resources
*/
UserAppBindDTO create(UserAppBind resources);
ResultInfo create(UserAppBind resources);
/**
*
......
package com.topdraw.business.module.user.app.service.impl;
import com.topdraw.base.modules.common.ResultInfo;
import com.topdraw.base.modules.utils.ValidationUtil;
import com.topdraw.business.module.user.app.domain.UserAppBind;
import com.topdraw.business.module.user.app.repository.UserAppBindRepository;
import com.topdraw.business.module.user.app.service.UserAppBindService;
import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO;
import com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
......@@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.util.Assert;
import java.util.List;
import java.util.Objects;
/**
* @author XiangHan
......@@ -21,6 +24,7 @@ import java.util.List;
*/
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
@Slf4j
public class UserAppBindServiceImpl implements UserAppBindService {
@Autowired
......@@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService {
@Override
@Transactional(rollbackFor = Exception.class)
public UserAppBindDTO create(UserAppBind resources) {
public ResultInfo create(UserAppBind resources) {
UserAppBindDTO userAppBindDTO =
this.findFirstByAccountAndAccountType(resources.getAccount(), resources.getAccountType());
if (Objects.nonNull(userAppBindDTO.getId())) {
log.warn("保存第三方账号失败, saveThirdAccount# messgage ==>> 第三方账号已存在 | appBind ==>> {}", resources);
return ResultInfo.failure("保存第三方账号失败, 第三方账号已存在");
}
UserAppBind userAppBind = this.userAppBindRepository.save(resources);
return this.userAppBindMapper.toDto(userAppBind);
return ResultInfo.success(this.userAppBindMapper.toDto(userAppBind));
}
@Override
......
......@@ -31,14 +31,14 @@ public interface UserOperationService {
* @param resources
* @return
*/
UserWeixinDTO createWeixinUserAndMember(UserWeixin resources);
ResultInfo createWeixinUserAndMember(UserWeixin resources);
/**
* 保存小屏账户并创建会员
* @param resources
* @return
*/
UserWeixinDTO createWeixinUserAndMember(UserWeixin resources, Integer vip);
ResultInfo createWeixinUserAndMember(UserWeixin resources, Integer vip);
/**
* 服务号(H5)登录
......@@ -205,18 +205,15 @@ public interface UserOperationService {
/**
*
* @param resources
* @param growthReport
* @return
*/
boolean updatePasswordById(UserApp resources);
ResultInfo saveGrowthReport(GrowthReport growthReport);
/**
*
* @param growthReport
* @param userApp
* @return
*/
ResultInfo saveGrowthReport(GrowthReport growthReport);
boolean appCancellation(UserApp userApp);
}
......
......@@ -42,23 +42,11 @@ public class MemberOperationServiceImpl implements MemberOperationService {
@Autowired
private MemberProfileService memberProfileService;
@Autowired
private MemberVipHistoryService memberVipHistoryService;
@Autowired
private MemberAddressService memberAddressService;
@AsyncMqSend
public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {}
@AsyncMqSend
public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {}
@AsyncMqSend
public void asyncDoUpdateGroupsBatch(List<Member> resources) {}
@Autowired
private MemberVipHistoryService memberVipHistoryService;
@AsyncMqSend
@Override
public MemberDTO update(Member resources) {
return this.memberService.update(resources);
}
@Override
public MemberDTO findByCode(String code) {
......@@ -285,4 +273,18 @@ public class MemberOperationServiceImpl implements MemberOperationService {
private MemberProfileDTO findMemberProfileByMemberId(Long memberId) {
return this.memberProfileService.findByMemberId(memberId);
}
@AsyncMqSend
public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {}
@AsyncMqSend
public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {}
@AsyncMqSend
public void asyncDoUpdateGroupsBatch(List<Member> resources) {}
@AsyncMqSend
@Override
public MemberDTO update(Member resources) {
return this.memberService.update(resources);
}
}
......
......@@ -4,9 +4,7 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO;
import com.topdraw.business.module.member.domain.Member;
import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO;
import com.topdraw.business.module.member.service.dto.MemberDTO;
import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory;
import com.topdraw.business.process.domian.member.MemberOperationBean;
import com.topdraw.business.process.domian.weixin.BuyVipBean;
import java.util.List;
......@@ -76,8 +74,17 @@ public interface MemberOperationService {
*/
MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources);
/**
*
* @param resources
* @return
*/
Integer doUpdateGroupsBatch(List<Member> resources);
/**
*
* @param memberId
* @return
*/
MemberAddressDTO updateDefaultMemberAddressById(Long memberId);
}
......
package com.topdraw.util;
import com.alibaba.fastjson.JSONObject;
import com.topdraw.base.modules.utils.MD5Util;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
......@@ -17,6 +18,16 @@ import java.util.Arrays;
@Slf4j
public class AESUtil {
public static String decodePassword(String password) {
String decrypt = AESUtil.decrypt(password, "f8681b9ce7c8fb6b");
String substring = decrypt.substring(16);
String s = MD5Util.encodePassword(substring);
log.info("加密前的密码:==>> {} || 解密后的密码:==>> {} | md5之后的密码: ==>> {}", decrypt, substring, s);
return s;
}
public static String encrypt(String data, String key) {
String strResult = null;
try {
......