1.优化部分接口的返回值
2.添加全局密码解密方法
Showing
10 changed files
with
60 additions
and
30 deletions
| ... | @@ -49,11 +49,13 @@ public interface RedisKeyConstants { | ... | @@ -49,11 +49,13 @@ public interface RedisKeyConstants { |
| 49 | // 历史完成的任务数量 | 49 | // 历史完成的任务数量 |
| 50 | String cacheTotalFinishTaskCount = "uce::totalCount::memberId"; | 50 | String cacheTotalFinishTaskCount = "uce::totalCount::memberId"; |
| 51 | 51 | ||
| 52 | 52 | // app账号信息 | |
| 53 | String cacheAppById = "uce:appInfo:id"; | ||
| 53 | 54 | ||
| 54 | String CACHE_PLATFROMACCOUNT_PLAYDURATION = "uce::eventPlay::playduration"; | 55 | String CACHE_PLATFROMACCOUNT_PLAYDURATION = "uce::eventPlay::playduration"; |
| 55 | 56 | ||
| 56 | 57 | ||
| 57 | String CACHE_TODAY_FINISH_COUNT = "todayFinishCount"; | 58 | String CACHE_TODAY_FINISH_COUNT = "todayFinishCount"; |
| 58 | String CACHE_TOTAL_FINISH_COUNT = "totalFinishCount"; | 59 | String CACHE_TOTAL_FINISH_COUNT = "totalFinishCount"; |
| 60 | |||
| 59 | } | 61 | } | ... | ... |
| ... | @@ -194,7 +194,7 @@ public class UserAppController { | ... | @@ -194,7 +194,7 @@ public class UserAppController { |
| 194 | resources.setUserAppId(id); | 194 | resources.setUserAppId(id); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | return ResultInfo.success(this.userAppBindService.create(resources)); | 197 | return this.userAppBindService.create(resources); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | @PostMapping(value = "/updateValidStatusAndUserAppIdAndNickname") | 200 | @PostMapping(value = "/updateValidStatusAndUserAppIdAndNickname") | ... | ... |
| 1 | package com.topdraw.business.module.user.app.service; | 1 | package com.topdraw.business.module.user.app.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.modules.common.ResultInfo; | ||
| 3 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 4 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
| 4 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 5 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
| 5 | 6 | ||
| ... | @@ -22,7 +23,7 @@ public interface UserAppBindService { | ... | @@ -22,7 +23,7 @@ public interface UserAppBindService { |
| 22 | * | 23 | * |
| 23 | * @param resources | 24 | * @param resources |
| 24 | */ | 25 | */ |
| 25 | UserAppBindDTO create(UserAppBind resources); | 26 | ResultInfo create(UserAppBind resources); |
| 26 | 27 | ||
| 27 | /** | 28 | /** |
| 28 | * | 29 | * | ... | ... |
| 1 | package com.topdraw.business.module.user.app.service.impl; | 1 | package com.topdraw.business.module.user.app.service.impl; |
| 2 | 2 | ||
| 3 | import com.topdraw.base.modules.common.ResultInfo; | ||
| 3 | import com.topdraw.base.modules.utils.ValidationUtil; | 4 | import com.topdraw.base.modules.utils.ValidationUtil; |
| 4 | import com.topdraw.business.module.user.app.domain.UserAppBind; | 5 | import com.topdraw.business.module.user.app.domain.UserAppBind; |
| 5 | import com.topdraw.business.module.user.app.repository.UserAppBindRepository; | 6 | import com.topdraw.business.module.user.app.repository.UserAppBindRepository; |
| 6 | import com.topdraw.business.module.user.app.service.UserAppBindService; | 7 | import com.topdraw.business.module.user.app.service.UserAppBindService; |
| 7 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 8 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
| 8 | import com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper; | 9 | import com.topdraw.business.module.user.app.service.mapper.UserAppBindMapper; |
| 10 | import lombok.extern.slf4j.Slf4j; | ||
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 11 | import org.springframework.transaction.annotation.Propagation; | 13 | import org.springframework.transaction.annotation.Propagation; |
| ... | @@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException; | ... | @@ -14,6 +16,7 @@ import org.springframework.dao.EmptyResultDataAccessException; |
| 14 | import org.springframework.util.Assert; | 16 | import org.springframework.util.Assert; |
| 15 | 17 | ||
| 16 | import java.util.List; | 18 | import java.util.List; |
| 19 | import java.util.Objects; | ||
| 17 | 20 | ||
| 18 | /** | 21 | /** |
| 19 | * @author XiangHan | 22 | * @author XiangHan |
| ... | @@ -21,6 +24,7 @@ import java.util.List; | ... | @@ -21,6 +24,7 @@ import java.util.List; |
| 21 | */ | 24 | */ |
| 22 | @Service | 25 | @Service |
| 23 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) | 26 | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) |
| 27 | @Slf4j | ||
| 24 | public class UserAppBindServiceImpl implements UserAppBindService { | 28 | public class UserAppBindServiceImpl implements UserAppBindService { |
| 25 | 29 | ||
| 26 | @Autowired | 30 | @Autowired |
| ... | @@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService { | ... | @@ -38,9 +42,15 @@ public class UserAppBindServiceImpl implements UserAppBindService { |
| 38 | 42 | ||
| 39 | @Override | 43 | @Override |
| 40 | @Transactional(rollbackFor = Exception.class) | 44 | @Transactional(rollbackFor = Exception.class) |
| 41 | public UserAppBindDTO create(UserAppBind resources) { | 45 | public ResultInfo create(UserAppBind resources) { |
| 46 | UserAppBindDTO userAppBindDTO = | ||
| 47 | this.findFirstByAccountAndAccountType(resources.getAccount(), resources.getAccountType()); | ||
| 48 | if (Objects.nonNull(userAppBindDTO.getId())) { | ||
| 49 | log.warn("保存第三方账号失败, saveThirdAccount# messgage ==>> 第三方账号已存在 | appBind ==>> {}", resources); | ||
| 50 | return ResultInfo.failure("保存第三方账号失败, 第三方账号已存在"); | ||
| 51 | } | ||
| 42 | UserAppBind userAppBind = this.userAppBindRepository.save(resources); | 52 | UserAppBind userAppBind = this.userAppBindRepository.save(resources); |
| 43 | return this.userAppBindMapper.toDto(userAppBind); | 53 | return ResultInfo.success(this.userAppBindMapper.toDto(userAppBind)); |
| 44 | } | 54 | } |
| 45 | 55 | ||
| 46 | @Override | 56 | @Override | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -31,14 +31,14 @@ public interface UserOperationService { | ... | @@ -31,14 +31,14 @@ public interface UserOperationService { |
| 31 | * @param resources | 31 | * @param resources |
| 32 | * @return | 32 | * @return |
| 33 | */ | 33 | */ |
| 34 | UserWeixinDTO createWeixinUserAndMember(UserWeixin resources); | 34 | ResultInfo createWeixinUserAndMember(UserWeixin resources); |
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | * 保存小屏账户并创建会员 | 37 | * 保存小屏账户并创建会员 |
| 38 | * @param resources | 38 | * @param resources |
| 39 | * @return | 39 | * @return |
| 40 | */ | 40 | */ |
| 41 | UserWeixinDTO createWeixinUserAndMember(UserWeixin resources, Integer vip); | 41 | ResultInfo createWeixinUserAndMember(UserWeixin resources, Integer vip); |
| 42 | 42 | ||
| 43 | /** | 43 | /** |
| 44 | * 服务号(H5)登录 | 44 | * 服务号(H5)登录 |
| ... | @@ -205,18 +205,15 @@ public interface UserOperationService { | ... | @@ -205,18 +205,15 @@ public interface UserOperationService { |
| 205 | 205 | ||
| 206 | /** | 206 | /** |
| 207 | * | 207 | * |
| 208 | * @param resources | 208 | * @param growthReport |
| 209 | * @return | 209 | * @return |
| 210 | */ | 210 | */ |
| 211 | boolean updatePasswordById(UserApp resources); | 211 | ResultInfo saveGrowthReport(GrowthReport growthReport); |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | * | 214 | * |
| 215 | * @param growthReport | 215 | * @param userApp |
| 216 | * @return | 216 | * @return |
| 217 | */ | 217 | */ |
| 218 | ResultInfo saveGrowthReport(GrowthReport growthReport); | ||
| 219 | |||
| 220 | |||
| 221 | boolean appCancellation(UserApp userApp); | 218 | boolean appCancellation(UserApp userApp); |
| 222 | } | 219 | } | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -42,23 +42,11 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -42,23 +42,11 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 42 | @Autowired | 42 | @Autowired |
| 43 | private MemberProfileService memberProfileService; | 43 | private MemberProfileService memberProfileService; |
| 44 | @Autowired | 44 | @Autowired |
| 45 | private MemberVipHistoryService memberVipHistoryService; | ||
| 46 | @Autowired | ||
| 47 | private MemberAddressService memberAddressService; | 45 | private MemberAddressService memberAddressService; |
| 48 | 46 | @Autowired | |
| 49 | @AsyncMqSend | 47 | private MemberVipHistoryService memberVipHistoryService; |
| 50 | public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {} | ||
| 51 | @AsyncMqSend | ||
| 52 | public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {} | ||
| 53 | @AsyncMqSend | ||
| 54 | public void asyncDoUpdateGroupsBatch(List<Member> resources) {} | ||
| 55 | 48 | ||
| 56 | 49 | ||
| 57 | @AsyncMqSend | ||
| 58 | @Override | ||
| 59 | public MemberDTO update(Member resources) { | ||
| 60 | return this.memberService.update(resources); | ||
| 61 | } | ||
| 62 | 50 | ||
| 63 | @Override | 51 | @Override |
| 64 | public MemberDTO findByCode(String code) { | 52 | public MemberDTO findByCode(String code) { |
| ... | @@ -285,4 +273,18 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -285,4 +273,18 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 285 | private MemberProfileDTO findMemberProfileByMemberId(Long memberId) { | 273 | private MemberProfileDTO findMemberProfileByMemberId(Long memberId) { |
| 286 | return this.memberProfileService.findByMemberId(memberId); | 274 | return this.memberProfileService.findByMemberId(memberId); |
| 287 | } | 275 | } |
| 276 | |||
| 277 | |||
| 278 | |||
| 279 | @AsyncMqSend | ||
| 280 | public void asyncUpdateMemberVipAndVipExpireTime(MemberDTO memberDTO) {} | ||
| 281 | @AsyncMqSend | ||
| 282 | public void asyncCreateMemberVipHistory(MemberVipHistoryDTO memberVipHistoryDTO) {} | ||
| 283 | @AsyncMqSend | ||
| 284 | public void asyncDoUpdateGroupsBatch(List<Member> resources) {} | ||
| 285 | @AsyncMqSend | ||
| 286 | @Override | ||
| 287 | public MemberDTO update(Member resources) { | ||
| 288 | return this.memberService.update(resources); | ||
| 289 | } | ||
| 288 | } | 290 | } | ... | ... |
| ... | @@ -4,9 +4,7 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; | ... | @@ -4,9 +4,7 @@ import com.topdraw.business.module.member.address.service.dto.MemberAddressDTO; |
| 4 | import com.topdraw.business.module.member.domain.Member; | 4 | import com.topdraw.business.module.member.domain.Member; |
| 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; | 5 | import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; |
| 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 6 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 7 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | ||
| 8 | import com.topdraw.business.process.domian.member.MemberOperationBean; | 7 | import com.topdraw.business.process.domian.member.MemberOperationBean; |
| 9 | import com.topdraw.business.process.domian.weixin.BuyVipBean; | ||
| 10 | 8 | ||
| 11 | import java.util.List; | 9 | import java.util.List; |
| 12 | 10 | ||
| ... | @@ -76,8 +74,17 @@ public interface MemberOperationService { | ... | @@ -76,8 +74,17 @@ public interface MemberOperationService { |
| 76 | */ | 74 | */ |
| 77 | MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources); | 75 | MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources); |
| 78 | 76 | ||
| 79 | 77 | /** | |
| 78 | * | ||
| 79 | * @param resources | ||
| 80 | * @return | ||
| 81 | */ | ||
| 80 | Integer doUpdateGroupsBatch(List<Member> resources); | 82 | Integer doUpdateGroupsBatch(List<Member> resources); |
| 81 | 83 | ||
| 84 | /** | ||
| 85 | * | ||
| 86 | * @param memberId | ||
| 87 | * @return | ||
| 88 | */ | ||
| 82 | MemberAddressDTO updateDefaultMemberAddressById(Long memberId); | 89 | MemberAddressDTO updateDefaultMemberAddressById(Long memberId); |
| 83 | } | 90 | } | ... | ... |
| 1 | package com.topdraw.util; | 1 | package com.topdraw.util; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.topdraw.base.modules.utils.MD5Util; | ||
| 4 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
| 5 | import org.bouncycastle.jce.provider.BouncyCastleProvider; | 6 | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| 6 | 7 | ||
| ... | @@ -17,6 +18,16 @@ import java.util.Arrays; | ... | @@ -17,6 +18,16 @@ import java.util.Arrays; |
| 17 | @Slf4j | 18 | @Slf4j |
| 18 | public class AESUtil { | 19 | public class AESUtil { |
| 19 | 20 | ||
| 21 | public static String decodePassword(String password) { | ||
| 22 | String decrypt = AESUtil.decrypt(password, "f8681b9ce7c8fb6b"); | ||
| 23 | |||
| 24 | String substring = decrypt.substring(16); | ||
| 25 | |||
| 26 | String s = MD5Util.encodePassword(substring); | ||
| 27 | log.info("加密前的密码:==>> {} || 解密后的密码:==>> {} | md5之后的密码: ==>> {}", decrypt, substring, s); | ||
| 28 | return s; | ||
| 29 | } | ||
| 30 | |||
| 20 | public static String encrypt(String data, String key) { | 31 | public static String encrypt(String data, String key) { |
| 21 | String strResult = null; | 32 | String strResult = null; |
| 22 | try { | 33 | try { | ... | ... |
-
Please register or sign in to post a comment