diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/app/AppBottomBarAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/app/AppBottomBarAdminService.java index 9beee172a..20dc63757 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/app/AppBottomBarAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/app/AppBottomBarAdminService.java @@ -121,7 +121,7 @@ public class AppBottomBarAdminService extends BaseService { public void saveResource(AppBottomBarParam param) throws ServerException { String lockKey = RedisKey.app_bottom_bar_lock.getKey(); String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); String timeSectionConflict = "与[%s]存在时段冲突,请调整后再保存"; try { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/channel/ChannelContentPartitionAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/channel/ChannelContentPartitionAdminService.java index 204b79c22..c592cd635 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/channel/ChannelContentPartitionAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/channel/ChannelContentPartitionAdminService.java @@ -7,11 +7,11 @@ import com.accompany.admin.dto.channel.ChannelContentPartitionDto; import com.accompany.admin.dto.channel.ChannelQueryDto; import com.accompany.admin.vo.channel.ChannelContentVo; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.BusinessException; import com.accompany.common.redis.RedisKey; import com.accompany.common.utils.DateTimeUtil; import com.accompany.common.utils.StringUtils; import com.accompany.core.enumeration.ChannelUserTypeEnum; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Users; import com.accompany.core.model.channel.ChannelContentPartition; import com.accompany.core.model.channel.ChannelContentPartitionExample; @@ -105,30 +105,30 @@ public class ChannelContentPartitionAdminService extends BaseService { sampleList = sampleList.stream().filter(channel -> !channel.getId().equals(channelContentPartitionDto.getId())).collect(Collectors.toList()); } - if (!CollectionUtils.isEmpty(sampleList)) throw new BusinessException("渠道+用户类型的组合不能重复存在!"); + if (!CollectionUtils.isEmpty(sampleList)) throw new AdminServiceException("渠道+用户类型的组合不能重复存在!"); } //检查房主大鹅号 String roomErbanNo = channelContentPartitionDto.getRoomErbanNo(); - if (StringUtils.isBlank(roomErbanNo)) throw new BusinessException("房主平台号不能为空"); + if (StringUtils.isBlank(roomErbanNo)) throw new AdminServiceException("房主平台号不能为空"); List roomErbanList =Arrays.stream(roomErbanNo.split(StrUtil.COMMA)).collect(Collectors.toList()); List roomUidList = usersBaseService.getUidByErbanNo(roomErbanList); String errRoomErban = checkErban(roomErbanList, roomUidList); if (!StringUtils.isEmpty(errRoomErban)) { - throw new BusinessException("以下房主平台号:" + errRoomErban + "不正确!"); + throw new AdminServiceException("以下房主平台号:" + errRoomErban + "不正确!"); } //检查用户平台号 if (Constant.ChannelUserType.point_user.equals(channelContentPartitionDto.getUserType())) { String userErbanNo = channelContentPartitionDto.getUserErbanNo(); - if (StringUtils.isBlank(userErbanNo)) throw new BusinessException("用户平台号不能为空"); + if (StringUtils.isBlank(userErbanNo)) throw new AdminServiceException("用户平台号不能为空"); //校验输入的用户平台号 List erbanList = Arrays.stream(userErbanNo.split(StrUtil.COMMA)).collect(Collectors.toList()); List uidStrList = usersBaseService.getUidByErbanNo(erbanList); String errUserErban = checkErban(erbanList, uidStrList); if (!StringUtils.isEmpty(errUserErban)) { - throw new BusinessException("以下用户平台号:" + errUserErban + "不正确!"); + throw new AdminServiceException("以下用户平台号:" + errUserErban + "不正确!"); } } @@ -200,7 +200,7 @@ public class ChannelContentPartitionAdminService extends BaseService { if (isCross) { String clashMsg = "当前组合类型存在时段冲突:冲突序号:%s,冲突时段:[%s-%s]"; logger.info(String.format(clashMsg, channelContent.getId(), DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getEndTime()))); - throw new BusinessException(String.format(clashMsg, channelContent.getId(), DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getEndTime()))); + throw new AdminServiceException(String.format(clashMsg, channelContent.getId(), DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getEndTime()))); } } } @@ -219,7 +219,7 @@ public class ChannelContentPartitionAdminService extends BaseService { if (isCross) { String clashMsg = "当前组合类型存在时段冲突:冲突序号:%s,冲突平台号:%s,时段:[%s-%s]"; logger.info(String.format(clashMsg, channelContent.getId(), erban, DateTimeUtil.convertDate(channelContent.getStartTime())), DateTimeUtil.convertDate(channelContent.getStartTime())); - throw new BusinessException(String.format(clashMsg, channelContent.getId(), erban, DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getStartTime()))); + throw new AdminServiceException(String.format(clashMsg, channelContent.getId(), erban, DateTimeUtil.convertDate(channelContent.getStartTime()), DateTimeUtil.convertDate(channelContent.getStartTime()))); } } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java index 01e11fee5..bd6eb8344 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java @@ -130,7 +130,7 @@ public class ClanAdminServiceImpl implements ClanAdminService { String lockVal = jedisLockService.lock(lockKey); if (com.accompany.common.utils.StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { @@ -181,7 +181,7 @@ public class ClanAdminServiceImpl implements ClanAdminService { String lockVal = jedisLockService.lock(lockKey); if (com.accompany.common.utils.StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/ChatBubbleAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/ChatBubbleAdminService.java index f44459663..9bf9c5cf4 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/ChatBubbleAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/ChatBubbleAdminService.java @@ -85,7 +85,7 @@ public class ChatBubbleAdminService { if (chatBubble.getId() != null) { ChatBubble chatBubbleById = chatBubbleService.getChatBubbleById(chatBubble.getId()); if (chatBubbleById == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "气泡不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "气泡不存在"); } if (chatBubbleById.getType().equals(Constant.InfoCardType.VIP) && chatBubble.getType().equals(Constant.InfoCardType.NORMAL)) { // 贵族装扮切回普通。需要先解除当前装扮与贵族之间的 @@ -111,11 +111,11 @@ public class ChatBubbleAdminService { } ChatBubble chatBubbleById = chatBubbleService.getChatBubbleById(bubbleId); if (null == chatBubbleById) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "装扮不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "装扮不存在"); } List erbanStrs = Arrays.asList(erbanNos.split(",")); if (erbanStrs.size() > ONE_TIME_SEND_BUBBLE_MAX_NUM) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "单次赠送不得超过" + ONE_TIME_SEND_BUBBLE_MAX_NUM + "人!"); + throw new ServiceException(BusiStatus.SERVERBUSY, "单次赠送不得超过" + ONE_TIME_SEND_BUBBLE_MAX_NUM + "人!"); } List failErbanNos = new ArrayList<>(); Date expireTime; diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/InfoCardAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/InfoCardAdminService.java index dba7717fc..f9d38e0f3 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/InfoCardAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/dress/InfoCardAdminService.java @@ -87,7 +87,7 @@ public class InfoCardAdminService { if (infoCard.getId() != null) { InfoCard infoCardInDB = infoCardService.getInfoCardById(infoCard.getId()); if (infoCardInDB == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "资料卡不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "资料卡不存在"); } if (infoCardInDB.getType().equals(Constant.InfoCardType.VIP) && infoCard.getType().equals(Constant.InfoCardType.NORMAL)) { // 贵族装扮切回普通。需要先解除当前装扮与贵族之间的 @@ -109,11 +109,11 @@ public class InfoCardAdminService { } InfoCard infoCardById = infoCardService.getInfoCardById(cardId); if (null == infoCardById) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "装扮不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "装扮不存在"); } List erbanStrs = Arrays.asList(erbanNos.split(",")); if (erbanStrs.size() > ONE_TIME_SEND_CARD_MAX_NUM) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "单次赠送不得超过" + ONE_TIME_SEND_CARD_MAX_NUM + "人!"); + throw new ServiceException(BusiStatus.SERVERBUSY, "单次赠送不得超过" + ONE_TIME_SEND_CARD_MAX_NUM + "人!"); } List failErbanNos = new ArrayList<>(); Date expireTime; diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamGroupAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamGroupAdminService.java index ded7fd543..c194b7101 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamGroupAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamGroupAdminService.java @@ -108,7 +108,7 @@ public class FlowTeamGroupAdminService { } else { FlowTeamGroup group = flowTeamGroupService.getById(groupId); if (null == group) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "团队不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "团队不存在"); } group.setGroupName(groupName); flowTeamGroupService.updateById(group); @@ -122,7 +122,7 @@ public class FlowTeamGroupAdminService { } FlowTeamGroup group = flowTeamGroupService.getById(groupId); if (null == group) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "团队不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "团队不存在"); } group.setStatus(status); flowTeamGroupService.updateById(group); @@ -165,7 +165,7 @@ public class FlowTeamGroupAdminService { checkTeamName(teamName, teamId); FlowTeamInfo team = flowTeamInfoService.getById(teamId); if (null == team) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组不存在"); } team.setTeamName(teamName); flowTeamInfoService.updateById(team); @@ -179,11 +179,11 @@ public class FlowTeamGroupAdminService { } FlowTeamInfo team = flowTeamInfoService.getById(teamId); if (null == team) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组不存在"); } // 判断当前组内是否含有团长,有团长的话不可以删除 if (teamContainsGroupLeader(teamId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "当前小组内有团长身份成员,无法删除小组。请将团长转移至其他小组后再删除该小组。"); + throw new ServiceException(BusiStatus.SERVERBUSY, "当前小组内有团长身份成员,无法删除小组。请将团长转移至其他小组后再删除该小组。"); } // 删除小组信息 team.setStatus(FlowTeamConstant.MemberStatus.MEMBER_STATUS_DELETED); @@ -255,7 +255,7 @@ public class FlowTeamGroupAdminService { Integer teamNum = countGroupValidTeam(groupId); String maxCount = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.FLOW_TEAM_MAX_TEAM_COUNT, MAX_TEAM_COUNT.toString()); if (teamNum >= Integer.parseInt(maxCount)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "超过团队小组上限"); + throw new ServiceException(BusiStatus.SERVERBUSY, "超过团队小组上限"); } checkTeamName(teamName, null); } @@ -265,10 +265,10 @@ public class FlowTeamGroupAdminService { queryWrapper.lambda().eq(FlowTeamInfo::getTeamName, teamName).eq(FlowTeamInfo::getStatus, FlowTeamConstant.MemberStatus.MEMBER_STATUS_VALID); FlowTeamInfo flowTeamInfo = flowTeamInfoService.getOne(queryWrapper); if (null != teamId && flowTeamInfo != null && !flowTeamInfo.getTeamId().equals(teamId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组名称已存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组名称已存在"); } if (null == teamId && null != flowTeamInfo) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组名称已存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组名称已存在"); } } @@ -407,7 +407,7 @@ public class FlowTeamGroupAdminService { Byte type = params.getOptType(); FlowTeamMemberInviteUser inviteRecord = flowTeamMemberInviteUserService.getByUid(uid); if (null == inviteRecord) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "该用户没有引流团队的邀请关系"); + throw new ServiceException(BusiStatus.SERVERBUSY, "该用户没有引流团队的邀请关系"); } if (FlowTeamConstant.FlowTeamInviteUserOptType.DEL.equals(type)) { // 解绑 @@ -443,24 +443,24 @@ public class FlowTeamGroupAdminService { } FlowTeamInfo team = flowTeamInfoService.getByTeamId(teamId); if (team == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组不存在"); } if (!team.getGroupId().equals(groupId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组与团队不对应"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组与团队不对应"); } FlowTeamMember member = flowTeamMemberService.getById(memberId); if (member == null || FlowTeamConstant.MemberStatus.MEMBER_STATUS_DELETED.equals(member.getMemberStatus())) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "成员不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "成员不存在"); } if (!member.getTeamId().equals(teamId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "小组与成员不对应"); + throw new ServiceException(BusiStatus.SERVERBUSY, "小组与成员不对应"); } FlowTeamMemberInviteCode memberInviteCode = flowTeamMemberInviteCodeService.getByInviteCode(inviteCode); if (memberInviteCode == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "邀请码不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "邀请码不存在"); } if (!memberInviteCode.getMemberId().equals(memberId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "邀请码与成员不对应"); + throw new ServiceException(BusiStatus.SERVERBUSY, "邀请码与成员不对应"); } } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamService.java index 91f398856..df27b8d70 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/flowteam/FlowTeamService.java @@ -278,7 +278,7 @@ public class FlowTeamService { private void validInviteCods(List inviteCodes, Long memberId, String teamId) { // 成员邀请码最大上限 if (inviteCodes.size() > TEAM_MAX_INVITECODE_COUNT_ONE_PERSON) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "成员邀请码超过上限"); + throw new ServiceException(BusiStatus.SERVERBUSY, "成员邀请码超过上限"); } List invalidCods = new ArrayList<>(inviteCodes.stream().map(String::toUpperCase).collect(Collectors.toList())); // 从表中获取邀请码信息 diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeResourceAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeResourceAdminService.java index 96d37683c..ba1f3b98d 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeResourceAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/home/HomeResourceAdminService.java @@ -122,7 +122,7 @@ public class HomeResourceAdminService extends BaseService { public void saveResource(HomeRecommenResourceParam param) throws ServiceException { String lockKey = RedisKey.home_resource_lock.getKey(); String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); String timeSectionConflict = "与[%s]存在时段冲突,请调整后再保存"; Date now = new Date(); try { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java index 395dbe68e..155a89559 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java @@ -30,7 +30,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.accompany.common.constant.Constant; import com.accompany.common.constant.OpenBoxKeyTypeEnum; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -150,7 +150,7 @@ public class UserCardsAdminService extends BaseService { Users users = usersMap.get(uidKey); if (users == null){ logger.error("user not found. uid:{}", uidKey); - throw new ApiException(BusiStatus.USERNOTEXISTS); + throw new AdminServiceException(BusiStatus.USERNOTEXISTS); } UserCardsListAdminVo listVo = new UserCardsListAdminVo(); listVo.setUid(uidKey); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGiveKeyService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGiveKeyService.java index 1b686f8d8..af5d167b5 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGiveKeyService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGiveKeyService.java @@ -53,7 +53,7 @@ public class OfficialGiveKeyService extends BaseService { try { lockval = this.jedisLockService.lock(RedisKey.official_give_key.getKey(), 3000); if (StringUtils.isEmpty(lockval)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); String[] arr = ernos.split("\n"); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java index 73f33e576..1310781d7 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/record/OfficialGoldRecordService.java @@ -155,7 +155,7 @@ public class OfficialGoldRecordService extends BaseService { try { lockval = this.jedisLockService.lock(RedisKey.lock_official_radish_send.getKey(), 3000); if (StringUtils.isEmpty(lockval)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); @@ -205,7 +205,7 @@ public class OfficialGoldRecordService extends BaseService { try { lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000); if (StringUtils.isEmpty(lockval)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); @@ -286,7 +286,7 @@ public class OfficialGoldRecordService extends BaseService { try { lockval = this.jedisLockService.lock(RedisKey.lock_official_gold_send.getKey(), 3000); if (StringUtils.isEmpty(lockval)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } BusiResult busiResult = new BusiResult<>(BusiStatus.SUCCESS); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java index 0193d7e84..f3feb2e3c 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java @@ -356,7 +356,7 @@ public class RoomSearchAdminService extends BaseService { public int resetRoomV2(Long uid, byte permitType) throws Exception { String lockKey = RedisKey.reset_room_type_lock.getKey(String.valueOf(uid)); String lockVal = jedisLockService.lock(lockKey); - if (com.accompany.common.utils.StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (com.accompany.common.utils.StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); try { Room room = roomService.getRoomByDB(uid); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/statistic/StatsUserDetailAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/statistic/StatsUserDetailAdminService.java index 3975863fa..25d58e918 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/statistic/StatsUserDetailAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/statistic/StatsUserDetailAdminService.java @@ -386,7 +386,7 @@ public class StatsUserDetailAdminService extends BaseService { if (StringUtils.isEmpty(lockVal)) { //拿不到锁暂不考虑 - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } StopWatch stw = new StopWatch(); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/PhoneAuthApplyRecordAdiminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/PhoneAuthApplyRecordAdiminService.java index 36ba4c9e0..c79169134 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/PhoneAuthApplyRecordAdiminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/PhoneAuthApplyRecordAdiminService.java @@ -121,7 +121,7 @@ public class PhoneAuthApplyRecordAdiminService extends BaseService { String lockeKey = RedisKey.phone_auth_apply_lock.getKey(applyRecord.getPhone()); String lockVal = jedisLockService.lock(lockeKey); if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { if (!Objects.equals(applyRecord.getStatus(), Constant.PhoneAuthApplyStatus.wait_audit)) { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteAdminService.java deleted file mode 100644 index ae0bfb0ab..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteAdminService.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.accompany.admin.service.user; - -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.model.AdminUser; -import com.accompany.admin.service.base.BaseService; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.core.model.Room; -import com.accompany.business.model.UserMuteAdmin; -import com.accompany.business.model.UserMuteAdminExample; -import com.accompany.core.model.Users; -import com.accompany.business.mybatismapper.UserMuteAdminMapper; -import com.accompany.business.service.ErBanNetEaseService; -import com.accompany.core.service.SysConfService; -import com.accompany.business.service.room.RoomService; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.business.service.user.UsersService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.accompany.common.constant.Constant; -import com.accompany.common.netease.neteaseacc.result.RubbishRet; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-05-08 11:56 - */ -@Service -public class UserMuteAdminService extends BaseService { - - @Autowired - private UserMuteAdminMapper userMuteAdminMapper; - @Autowired - private AdminUserService adminUserService; - @Autowired - private UsersService usersService; - @Autowired - private UsersBaseService usersBaseService; - @Autowired - private RoomService roomService; - @Autowired - private SysConfService sysConfService; - @Autowired - private ErBanNetEaseService erBanNetEaseService; - - private byte enabled = 1; - private byte disabled = 2; - - public int save(Long erbanNo, Long roomErbanNo, int adminUserId) throws Exception { - UserMuteAdmin record = new UserMuteAdmin(); - //用户信息 - Users users = usersBaseService.getUsersByErBanNo(erbanNo); - if(null == users) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); - } - record.setErbanNo(users.getErbanNo()); - record.setUid(users.getUid()); - record.setNick(users.getNick()); - //房间信息 - Long roomId = null; - Long roomUid = null; - if(null != roomErbanNo) { - Users roomUsers = usersBaseService.getUsersByErBanNo(erbanNo); - if(null == roomUsers) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); - } - Room room = roomService.getRoomCacheByUid(roomUsers.getUid()); - if(null == room) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不是房主!"); - } - roomId = room.getRoomId(); - roomUid = room.getUid(); - } - record.setRoomId(roomId); - record.setRoomUid(roomUid); - record.setRoomErbanNo(roomErbanNo); - //查看当前是否存在房主信息 - List list = queryEnableRecord(record.getUid(), record.getRoomId()); - if(null != list && !list.isEmpty()) { - throw new BusinessException("设置失败,当前已存在有效记录!"); - } - //操作人信息 - AdminUser adminUser = adminUserService.getAdminUserById(adminUserId); - record.setOperatorId(adminUser.getId()); - record.setOperator(adminUser.getUsername()); - //操作时间 - Date now = new Date(); - record.setCreateTime(now); - record.setUpdateTime(now); - //处理云信的记录 - RubbishRet ret = erBanNetEaseService.setChatRoomMemberRole(roomId, String.valueOf(roomUid), - String.valueOf(record.getUid()), Constant.RoleOpt.admin, "true", null); - if(ret.getCode() == 200 || ret.getCode() == 417) { - return userMuteAdminMapper.insertSelective(record); - } else { - logger.warn("添加禁言管理员失败,平台号:{},房间id:{},云信返回值:{}", - record.getErbanNo(), record.getRoomId(), ret.getCode()); - } - return 0; - } - - public UserMuteAdmin getById(Integer id) { - return userMuteAdminMapper.selectByPrimaryKey(id); - } - - public PageInfo queryForPages(Long erbanNo, Byte status, Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(queryList(erbanNo, status)); - } - - public List queryList(Long erbanNo, Byte status) { - UserMuteAdminExample example = new UserMuteAdminExample(); - UserMuteAdminExample.Criteria criteria = example.createCriteria(); - if(null != status) { - criteria.andStatusEqualTo(status); - } - if(null != erbanNo) { - criteria.andErbanNoEqualTo(erbanNo); - } - return userMuteAdminMapper.selectByExample(example); - } - - /** - * 查询有效的记录 - * @param uid - * @param roomId - * @return - */ - public List queryEnableRecord(long uid, long roomId) { - UserMuteAdminExample example = new UserMuteAdminExample(); - UserMuteAdminExample.Criteria criteria = example.createCriteria(); - criteria.andUidEqualTo(uid).andRoomIdEqualTo(roomId).andStatusEqualTo(enabled); - return userMuteAdminMapper.selectByExample(example); - } - - /** - * 逻辑删除 - * 先去云信处理,再进行逻辑删除 - * @param id - * @return - */ - public int deleteById(Integer id) throws Exception { - UserMuteAdmin record = getById(id); - if(null == record) { - throw new BusinessException("id为" + id + "的记录不存在!"); - } - RubbishRet ret = erBanNetEaseService.setChatRoomMemberRole(record.getRoomId(), - String.valueOf(record.getRoomUid()), String.valueOf(record.getUid()), - Constant.RoleOpt.admin, "false", null); - if(ret.getCode() == 200) { - UserMuteAdmin updateRecord = new UserMuteAdmin(); - updateRecord.setUpdateTime(new Date()); - updateRecord.setId(id); - updateRecord.setStatus(disabled); - return userMuteAdminMapper.updateByPrimaryKeySelective(updateRecord); - } else { - logger.warn("删除禁言管理员失败,平台号:{},房间id:{},云信返回值:{}", - record.getErbanNo(), record.getRoomId(), ret.getCode()); - } - return 0; - } - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteRecordAdminService.java deleted file mode 100644 index 264b2e59b..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserMuteRecordAdminService.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.accompany.admin.service.user; - -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.service.base.BaseService; -import com.accompany.business.model.UserMuteRecord; -import com.accompany.business.model.UserMuteRecordExample; -import com.accompany.business.mybatismapper.UserMuteRecordMapper; -import com.accompany.business.service.ErBanNetEaseService; -import com.accompany.business.service.room.RoomService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.accompany.common.netease.neteaseacc.result.RubbishRet; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-05-08 20:06 - */ -@Service -public class UserMuteRecordAdminService extends BaseService { - - @Autowired - private UserMuteRecordMapper userMuteRecordMapper; - @Autowired - private ErBanNetEaseService erBanNetEaseService; - @Autowired - private RoomService roomService; - - public PageInfo queryForPages(Long erbanNo, Date startTime, Date endTime, Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(queryList(erbanNo, startTime, endTime)); - } - - public List queryList(Long erbanNo, Date startTime, Date endTime) { - UserMuteRecordExample example = new UserMuteRecordExample(); - example.setOrderByClause(" create_time desc "); - UserMuteRecordExample.Criteria criteria = example.createCriteria(); - if(null != startTime) { - criteria.andCreateTimeGreaterThanOrEqualTo(startTime); - } - if(null != endTime) { - criteria.andCreateTimeLessThan(endTime); - } - if(null != erbanNo) { - criteria.andErbanNoEqualTo(erbanNo); - } - return userMuteRecordMapper.selectByExample(example); - } - - /** - * 解除禁言 - * @param id - */ - public void release(Integer id, String reason) throws Exception { - UserMuteRecord userMuteRecord = userMuteRecordMapper.selectByPrimaryKey(id); - if(null == userMuteRecord) { - throw new BusinessException("记录不存在!"); - } - long now = System.currentTimeMillis(); - long createTimestamp = userMuteRecord.getCreateTime().getTime(); - //fix bug: muteTime为int类型,有溢出bug - if(createTimestamp + ((long)userMuteRecord.getMuteTime()) * 1000 < now) { - logger.info("禁言已过期,不必处理!,记录id:{}", id); - return; - } - Long roomUid = roomService.getroomUidByRoomId(userMuteRecord.getRoomId()); - if(roomUid == null) { - throw new BusinessException("找不到房主信息,请确认房间是否已关闭!"); - } - RubbishRet ret = erBanNetEaseService.temporaryMuteFromRoom(userMuteRecord.getRoomId(), - String.valueOf(roomUid), String.valueOf(userMuteRecord.getUid()), - 0, "true", null); - if(ret.getCode() != 200) { - logger.warn("解除用户禁言记录失败,用户id:{},房间id:{}, 云信返回:{}", userMuteRecord.getOperatorId(), - userMuteRecord.getUid(), ret.getCode()); - if(ret.getCode() == 403) { - throw new BusinessException("无解禁权限或仅房间创建者可以解禁管理员"); - } - } - //更新记录 - UserMuteRecord updateRecord = new UserMuteRecord(); - updateRecord.setId(id); - updateRecord.setUpdateTime(new Date()); - updateRecord.setMuteTime(0); - updateRecord.setReason(reason); - userMuteRecordMapper.updateByPrimaryKeySelective(updateRecord); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/vip/VipAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/vip/VipAdminService.java index ee5486f59..0a4fd069e 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/vip/VipAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/vip/VipAdminService.java @@ -132,7 +132,7 @@ public class VipAdminService { @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") public void updateVip(UpdateVipAdminParams params) { if (params == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if (params.getVipLevel() == null) { throw new ServiceException("贵族等级不能为空"); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawConfigAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawConfigAdminService.java index a4da1d6fa..ad7eaa71a 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawConfigAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawConfigAdminService.java @@ -84,10 +84,10 @@ public class WithdrawConfigAdminService extends BaseService { sysConfAdminService.updateConfigValueById(Constant.SysConfId.WITHDRAWAL_CONFIG, configStr); } catch (JsonProcessingException e) { log.error("[金币提现] 序列化 config 异常 {}", configDto, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } catch (NacosException e) { log.error("[金币提现] 保存到 nacos 异常 {}", configDto, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } } @@ -96,14 +96,14 @@ public class WithdrawConfigAdminService extends BaseService { String configStr = sysConfAdminService.getSysConfValueById(Constant.SysConfId.WITHDRAWAL_CONFIG); if (!org.springframework.util.StringUtils.hasText(configStr)) { log.error("[金币提现] 配置为空 {}", Constant.SysConfId.WITHDRAWAL_CONFIG); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } WithdrawConfigDto config = null; try { config = objectMapper.readValue(configStr, WithdrawConfigDto.class); } catch (IOException e) { log.error("[金币提现] 获取配置异常 {}", Constant.SysConfId.WITHDRAWAL_CONFIG); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return config; } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/impl/WithdrawUserRecordAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/impl/WithdrawUserRecordAdminServiceImpl.java index 584d62435..582f0a804 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/impl/WithdrawUserRecordAdminServiceImpl.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/impl/WithdrawUserRecordAdminServiceImpl.java @@ -219,7 +219,7 @@ public class WithdrawUserRecordAdminServiceImpl implements WithdrawUserRecordAdm UserPurse userPurse = userPurseService.queryUserPurse(uid); Double currentGolds = userPurse.getGolds(); log.error("[金币提现退回] {} 当前钱包金币数 {} ,加金币数 {} 不成功", uid, currentGolds, goldNum); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } //添加账单记录 billRecordService.insertGeneralBillRecord(uid, uid, record.getId().toString(), BillObjTypeEnum.REJECT_WITHDRAW, goldNum.doubleValue()); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldAdminService.java index 1edfb4ccd..76dc22723 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldAdminService.java @@ -161,7 +161,7 @@ public class WorldAdminService extends BaseService { String lockKey = RedisKey.world_name_lock.getKey(); String lockVal = jedisLockService.lock(lockKey, 1000, 10 * 1000); if (StringUtils.isEmpty(lockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } try { if (iWorldService.hasSameName(record.getName())) { @@ -241,7 +241,7 @@ public class WorldAdminService extends BaseService { worldNameChange = true; nameLockVal = jedisLockService.lock(nameLockKey, 1000, 10 * 1000); if (StringUtils.isEmpty(nameLockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldMemberAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldMemberAdminService.java index d5345fd2c..115436dd8 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldMemberAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/WorldMemberAdminService.java @@ -87,7 +87,7 @@ public class WorldMemberAdminService { //批量添加时,耗时会有点久,因此加锁时间略长 String lockVal = jedisLockService.lock(lockKey, 1000, 60 * 1000); if (StringUtils.isEmpty(lockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } try { int result = 0; diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/community/DynamicDataAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/community/DynamicDataAdminService.java index a6186006f..3b96f3618 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/community/DynamicDataAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/world/community/DynamicDataAdminService.java @@ -316,7 +316,7 @@ public class DynamicDataAdminService extends BaseService { public void switchSquareTop(Long id, Byte squareTop) { String lockKey = RedisKey.dynamic_square_top_lock.getKey(); String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); try { @@ -367,7 +367,7 @@ public class DynamicDataAdminService extends BaseService { public void switchTopicTop(Long id, Byte topicTop) { String lockKey = RedisKey.dynamic_topic_top_lock.getKey(); String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); try { Dynamic currentDynamic = iDynamicService.getById(id); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/util/InviteCodeUtil.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/util/InviteCodeUtil.java index 6e5a49b5a..79b37ab74 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/util/InviteCodeUtil.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/util/InviteCodeUtil.java @@ -66,7 +66,7 @@ public class InviteCodeUtil { String lockVal = jedisLockService.lock(RedisKey.flow_team_gen_invite_code_lock.getKey(), 10 * 1000, 30 * 1000); try { if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 加锁之后重新判断是否需要重置 String newCodeStr = jedisService.get(RedisKey.flow_team_curr_gen_invite_code.getKey()); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ErBanNetEaseController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ErBanNetEaseController.java index dc72622d5..e99536e52 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ErBanNetEaseController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ErBanNetEaseController.java @@ -80,7 +80,7 @@ public class ErBanNetEaseController extends BaseController { @RequestParam(value = "reverse", defaultValue = "2") int reverse, @RequestParam(value = "type", defaultValue = "0,1") String type) { if (null == from || null == to) { - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } if (null == endTime) { endTime = System.currentTimeMillis(); @@ -99,11 +99,11 @@ public class ErBanNetEaseController extends BaseController { data.put("users", user); return BusiResult.success(data); } else { - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } } catch (Exception e) { logger.error("获取单聊消息失败,from:{},to:{},异常:{}", from, to, ExceptionUtils.getStackTrace(e)); - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ExceptionController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ExceptionController.java index 48f938670..460757c48 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ExceptionController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ExceptionController.java @@ -1,6 +1,5 @@ package com.accompany.admin.controller; -import com.accompany.common.status.BusiStatusInterface; import com.accompany.core.exception.ServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; @@ -25,26 +24,24 @@ public class ExceptionController { @ExceptionHandler(ServiceException.class) @ResponseBody - public BusiResult handleServiceException(HttpServletRequest request, HttpServletResponse response, Exception exception){ + public BusiResult handleServiceException(HttpServletRequest request, HttpServletResponse response, Exception exception){ logger.error("handleServiceException", exception.getMessage()); - if (exception instanceof ServiceException){ ServiceException serviceException = (ServiceException) exception; - BusiStatusInterface status = serviceException.getBusiStatus(); + BusiStatus status = serviceException.getBusiStatus(); if (status != null){ - return new BusiResult(status); + return new BusiResult<>(status); } } - return new BusiResult(BusiStatus.SERVERERROR); + return new BusiResult<>(BusiStatus.SERVERERROR); } @ExceptionHandler(Exception.class) @ResponseBody - public BusiResult handleException(HttpServletRequest request, HttpServletResponse response, Exception exception){ + public BusiResult handleException(HttpServletRequest request, HttpServletResponse response, Exception exception){ logger.error("exception occurs ", exception); - - return new BusiResult(BusiStatus.SERVERERROR); + return new BusiResult<>(BusiStatus.SERVERERROR); } } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java index 67cfb4306..e57c63395 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java @@ -19,7 +19,7 @@ import com.github.pagehelper.PageInfo; import com.google.common.collect.Maps; import com.accompany.common.constant.Constant; import com.accompany.common.constant.OpenBoxKeyTypeEnum; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import org.springframework.beans.factory.annotation.Autowired; @@ -86,7 +86,7 @@ public class UserCardsAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"exchangeCard", "params===>>uid:"+uid+",exchangeType:"+exchangeType+",exchangeRefId:"+exchangeRefId+",exchangeNum:"+exchangeNum+",eliminateCards:"+eliminateCards); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException | ApiException e){ + } catch (BusinessException | AdminServiceException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (ServiceException s){ return new BusiResult(s.getBusiStatus()); @@ -107,7 +107,7 @@ public class UserCardsAdminController extends BaseController { return new BusiResult(BusiStatus.SUCCESS); } catch (BusinessException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (ApiException e){ + } catch (AdminServiceException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); @@ -172,7 +172,7 @@ public class UserCardsAdminController extends BaseController { OpenBoxKeyTypeEnum.DIAMOND.getValue() + ",exchangeNum:" + userBackpack.getCount() + ",eliminateCards:"+eliminateCards); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException | ApiException e){ + } catch (BusinessException | AdminServiceException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (ServiceException s){ return new BusiResult(s.getBusiStatus()); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/OfficialGoldBusTypeController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/OfficialGoldBusTypeController.java index c196cba27..6f9e4bcac 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/OfficialGoldBusTypeController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/record/OfficialGoldBusTypeController.java @@ -73,7 +73,7 @@ public class OfficialGoldBusTypeController extends BaseController { @ResponseBody public BusiResult edit(OfficialGoldBusType record) { int result = officialGoldBusTypeAdminService.edit(record); - return result > 0 ? new BusiResult(BusiStatus.SUCCESS) : new BusiResult(BusiStatus.SERVER_BUSY); + return result > 0 ? new BusiResult(BusiStatus.SUCCESS) : new BusiResult(BusiStatus.SERVERBUSY); } /** @@ -86,7 +86,7 @@ public class OfficialGoldBusTypeController extends BaseController { @ResponseBody public BusiResult delete(Integer id) { int result = officialGoldBusTypeAdminService.delete(id); - return result > 0 ? new BusiResult(BusiStatus.SUCCESS) : new BusiResult(BusiStatus.SERVER_BUSY); + return result > 0 ? new BusiResult(BusiStatus.SUCCESS) : new BusiResult(BusiStatus.SERVERBUSY); } @RequestMapping("/listByQuery") diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java index 2948f3375..2e014a704 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java @@ -180,7 +180,7 @@ public class RoomAdminController extends BaseController { logger.error("Failed to resetNewRoom.Cause by {}", e.getMessage(), e); return BusiResult.fail(e.getMessage()); } - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } /** @@ -204,7 +204,7 @@ public class RoomAdminController extends BaseController { logger.error("Failed to resetNewRoom.Cause by {}", e.getMessage(), e); return BusiResult.fail(e.getMessage()); } - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteAdminController.java deleted file mode 100644 index 78d5a6eff..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteAdminController.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.core.exception.ServiceException; -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.system.AdminUserService; -import com.accompany.admin.service.user.UserMuteAdminService; -import com.accompany.business.model.UserMuteAdmin; -import com.github.pagehelper.PageInfo; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-04-26 15:54 - */ -@RestController -@RequestMapping("/admin/user/mute") -public class UserMuteAdminController extends BaseController { - - @Autowired - private UserMuteAdminService userMuteAdminService; - @Autowired - private AdminUserService adminUserService; - - - @RequestMapping(value = "list", method = RequestMethod.GET) - public void list(Long erbanNo, Byte status){ - PageInfo pageInfo = userMuteAdminService.queryForPages(erbanNo, status, getPageNumber(), getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "save", method = RequestMethod.POST) - public BusiResult save(Long erbanNo, Long roomErbanNo){ - try { - int result = userMuteAdminService.save(erbanNo, roomErbanNo, getAdminId()); - if(result > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "添加失败!",null); - } - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } - - @RequestMapping(value = "delete", method = RequestMethod.POST) - public BusiResult delete(Integer id){ - if(null == id || id <= 0) { - return new BusiResult(BusiStatus.PARAMERROR); - } - try { - int result = userMuteAdminService.deleteById(id); - if(result > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "添加失败!",null); - } - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (Exception e){ - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } - - @RequestMapping(value = "getById", method = RequestMethod.GET) - public BusiResult getById(Integer id){ - if(null == id || id <= 0) { - return new BusiResult(BusiStatus.PARAMERROR); - } - try { - UserMuteAdmin record = userMuteAdminService.getById(id); - return new BusiResult(BusiStatus.SUCCESS, record); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteRecordAdminController.java deleted file mode 100644 index f155bbd2b..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserMuteRecordAdminController.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.core.exception.ServiceException; -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.user.UserMuteRecordAdminService; -import com.accompany.business.model.UserMuteRecord; -import com.github.pagehelper.PageInfo; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Date; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-05-08 20:04 - */ -@RestController -@RequestMapping("/admin/user/mute/record") -public class UserMuteRecordAdminController extends BaseController { - - @Autowired - private UserMuteRecordAdminService userMuteRecordAdminService; - - - @RequestMapping(value = "list", method = RequestMethod.GET) - public void list(Long erbanNo, Date startTime, Date endTime){ - PageInfo pageInfo = userMuteRecordAdminService.queryForPages(erbanNo, startTime, endTime, - getPageNumber(), getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - /** - * 解除禁言 - * @param id - * @return - */ - @RequestMapping(value="release") - public BusiResult release(Integer id, String reason) { - if(null == id || id <= 0) { - return new BusiResult(BusiStatus.PARAMERROR); - } - try { - userMuteRecordAdminService.release(id, reason); - return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (Exception e) { - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/world/community/RecommendWorldAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/world/community/RecommendWorldAdminController.java index b7680b9ab..065f69577 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/world/community/RecommendWorldAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/world/community/RecommendWorldAdminController.java @@ -64,7 +64,7 @@ public class RecommendWorldAdminController extends BaseController { if (result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } catch (ServiceException e) { return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(), null); @@ -83,7 +83,7 @@ public class RecommendWorldAdminController extends BaseController { if(result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } @@ -119,7 +119,7 @@ public class RecommendWorldAdminController extends BaseController { if(result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } @@ -136,7 +136,7 @@ public class RecommendWorldAdminController extends BaseController { if(result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } diff --git a/accompany-admin/accompany-admin-web/src/main/resources/static/html/activity/family_PK_manage_admin.html b/accompany-admin/accompany-admin-web/src/main/resources/static/html/activity/family_PK_manage_admin.html deleted file mode 100644 index e684d3b59..000000000 --- a/accompany-admin/accompany-admin-web/src/main/resources/static/html/activity/family_PK_manage_admin.html +++ /dev/null @@ -1,601 +0,0 @@ - - -
-
-
-

-
- -
-
-
- - -
-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_admin.html b/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_admin.html deleted file mode 100644 index 48a8fa386..000000000 --- a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_admin.html +++ /dev/null @@ -1,736 +0,0 @@ -
-
-
- -
-

-
- -
-
-
-
- -
- - -
- - -
- - -
-
-
- -
- - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - diff --git a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_member_admin.html b/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_member_admin.html deleted file mode 100644 index dcf1ed95e..000000000 --- a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_member_admin.html +++ /dev/null @@ -1,182 +0,0 @@ -
-
-
- -
-

-
- -
-
-
-
- -
- - -
- - -
- - -
-
-
- -
- - - -
-
-
-
-
- - diff --git a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_money_admin.html b/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_money_admin.html deleted file mode 100644 index 2839e61a2..000000000 --- a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_money_admin.html +++ /dev/null @@ -1,451 +0,0 @@ -
-
-
- -
-

-
- -
-
- 家族ID: - - 家族昵称: - - -
-
-
-
- - - - - - - - - - - - - - - - diff --git a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_statistics.html b/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_statistics.html deleted file mode 100644 index af4ef3230..000000000 --- a/accompany-admin/accompany-admin-web/src/main/resources/static/html/family/family_statistics.html +++ /dev/null @@ -1,130 +0,0 @@ -
-
-
- -
-

-
- -
-
-
-

-
-
- 家族ID : -
- -
-
- -
-
-
-
-
- - - -
-
-
-
-
-
- - diff --git a/accompany-admin/accompany-flow-team-admin-service/src/main/java/com/accompany/service/FlowTeamMemberStatisticsService.java b/accompany-admin/accompany-flow-team-admin-service/src/main/java/com/accompany/service/FlowTeamMemberStatisticsService.java index 9f8dccfc0..f80d22e11 100644 --- a/accompany-admin/accompany-flow-team-admin-service/src/main/java/com/accompany/service/FlowTeamMemberStatisticsService.java +++ b/accompany-admin/accompany-flow-team-admin-service/src/main/java/com/accompany/service/FlowTeamMemberStatisticsService.java @@ -88,7 +88,7 @@ public class FlowTeamMemberStatisticsService { List dates = DateTimeUtil.getBetweenDates(startTime, endTime, true); if (dates.size() > FlowTeamAdminConstants.MAX_QUERY_DATES) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "查询时间段不能大于" + FlowTeamAdminConstants.MAX_QUERY_DATES + "天"); + throw new ServiceException(BusiStatus.SERVERBUSY, "查询时间段不能大于" + FlowTeamAdminConstants.MAX_QUERY_DATES + "天"); } if (dates.size() <= 0) { throw new ServiceException(BusiStatus.PARAMERROR, "查询时间段必须至少间隔1天"); diff --git a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/VisitorVo.java b/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/VisitorVo.java deleted file mode 100644 index a9e7dd73c..000000000 --- a/accompany-base/accompany-basic/accompany-basic-sdk/src/main/java/com/accompany/core/vo/VisitorVo.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.accompany.core.vo; - -/** - * Created by liuguofu on 2017/6/30. - */ -public class VisitorVo { - private Long uid; - private String netEaseToken; - private String nick; - private Byte gender; - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public String getNetEaseToken() { - return netEaseToken; - } - - public void setNetEaseToken(String netEaseToken) { - this.netEaseToken = netEaseToken; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public Byte getGender() { - return gender; - } - - public void setGender(Byte gender) { - this.gender = gender; - } -} diff --git a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java index 3b89d822f..c141e1f0d 100644 --- a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java +++ b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/account/AccountService.java @@ -312,7 +312,7 @@ public class AccountService extends ServiceImpl { public void delNickPasswordCache(Long erbanNo) { String key = RedisKey.user_erban_no_uid.getKey(erbanNo.toString()); - jedisService.remove(key); + jedisService.del(key); } public Account getAccountByUid(Long uid) { diff --git a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/phone/impl/PhoneAuthApplyRecordServiceImpl.java b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/phone/impl/PhoneAuthApplyRecordServiceImpl.java index f1ecd8de9..83b0f3b22 100644 --- a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/phone/impl/PhoneAuthApplyRecordServiceImpl.java +++ b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/phone/impl/PhoneAuthApplyRecordServiceImpl.java @@ -76,7 +76,7 @@ public class PhoneAuthApplyRecordServiceImpl extends ServiceImpl 0) { - return String.format(reasonPhrase, formatArgs); - } return reasonPhrase; } @@ -680,22 +464,14 @@ public enum BusiStatus implements BusiStatusInterface { return Integer.toString(value); } - public BusiStatus build(Object... formatArgs) { - this.formatArgs = formatArgs; - return this; - } - - @Override public String getName() { return name(); } - @Override public int getCode() { return value(); } - @Override public String getMessage() { return getReasonPhrase(); } diff --git a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatusInterface.java b/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatusInterface.java deleted file mode 100644 index 12bb988db..000000000 --- a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatusInterface.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.accompany.common.status; - -public interface BusiStatusInterface { - - String getName(); - - int getCode(); - - String getMessage(); - -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java index a0e142e7e..618f139ae 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.StrUtil; import com.accompany.common.annotation.AppVersion; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.AppVersionUtil; import com.accompany.core.base.DeviceInfoContextHolder; import lombok.extern.slf4j.Slf4j; @@ -13,7 +13,6 @@ import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import java.lang.reflect.Method; @@ -60,10 +59,10 @@ public class AppVersionAspect { return; } if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, iosVersion) < 0) { - throw new ApiException(message); + throw new AdminServiceException(message); } if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, androidVersion) < 0) { - throw new ApiException(message); + throw new AdminServiceException(message); } } diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java index fbc13d313..28eaab043 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java @@ -411,8 +411,6 @@ public enum RedisKey { h5loginjwtoken, // h5登录token - h5_login_code, // h5授权登录授权码 - h5_login_token, // h5授权成功后有效票据 h5_exchange_cumulative, // h5当天累计兑换额 web_config, // 网页配置 diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/result/BusiResult.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/result/BusiResult.java index 97136e9c0..8afd79331 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/result/BusiResult.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/result/BusiResult.java @@ -1,7 +1,6 @@ package com.accompany.common.result; import com.accompany.common.status.BusiStatus; -import com.accompany.common.status.BusiStatusInterface; import com.accompany.core.annotation.I18nPartition; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModel; @@ -33,37 +32,37 @@ public class BusiResult { @ApiModelProperty("时间戳") private long timestamp; - public BusiResult(BusiStatusInterface status) { - this(status, (status != null ? status.getMessage() : null), null); + public BusiResult(BusiStatus status) { + this(status, (status != null ? status.getReasonPhrase() : null), null); } - public BusiResult(BusiStatusInterface status, T data) { + public BusiResult(BusiStatus status, T data) { if (status == null) { - status = BusiStatus.SERVER_BUSY; + status = BusiStatus.SERVERBUSY; } - this.code = status.getCode(); - this.codeName = status.getName(); - this.message = status.getMessage(); + this.code = status.value(); + this.codeName = status.name(); + this.message = status.getReasonPhrase(); this.data = data; this.timestamp = System.currentTimeMillis(); } - public BusiResult(BusiStatusInterface status, String message) { + public BusiResult(BusiStatus status, String message) { if (status == null) { - status = BusiStatus.SERVER_BUSY; + status = BusiStatus.SERVERBUSY; } - this.code = status.getCode(); - this.codeName = status.getName(); + this.code = status.value(); + this.codeName = status.name(); this.message = message; this.timestamp = System.currentTimeMillis(); } - public BusiResult(BusiStatusInterface status, String message, T data) { + public BusiResult(BusiStatus status, String message, T data) { if (status == null) { - status = BusiStatus.SERVER_BUSY; + status = BusiStatus.SERVERBUSY; } - this.code = status.getCode(); - this.codeName = status.getName(); + this.code = status.value(); + this.codeName = status.getReasonPhrase(); this.message = message; this.data = data; this.timestamp = System.currentTimeMillis(); @@ -75,7 +74,7 @@ public class BusiResult { public void setBusiResult(BusiStatus status) { if (status == null) { - status = BusiStatus.SERVER_BUSY; + status = BusiStatus.SERVERBUSY; } this.code = status.value(); this.message = status.getReasonPhrase(); @@ -101,17 +100,17 @@ public class BusiResult { return fail(BusiStatus.SERVERERROR, message, null); } - public static BusiResult fail(BusiStatusInterface status, String message) { + public static BusiResult fail(BusiStatus status, String message) { return fail(status, message, null); } - public static BusiResult fail(BusiStatusInterface status, String message, T data) { + public static BusiResult fail(BusiStatus status, String message, T data) { return build(status, message, data); } - private static BusiResult build(BusiStatusInterface status, String message, T data) { + private static BusiResult build(BusiStatus status, String message, T data) { if ((message == null || message.isEmpty()) && status != null) { - message = status.getMessage(); + message = status.getReasonPhrase(); } return new BusiResult<>(status, message, data); } diff --git a/accompany-base/accompany-common/src/main/java/com/accompany/common/exception/ApiException.java b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/AdminServiceException.java similarity index 54% rename from accompany-base/accompany-common/src/main/java/com/accompany/common/exception/ApiException.java rename to accompany-base/accompany-core/src/main/java/com/accompany/core/exception/AdminServiceException.java index 25f9dd7fa..7bcfba130 100644 --- a/accompany-base/accompany-common/src/main/java/com/accompany/common/exception/ApiException.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/AdminServiceException.java @@ -1,27 +1,25 @@ -package com.accompany.common.exception; +package com.accompany.core.exception; import com.accompany.common.status.BusiStatus; -/** - * Created by PaperCut on 2018/3/27. - */ -public class ApiException extends RuntimeException { + +public class AdminServiceException extends RuntimeException { private int responseCode; - public ApiException(BusiStatus status) { + public AdminServiceException(BusiStatus status) { this(status.value(), status.getReasonPhrase()); } - public ApiException(String message) { + public AdminServiceException(String message) { this(BusiStatus.SERVERERROR.value(), message); } - public ApiException(int responseCode, String message) { + public AdminServiceException(int responseCode, String message) { super(message); this.responseCode = responseCode; } - public ApiException(int responseCode, String message, Throwable cause) { + public AdminServiceException(int responseCode, String message, Throwable cause) { super(message, cause); this.responseCode = responseCode; } diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/GlobalExceptionHandler.java b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/GlobalExceptionHandler.java index 69753cee6..7c4af694f 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/GlobalExceptionHandler.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/GlobalExceptionHandler.java @@ -45,7 +45,7 @@ public class GlobalExceptionHandler { public BusiResult handle(HttpServletRequest request, ServiceException exception) { logErrorMessage(request, exception); return new BusiResult<>(exception.getBusiStatus() == null ? - BusiStatus.SERVER_BUSY : exception.getBusiStatus(), exception.getMessage()); + BusiStatus.SERVERBUSY : exception.getBusiStatus(), exception.getMessage()); } /** @@ -72,7 +72,11 @@ public class GlobalExceptionHandler { * @param exception 异常 * @return BusiResult */ - @ExceptionHandler(MethodArgumentNotValidException.class) + @ExceptionHandler({ + HttpMessageNotReadableException.class, + MethodArgumentNotValidException.class, + BindException.class + }) public BusiResult handle( HttpServletRequest request, MethodArgumentNotValidException exception) { logErrorMessage(request, exception); @@ -90,21 +94,7 @@ public class GlobalExceptionHandler { @ExceptionHandler({IllegalStateException.class}) public BusiResult handle(HttpServletRequest request, IllegalStateException exception) { logErrorMessage(request, exception); - return new BusiResult<>(BusiStatus.SERVER_BUSY, exception.getMessage()); - } - - /** - * 捕获请求体异常 - * - * @param request 请求对象 - * @param exception 异常 - * @return BusiResult - */ - @ExceptionHandler(HttpMessageNotReadableException.class) - public BusiResult handle( - HttpServletRequest request, HttpMessageNotReadableException exception) { - logErrorMessage(request, exception); - return new BusiResult<>(BusiStatus.PARAMERROR, "請求體錯誤"); + return new BusiResult<>(BusiStatus.SERVERBUSY, exception.getMessage()); } /** @@ -130,7 +120,7 @@ public class GlobalExceptionHandler { @ExceptionHandler(Exception.class) public BusiResult handle(HttpServletRequest request, Exception exception) { logErrorMessage(request, exception); - return new BusiResult<>(BusiStatus.SERVER_BUSY); + return new BusiResult<>(BusiStatus.SERVERERROR); } /** diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/RedisDataAccessException.java b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/RedisDataAccessException.java deleted file mode 100644 index b1cb643c2..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/RedisDataAccessException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.accompany.core.exception; - -import org.springframework.dao.DataAccessException; - -/** - */ -public class RedisDataAccessException extends DataAccessException{ - - public RedisDataAccessException(String message) { - super(message); - } - - public RedisDataAccessException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/ServiceException.java b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/ServiceException.java index a11dc9368..447e7f573 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/ServiceException.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/core/exception/ServiceException.java @@ -1,7 +1,6 @@ package com.accompany.core.exception; import com.accompany.common.status.BusiStatus; -import com.accompany.common.status.BusiStatusInterface; /** * @author yangziwen @@ -10,14 +9,14 @@ import com.accompany.common.status.BusiStatusInterface; */ public class ServiceException extends RuntimeException { - private BusiStatusInterface busiStatus; + private BusiStatus busiStatus; - public ServiceException(BusiStatusInterface busiStatus) { - super(busiStatus.getMessage()); + public ServiceException(BusiStatus busiStatus) { + super(busiStatus.getReasonPhrase()); this.busiStatus = busiStatus; } - public ServiceException(BusiStatusInterface busiStatus, String message) { + public ServiceException(BusiStatus busiStatus, String message) { super(message); this.busiStatus = busiStatus; } @@ -30,7 +29,7 @@ public class ServiceException extends RuntimeException { super(message, cause); } - public BusiStatusInterface getBusiStatus() { + public BusiStatus getBusiStatus() { return busiStatus; } diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/core/service/common/JedisService.java b/accompany-base/accompany-core/src/main/java/com/accompany/core/service/common/JedisService.java index eede3dea4..b4fda4fd6 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/core/service/common/JedisService.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/core/service/common/JedisService.java @@ -1,7 +1,7 @@ package com.accompany.core.service.common; import com.accompany.common.redis.JedisPoolManager; -import com.accompany.core.exception.RedisDataAccessException; +import com.accompany.core.exception.ServiceException; import com.accompany.core.util.StringUtils; import com.accompany.core.vo.RedisHashVo; import com.alibaba.fastjson.JSON; @@ -78,78 +78,6 @@ public class JedisService { return Boolean.FALSE; } - - public byte[] readByte(String key) throws RedisDataAccessException { - byte[] ret = null; - Jedis rjedis = null; - try { - rjedis = readJedisPoolManager.getJedis(); - byte[] jedisKey = key.getBytes(); - byte[] content = rjedis.get(jedisKey); - if (content != null && content.length > 0) { - ret = content; - } - } catch (Exception e) { - log.error("read from jedis error. key:{} msg:{}", key, e); - throw new RedisDataAccessException("redis read error.", e); - } finally { - if (rjedis != null) { - rjedis.close(); - } - } - return ret; - } - - /** - * 写入redis,并指定失效时间点 - * - * @param key - * @param content 数据 - * @param deadLine 失效时间点 - */ - public void write(String key, String content, Date deadLine) { - Jedis wjedis = null; - long now = System.currentTimeMillis(); - long dead = deadLine.getTime(); - int expireTime = (int) (dead - now) / (1000 * 60);//转换为分钟 - if (expireTime <= 0) { - log.warn("request ignored .Date:{} msg:{}", new Object[]{deadLine, " invalid deadLine:The deadLine must be one minute later than currentTime "}); - return; - } else { - try { - wjedis = writeJedisPoolManager.getJedis(); - byte[] data = null; - if (content != null) { - data = content.getBytes(); - } - byte[] jedisKey = key.getBytes(); - wjedis.setex(jedisKey, expireTime, data); - } catch (Exception e) { - throw new RedisDataAccessException("redis read error.", e); - } finally { - if (wjedis != null) { - wjedis.close(); - } - } - } - } - - public void write(String key, byte[] content, int expireTime) throws RedisDataAccessException { - Jedis wjedis = null; - try { - wjedis = writeJedisPoolManager.getJedis(); - byte[] data = content; - byte[] jedisKey = key.getBytes(); - wjedis.setex(jedisKey, expireTime, data); - } catch (Exception e) { - throw new RedisDataAccessException("Failed to write key " + key, e); - } finally { - if (wjedis != null) { - wjedis.close(); - } - } - } - /** * 写入redis,并指定失效时间点 * @@ -777,21 +705,6 @@ public class JedisService { } } - public void remove(String key) throws RedisDataAccessException { - Jedis wjedis = null; - try { - wjedis = writeJedisPoolManager.getJedis(); - wjedis.del(key); - } catch (Exception e) { - log.error("remove error. key:{} msg:{}", key, e); - throw new RedisDataAccessException("Failed to remove key " + key, e); - } finally { - if (wjedis != null) { - wjedis.close(); - } - } - } - public void hincrbyfloat(String key, String property, double value) { Jedis wjedis = null; try { @@ -1563,9 +1476,8 @@ public class JedisService { /** * 批量删除redisKey * @param key - * @throws RedisDataAccessException */ - public void batchRemove(String key) throws RedisDataAccessException { + public void batchRemove(String key) { Jedis wjedis = null; try { wjedis = writeJedisPoolManager.getJedis(); @@ -1578,33 +1490,7 @@ public class JedisService { } } catch (Exception e) { log.error("batchRemove error. key:{} msg:{}", key, e); - throw new RedisDataAccessException("Failed to batchRemove key " + key, e); - } finally { - if (wjedis != null) { - wjedis.close(); - } - } - } - - /** - * 批量删除key - * @param keys - * @throws RedisDataAccessException - */ - public void batchRemoveKey(String... keys) throws RedisDataAccessException { - Jedis wjedis = null; - try { - if(keys.length>0) { - wjedis = writeJedisPoolManager.getJedis(); - Pipeline p = wjedis.pipelined(); - for (String key : keys) { - p.del(key); - } - p.sync(); - } - } catch (Exception e) { - log.error("batchRemoveKey error. key:{}", keys); - throw new RedisDataAccessException("Failed to batchRemoveKey key " + keys); + throw new ServiceException("Failed to batchRemove key " + key, e); } finally { if (wjedis != null) { wjedis.close(); diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/iospay/IOSPayPlaService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/iospay/IOSPayPlaService.java index 85d1ec6b5..6452e348a 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/iospay/IOSPayPlaService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/iospay/IOSPayPlaService.java @@ -149,7 +149,7 @@ public class IOSPayPlaService extends BaseService { return recordIdVo; } catch (Exception e) { logger.error("applyCharge Exception:" + e.getMessage() + " uid=" + params.getUid() + ",chargeProdId=" + chargeRecord.getChargeRecordId(), e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java index 4e934968f..e3c3ac470 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java @@ -1,7 +1,7 @@ package com.accompany.payment.mycard; import cn.hutool.core.util.StrUtil; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.EnvComponent; import com.accompany.core.dto.HttpForm; import com.accompany.core.util.OkHttpUtils; @@ -89,7 +89,7 @@ public class MyCardService { checkResponseBody(response); return response; } catch (Exception e) { - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } } @@ -104,7 +104,7 @@ public class MyCardService { checkResponseBody(response); return response; } catch (Exception e) { - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } } @@ -119,7 +119,7 @@ public class MyCardService { checkResponseBody(response); return response; } catch (Exception e) { - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } } @@ -134,7 +134,7 @@ public class MyCardService { checkResponseBody(response); return response; } catch (Exception e) { - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } } @@ -176,19 +176,19 @@ public class MyCardService { //參數有誤 break; case "MBP001": - throw new ApiException("參數有誤"); + throw new AdminServiceException("參數有誤"); case "MBP002": - throw new ApiException("查詢資料失敗"); + throw new AdminServiceException("查詢資料失敗"); case "MBP003": - throw new ApiException("Hash 值不正確"); + throw new AdminServiceException("Hash 值不正確"); case "MBP004": - throw new ApiException(returnMsg); + throw new AdminServiceException(returnMsg); case "MBP005": - throw new ApiException("查詢失敗"); + throw new AdminServiceException("查詢失敗"); case "MBP098": - throw new ApiException("授權碼有誤"); + throw new AdminServiceException("授權碼有誤"); case "MBP099": - throw new ApiException("授權失敗"); + throw new AdminServiceException("授權失敗"); } } diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java index 0eb3c9df6..c6cae3b27 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/LuckyTarotRecordService.java @@ -1,6 +1,7 @@ package com.accompany.payment.service; -import com.accompany.common.exception.BusinessException; +import com.accompany.common.status.BusiStatus; +import com.accompany.core.exception.ServiceException; import com.accompany.core.service.base.BaseService; import com.accompany.payment.mapper.LuckyTarotRecordMapper; import com.accompany.payment.mapper.LuckyTarotRecordMapperExpand; @@ -47,7 +48,7 @@ public class LuckyTarotRecordService extends BaseService { criteria.andUidEqualTo(uid).andChargeRecordIdEqualTo(outTradeNo); List records = luckyTarotRecordMapper.selectByExample(example); if (CollectionUtils.isEmpty(records)){ - throw new BusinessException("没有塔罗占卜充值记录"); + throw new ServiceException("没有塔罗占卜充值记录"); } return records.get(0); } diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java index a93c9f94f..951f5260a 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java @@ -2,7 +2,7 @@ package com.accompany.payment.service; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.EnvComponent; @@ -205,7 +205,7 @@ public class PayCenterService { PayContext payContext = buildPayContext(null, null, successUrlSb.toString(), chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { - throw new ApiException("支付失败.未找到正确的支付渠道"); + throw new AdminServiceException("支付失败.未找到正确的支付渠道"); } TarotChargeRetVo retVo = new TarotChargeRetVo(); Object ret = strategy.pay(payContext); @@ -252,14 +252,14 @@ public class PayCenterService { PayContext payContext = buildPayContext(null, null, successUrl, facReturnUrl, chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { - throw new ApiException(500, "支付失败.未找到正确的支付渠道"); + throw new AdminServiceException(500, "支付失败.未找到正确的支付渠道"); } Object ret = null; try { ret = strategy.pay(payContext); } catch (Exception e) { log.error("开通贵族创建订单出现异常, uid :" + uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } log.info("Completed charge uid:{} channelProdId:{} channel:{}, ret:{}", uid, chargeProd.getChargeProdId(), channel, JSON.toJSONString(ret)); diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java index e65b93af0..d265cd6ca 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java @@ -3,7 +3,7 @@ package com.accompany.payment.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.service.SysConfService; import com.accompany.payment.dto.ChargeGuideConfig; @@ -46,7 +46,7 @@ public class ChargeUserLimitServiceImpl extends ServiceImpl propMap = userCpPropMap.getOrDefault(uid, new HashMap<>()); return function.apply(propMap); } catch (InterruptedException e) { log.error("[2023年度盛典活动] {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); @@ -176,7 +176,7 @@ public class AnnualCpDao implements InitializingBean { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } cpProp = getCpPropByCpUid(cpUid); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/annual/AnnualTaskDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/annual/AnnualTaskDao.java index 9a45cc815..574c89056 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/annual/AnnualTaskDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/annual/AnnualTaskDao.java @@ -108,13 +108,13 @@ public class AnnualTaskDao implements InitializingBean { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[2023年度盛典]-年度任务 {} 获取 {} 锁超时", uid, lockKey); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Map userRedBagMap = userTaskStatusMap.getOrDefault(uid, new HashMap<>()); return function.apply(userRedBagMap); } catch (Exception e) { log.error("[2023年度盛典]-年度任务 {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasCpDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasCpDao.java index 6e63ded69..a3fdfb397 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasCpDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasCpDao.java @@ -119,13 +119,13 @@ public class ChristmasCpDao implements InitializingBean { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[2023圣诞节活动] {} 获取 {} 锁超时", uid, lockKey); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Map propMap = userCpPropMap.getOrDefault(uid, new HashMap<>()); return function.apply(propMap); } catch (InterruptedException e) { log.error("[2023圣诞节活动] {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); @@ -232,7 +232,7 @@ public class ChristmasCpDao implements InitializingBean { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } cpProp = getCpPropByCpUid(cpUid); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasLetterDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasLetterDao.java index bab22436b..17f5018fe 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasLetterDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/christmas/ChristmasLetterDao.java @@ -2,11 +2,8 @@ package com.accompany.business.christmas; import com.accompany.business.christmas.constant.ChristmasConstant; import com.accompany.business.christmas.dto.ChristmasLetterDto; -import com.accompany.business.qixi.constant.QixiConstant; -import com.accompany.business.qixi.dto.QixiUserRedBagDto; import com.accompany.common.constant.AppEnum; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.BusinessException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; import com.accompany.core.exception.ServiceException; @@ -24,7 +21,6 @@ import org.springframework.util.CollectionUtils; import java.util.*; import java.util.concurrent.TimeUnit; -import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -110,12 +106,12 @@ public class ChristmasLetterDao implements InitializingBean { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[2023圣诞活动]-保存情书 {} 获取 {} 锁超时", uid, lockKey); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return function.get(); } catch (Exception e) { log.error("[2023圣诞活动]-红线 {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenBoxLevelDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenBoxLevelDao.java index 769a33a6f..df7e0580a 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenBoxLevelDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenBoxLevelDao.java @@ -51,7 +51,7 @@ public class HalloweenBoxLevelDao implements InitializingBean { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ //todo log - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } boxLevel = getUserBoxLevel(uid); @@ -74,7 +74,7 @@ public class HalloweenBoxLevelDao implements InitializingBean { } catch (InterruptedException e) { //todo log - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (locked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenMapPosDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenMapPosDao.java index aa7fdc154..0428e7778 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenMapPosDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/halloween/HalloweenMapPosDao.java @@ -53,7 +53,7 @@ public class HalloweenMapPosDao implements InitializingBean { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ //todo log - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } boxLevel = getUserBoxLevel(uid); @@ -76,7 +76,7 @@ public class HalloweenMapPosDao implements InitializingBean { } catch (InterruptedException e) { //todo log - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (locked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/valentine/ValentinesCpDao.java b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/valentine/ValentinesCpDao.java index b085e1523..3176e5b6e 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/valentine/ValentinesCpDao.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-dao/src/main/java/com/accompany/business/valentine/ValentinesCpDao.java @@ -96,13 +96,13 @@ public class ValentinesCpDao implements InitializingBean { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[2024情人节活动] {} 获取 {} 锁超时", uid, lockKey); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Map propMap = userCpPropMap.getOrDefault(uid, new HashMap<>()); return function.apply(propMap); } catch (InterruptedException e) { log.error("[2024情人节活动] {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); @@ -174,7 +174,7 @@ public class ValentinesCpDao implements InitializingBean { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } cpProp = getCpPropByCpUid(cpUid); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/service/impl/ActUserTaskServiceImpl.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/service/impl/ActUserTaskServiceImpl.java index 713591491..63914121b 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/service/impl/ActUserTaskServiceImpl.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/service/impl/ActUserTaskServiceImpl.java @@ -15,11 +15,10 @@ import com.accompany.business.activity.vo.ActivityReward; import com.accompany.business.activity.vo.ActivityTask; import com.accompany.business.mapper.ActUserTaskDao; import com.accompany.business.model.UserPurse; -import com.accompany.business.model.redenvelope.RedEnvelopeRain; import com.accompany.business.service.purse.UserPurseService; import com.accompany.business.service.record.BillRecordService; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.UidContextHolder; @@ -97,7 +96,7 @@ public class ActUserTaskServiceImpl extends ServiceImpl actUserTasks = actUserTaskService.list(Wrappers.lambdaQuery() @@ -105,54 +104,54 @@ public class ActUserTaskServiceImpl extends ServiceImpl actTasks = actTaskService.list(Wrappers.lambdaQuery() .eq(ActTask::getActivityCode, activityCode) .eq(ActTask::getTaskCode, taskCode)); if (CollectionUtil.isEmpty(actTasks)) { - throw new ApiException("任务不存在"); + throw new AdminServiceException("任务不存在"); } ActTask actTask = actTasks.get(0); Integer taskValue = actTask.getTaskValue(); if (!Objects.equals(diamondNum, taskValue)) { - throw new ApiException("金额不匹配"); + throw new AdminServiceException("金额不匹配"); } List actTaskConditions = actTaskConditionService.list(Wrappers.lambdaQuery() .eq(ActTaskCondition::getActivityCode, activityCode) .eq(ActTaskCondition::getTaskCode, taskCode) .eq(ActTaskCondition::getConditionKind, ActConditionKindEnum.GE.name())); if (CollectionUtil.isEmpty(actTaskConditions)) { - throw new ApiException("任务条件不存在"); + throw new AdminServiceException("任务条件不存在"); } ActTaskCondition actTaskCondition = actTaskConditions.get(0); Long conditionValue = actTaskCondition.getConditionValue(); long activityValue = actUserTasks.stream().mapToLong(ActUserTask::getActivityValue).sum(); if (conditionValue == 0) { - throw new ApiException("任务值不能为0"); + throw new AdminServiceException("任务值不能为0"); } long validNum = activityValue / conditionValue; if (num > validNum) { - throw new ApiException("超过可用数量"); + throw new AdminServiceException("超过可用数量"); } List actTaskRewards = actTaskRewardService.list(Wrappers.lambdaQuery() .eq(ActTaskReward::getActivityCode, activityCode) .eq(ActTaskReward::getTaskCode, taskCode)); if (CollectionUtil.isEmpty(actTaskRewards)) { - throw new ApiException("缺少奖励配置"); + throw new AdminServiceException("缺少奖励配置"); } //余额校验 UserPurse userPurse = userPurseService.queryUserPurse(uid); Double currentDiamonds = userPurse.getDiamonds(); if (diamondNum > currentDiamonds) { - throw new ApiException(BusiStatus.PURSE_MONEY_NOT_ENOUGH); + throw new AdminServiceException(BusiStatus.PURSE_MONEY_NOT_ENOUGH); } //扣减钱包 if (!userPurseService.subDiamond(uid, diamondNum.doubleValue(), BillObjTypeEnum.ACTIVITY_PACKET.getDesc())) { userPurse = userPurseService.queryUserPurse(uid); currentDiamonds = userPurse.getDiamonds(); log.error("[购买活动礼物] {} 当前钱包钻石数 {} ,扣钻石数 {} 不成功", uid, currentDiamonds, diamondNum); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } for (ActTaskReward actTaskReward : actTaskRewards) { ActRewardContext context = new ActRewardContext(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java index b138e31bb..b695e074f 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java @@ -1,7 +1,7 @@ package com.accompany.business.activity.strategy; import cn.hutool.core.collection.CollectionUtil; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; @@ -21,7 +21,7 @@ public final class ActRewardFactory { if (ACT_REWARD_MAP.isEmpty()) { Map map = SpringContextHolder.getApplicationContext().getBeansOfType(IActRewardStrategy.class); if (CollectionUtil.isEmpty(map)) { - throw new ApiException(BusiStatus.SERVERERROR); + throw new AdminServiceException(BusiStatus.SERVERERROR); } for (Map.Entry entry : map.entrySet()) { ACT_REWARD_MAP.put(entry.getValue().getRewardType(), entry.getValue()); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/base/service/BaseLinearDrawActService.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/base/service/BaseLinearDrawActService.java index 9c99538a3..f8fa89c12 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/base/service/BaseLinearDrawActService.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/base/service/BaseLinearDrawActService.java @@ -49,7 +49,7 @@ public abstract class BaseLinearDrawActService userRedBagMap = qixiRedBagDao.getUserRedBagMap(uid); return function.apply(userRedBagMap); } catch (Exception e) { log.error("[2023七夕活动]-红线 {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/qixi/service/QixiXiqueService.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/qixi/service/QixiXiqueService.java index 8498748d9..4d0219068 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/qixi/service/QixiXiqueService.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/qixi/service/QixiXiqueService.java @@ -118,7 +118,7 @@ public class QixiXiqueService { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } serverNum = qixiXiqueNumDao.getServerCurXiqueNum(); @@ -135,7 +135,7 @@ public class QixiXiqueService { } catch (InterruptedException e) { log.error("[2023七夕活动]-喜鹊 投放喜鹊 加锁异常", e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (locked){ lock.unlock(); diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/snooker/service/SnookerRankService.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/snooker/service/SnookerRankService.java index 8827fa1af..53002028f 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/snooker/service/SnookerRankService.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/snooker/service/SnookerRankService.java @@ -64,7 +64,7 @@ public class SnookerRankService extends BaseRoundRankActService oredCriteria; - - public UserMuteAdminExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Integer value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Integer value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Integer value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Integer value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Integer value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Integer value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Integer value1, Integer value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Integer value1, Integer value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNull() { - addCriterion("erban_no is null"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNotNull() { - addCriterion("erban_no is not null"); - return (Criteria) this; - } - - public Criteria andErbanNoEqualTo(Long value) { - addCriterion("erban_no =", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotEqualTo(Long value) { - addCriterion("erban_no <>", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThan(Long value) { - addCriterion("erban_no >", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThanOrEqualTo(Long value) { - addCriterion("erban_no >=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThan(Long value) { - addCriterion("erban_no <", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThanOrEqualTo(Long value) { - addCriterion("erban_no <=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoIn(List values) { - addCriterion("erban_no in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotIn(List values) { - addCriterion("erban_no not in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoBetween(Long value1, Long value2) { - addCriterion("erban_no between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotBetween(Long value1, Long value2) { - addCriterion("erban_no not between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andNickIsNull() { - addCriterion("nick is null"); - return (Criteria) this; - } - - public Criteria andNickIsNotNull() { - addCriterion("nick is not null"); - return (Criteria) this; - } - - public Criteria andNickEqualTo(String value) { - addCriterion("nick =", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotEqualTo(String value) { - addCriterion("nick <>", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThan(String value) { - addCriterion("nick >", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThanOrEqualTo(String value) { - addCriterion("nick >=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThan(String value) { - addCriterion("nick <", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThanOrEqualTo(String value) { - addCriterion("nick <=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLike(String value) { - addCriterion("nick like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotLike(String value) { - addCriterion("nick not like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickIn(List values) { - addCriterion("nick in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotIn(List values) { - addCriterion("nick not in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickBetween(String value1, String value2) { - addCriterion("nick between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotBetween(String value1, String value2) { - addCriterion("nick not between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andRoomIdIsNull() { - addCriterion("room_id is null"); - return (Criteria) this; - } - - public Criteria andRoomIdIsNotNull() { - addCriterion("room_id is not null"); - return (Criteria) this; - } - - public Criteria andRoomIdEqualTo(Long value) { - addCriterion("room_id =", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotEqualTo(Long value) { - addCriterion("room_id <>", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdGreaterThan(Long value) { - addCriterion("room_id >", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdGreaterThanOrEqualTo(Long value) { - addCriterion("room_id >=", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdLessThan(Long value) { - addCriterion("room_id <", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdLessThanOrEqualTo(Long value) { - addCriterion("room_id <=", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdIn(List values) { - addCriterion("room_id in", values, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotIn(List values) { - addCriterion("room_id not in", values, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdBetween(Long value1, Long value2) { - addCriterion("room_id between", value1, value2, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotBetween(Long value1, Long value2) { - addCriterion("room_id not between", value1, value2, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNull() { - addCriterion("room_uid is null"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNotNull() { - addCriterion("room_uid is not null"); - return (Criteria) this; - } - - public Criteria andRoomUidEqualTo(Long value) { - addCriterion("room_uid =", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotEqualTo(Long value) { - addCriterion("room_uid <>", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThan(Long value) { - addCriterion("room_uid >", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThanOrEqualTo(Long value) { - addCriterion("room_uid >=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThan(Long value) { - addCriterion("room_uid <", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThanOrEqualTo(Long value) { - addCriterion("room_uid <=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidIn(List values) { - addCriterion("room_uid in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotIn(List values) { - addCriterion("room_uid not in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidBetween(Long value1, Long value2) { - addCriterion("room_uid between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotBetween(Long value1, Long value2) { - addCriterion("room_uid not between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoIsNull() { - addCriterion("room_erban_no is null"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoIsNotNull() { - addCriterion("room_erban_no is not null"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoEqualTo(Long value) { - addCriterion("room_erban_no =", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoNotEqualTo(Long value) { - addCriterion("room_erban_no <>", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoGreaterThan(Long value) { - addCriterion("room_erban_no >", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoGreaterThanOrEqualTo(Long value) { - addCriterion("room_erban_no >=", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoLessThan(Long value) { - addCriterion("room_erban_no <", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoLessThanOrEqualTo(Long value) { - addCriterion("room_erban_no <=", value, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoIn(List values) { - addCriterion("room_erban_no in", values, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoNotIn(List values) { - addCriterion("room_erban_no not in", values, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoBetween(Long value1, Long value2) { - addCriterion("room_erban_no between", value1, value2, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andRoomErbanNoNotBetween(Long value1, Long value2) { - addCriterion("room_erban_no not between", value1, value2, "roomErbanNo"); - return (Criteria) this; - } - - public Criteria andOperatorIdIsNull() { - addCriterion("operator_id is null"); - return (Criteria) this; - } - - public Criteria andOperatorIdIsNotNull() { - addCriterion("operator_id is not null"); - return (Criteria) this; - } - - public Criteria andOperatorIdEqualTo(Integer value) { - addCriterion("operator_id =", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotEqualTo(Integer value) { - addCriterion("operator_id <>", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdGreaterThan(Integer value) { - addCriterion("operator_id >", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdGreaterThanOrEqualTo(Integer value) { - addCriterion("operator_id >=", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdLessThan(Integer value) { - addCriterion("operator_id <", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdLessThanOrEqualTo(Integer value) { - addCriterion("operator_id <=", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdIn(List values) { - addCriterion("operator_id in", values, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotIn(List values) { - addCriterion("operator_id not in", values, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdBetween(Integer value1, Integer value2) { - addCriterion("operator_id between", value1, value2, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotBetween(Integer value1, Integer value2) { - addCriterion("operator_id not between", value1, value2, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIsNull() { - addCriterion("operator is null"); - return (Criteria) this; - } - - public Criteria andOperatorIsNotNull() { - addCriterion("operator is not null"); - return (Criteria) this; - } - - public Criteria andOperatorEqualTo(String value) { - addCriterion("operator =", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotEqualTo(String value) { - addCriterion("operator <>", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorGreaterThan(String value) { - addCriterion("operator >", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorGreaterThanOrEqualTo(String value) { - addCriterion("operator >=", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLessThan(String value) { - addCriterion("operator <", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLessThanOrEqualTo(String value) { - addCriterion("operator <=", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLike(String value) { - addCriterion("operator like", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotLike(String value) { - addCriterion("operator not like", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorIn(List values) { - addCriterion("operator in", values, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotIn(List values) { - addCriterion("operator not in", values, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorBetween(String value1, String value2) { - addCriterion("operator between", value1, value2, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotBetween(String value1, String value2) { - addCriterion("operator not between", value1, value2, "operator"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecord.java deleted file mode 100644 index 5ca83a091..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecord.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class UserMuteRecord { - private Integer id; - - private Long uid; - - private Long erbanNo; - - private String nick; - - private Long roomId; - - private Long operatorId; - - private String operator; - - private String reason; - - private Integer muteTime; - - private Date createTime; - - private Date updateTime; - - private Byte status; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick == null ? null : nick.trim(); - } - - public Long getRoomId() { - return roomId; - } - - public void setRoomId(Long roomId) { - this.roomId = roomId; - } - - public Long getOperatorId() { - return operatorId; - } - - public void setOperatorId(Long operatorId) { - this.operatorId = operatorId; - } - - public String getOperator() { - return operator; - } - - public void setOperator(String operator) { - this.operator = operator == null ? null : operator.trim(); - } - - public String getReason() { - return reason; - } - - public void setReason(String reason) { - this.reason = reason == null ? null : reason.trim(); - } - - public Integer getMuteTime() { - return muteTime; - } - - public void setMuteTime(Integer muteTime) { - this.muteTime = muteTime; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecordExample.java deleted file mode 100644 index 96598a6ed..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserMuteRecordExample.java +++ /dev/null @@ -1,951 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class UserMuteRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public UserMuteRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Integer value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Integer value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Integer value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Integer value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Integer value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Integer value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Integer value1, Integer value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Integer value1, Integer value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNull() { - addCriterion("erban_no is null"); - return (Criteria) this; - } - - public Criteria andErbanNoIsNotNull() { - addCriterion("erban_no is not null"); - return (Criteria) this; - } - - public Criteria andErbanNoEqualTo(Long value) { - addCriterion("erban_no =", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotEqualTo(Long value) { - addCriterion("erban_no <>", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThan(Long value) { - addCriterion("erban_no >", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoGreaterThanOrEqualTo(Long value) { - addCriterion("erban_no >=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThan(Long value) { - addCriterion("erban_no <", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoLessThanOrEqualTo(Long value) { - addCriterion("erban_no <=", value, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoIn(List values) { - addCriterion("erban_no in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotIn(List values) { - addCriterion("erban_no not in", values, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoBetween(Long value1, Long value2) { - addCriterion("erban_no between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andErbanNoNotBetween(Long value1, Long value2) { - addCriterion("erban_no not between", value1, value2, "erbanNo"); - return (Criteria) this; - } - - public Criteria andNickIsNull() { - addCriterion("nick is null"); - return (Criteria) this; - } - - public Criteria andNickIsNotNull() { - addCriterion("nick is not null"); - return (Criteria) this; - } - - public Criteria andNickEqualTo(String value) { - addCriterion("nick =", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotEqualTo(String value) { - addCriterion("nick <>", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThan(String value) { - addCriterion("nick >", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThanOrEqualTo(String value) { - addCriterion("nick >=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThan(String value) { - addCriterion("nick <", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThanOrEqualTo(String value) { - addCriterion("nick <=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLike(String value) { - addCriterion("nick like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotLike(String value) { - addCriterion("nick not like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickIn(List values) { - addCriterion("nick in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotIn(List values) { - addCriterion("nick not in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickBetween(String value1, String value2) { - addCriterion("nick between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotBetween(String value1, String value2) { - addCriterion("nick not between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andRoomIdIsNull() { - addCriterion("room_id is null"); - return (Criteria) this; - } - - public Criteria andRoomIdIsNotNull() { - addCriterion("room_id is not null"); - return (Criteria) this; - } - - public Criteria andRoomIdEqualTo(Long value) { - addCriterion("room_id =", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotEqualTo(Long value) { - addCriterion("room_id <>", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdGreaterThan(Long value) { - addCriterion("room_id >", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdGreaterThanOrEqualTo(Long value) { - addCriterion("room_id >=", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdLessThan(Long value) { - addCriterion("room_id <", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdLessThanOrEqualTo(Long value) { - addCriterion("room_id <=", value, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdIn(List values) { - addCriterion("room_id in", values, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotIn(List values) { - addCriterion("room_id not in", values, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdBetween(Long value1, Long value2) { - addCriterion("room_id between", value1, value2, "roomId"); - return (Criteria) this; - } - - public Criteria andRoomIdNotBetween(Long value1, Long value2) { - addCriterion("room_id not between", value1, value2, "roomId"); - return (Criteria) this; - } - - public Criteria andOperatorIdIsNull() { - addCriterion("operator_id is null"); - return (Criteria) this; - } - - public Criteria andOperatorIdIsNotNull() { - addCriterion("operator_id is not null"); - return (Criteria) this; - } - - public Criteria andOperatorIdEqualTo(Long value) { - addCriterion("operator_id =", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotEqualTo(Long value) { - addCriterion("operator_id <>", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdGreaterThan(Long value) { - addCriterion("operator_id >", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdGreaterThanOrEqualTo(Long value) { - addCriterion("operator_id >=", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdLessThan(Long value) { - addCriterion("operator_id <", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdLessThanOrEqualTo(Long value) { - addCriterion("operator_id <=", value, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdIn(List values) { - addCriterion("operator_id in", values, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotIn(List values) { - addCriterion("operator_id not in", values, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdBetween(Long value1, Long value2) { - addCriterion("operator_id between", value1, value2, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIdNotBetween(Long value1, Long value2) { - addCriterion("operator_id not between", value1, value2, "operatorId"); - return (Criteria) this; - } - - public Criteria andOperatorIsNull() { - addCriterion("operator is null"); - return (Criteria) this; - } - - public Criteria andOperatorIsNotNull() { - addCriterion("operator is not null"); - return (Criteria) this; - } - - public Criteria andOperatorEqualTo(String value) { - addCriterion("operator =", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotEqualTo(String value) { - addCriterion("operator <>", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorGreaterThan(String value) { - addCriterion("operator >", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorGreaterThanOrEqualTo(String value) { - addCriterion("operator >=", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLessThan(String value) { - addCriterion("operator <", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLessThanOrEqualTo(String value) { - addCriterion("operator <=", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorLike(String value) { - addCriterion("operator like", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotLike(String value) { - addCriterion("operator not like", value, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorIn(List values) { - addCriterion("operator in", values, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotIn(List values) { - addCriterion("operator not in", values, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorBetween(String value1, String value2) { - addCriterion("operator between", value1, value2, "operator"); - return (Criteria) this; - } - - public Criteria andOperatorNotBetween(String value1, String value2) { - addCriterion("operator not between", value1, value2, "operator"); - return (Criteria) this; - } - - public Criteria andReasonIsNull() { - addCriterion("reason is null"); - return (Criteria) this; - } - - public Criteria andReasonIsNotNull() { - addCriterion("reason is not null"); - return (Criteria) this; - } - - public Criteria andReasonEqualTo(String value) { - addCriterion("reason =", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonNotEqualTo(String value) { - addCriterion("reason <>", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonGreaterThan(String value) { - addCriterion("reason >", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonGreaterThanOrEqualTo(String value) { - addCriterion("reason >=", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonLessThan(String value) { - addCriterion("reason <", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonLessThanOrEqualTo(String value) { - addCriterion("reason <=", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonLike(String value) { - addCriterion("reason like", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonNotLike(String value) { - addCriterion("reason not like", value, "reason"); - return (Criteria) this; - } - - public Criteria andReasonIn(List values) { - addCriterion("reason in", values, "reason"); - return (Criteria) this; - } - - public Criteria andReasonNotIn(List values) { - addCriterion("reason not in", values, "reason"); - return (Criteria) this; - } - - public Criteria andReasonBetween(String value1, String value2) { - addCriterion("reason between", value1, value2, "reason"); - return (Criteria) this; - } - - public Criteria andReasonNotBetween(String value1, String value2) { - addCriterion("reason not between", value1, value2, "reason"); - return (Criteria) this; - } - - public Criteria andMuteTimeIsNull() { - addCriterion("mute_time is null"); - return (Criteria) this; - } - - public Criteria andMuteTimeIsNotNull() { - addCriterion("mute_time is not null"); - return (Criteria) this; - } - - public Criteria andMuteTimeEqualTo(Integer value) { - addCriterion("mute_time =", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeNotEqualTo(Integer value) { - addCriterion("mute_time <>", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeGreaterThan(Integer value) { - addCriterion("mute_time >", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeGreaterThanOrEqualTo(Integer value) { - addCriterion("mute_time >=", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeLessThan(Integer value) { - addCriterion("mute_time <", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeLessThanOrEqualTo(Integer value) { - addCriterion("mute_time <=", value, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeIn(List values) { - addCriterion("mute_time in", values, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeNotIn(List values) { - addCriterion("mute_time not in", values, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeBetween(Integer value1, Integer value2) { - addCriterion("mute_time between", value1, value2, "muteTime"); - return (Criteria) this; - } - - public Criteria andMuteTimeNotBetween(Integer value1, Integer value2) { - addCriterion("mute_time not between", value1, value2, "muteTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/message/FamilyMessage.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/message/FamilyMessage.java deleted file mode 100644 index 51e77f27d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/message/FamilyMessage.java +++ /dev/null @@ -1,574 +0,0 @@ -package com.accompany.business.vo.message; - -public class FamilyMessage { - - /** - * 退出家族通知族長 {時間} {用戶昵稱} - */ - public static final MessageLayout QUIT_FAMILY_NOTIFY_LEADER = new MessageLayout(). - titleContent("退出家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("已退出家族").contentsFontColor("#FF6565").contentsFontSize(28 / 2); - - /** - * 退出家族通知用戶 {時間} {用戶昵稱} {家族名稱} - */ - public static final MessageLayout QUIT_FAMILY_NOTIFY_USER = new MessageLayout(). - titleContent("退出家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("您已退出家族:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族幣將不可使用,重新加入可還原家族幣").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 踢出家族通知其他成員 {時間} {用戶昵稱} {族長昵稱} - */ - public static final MessageLayout CLICK_OUT_FAMILY_NOTIFY_LEADER = new MessageLayout(). - titleContent("移出家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("已被移出家族").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 踢出家族通知用戶 {時間} {用戶昵稱} {家族昵稱} {族長昵稱} - */ - public static final MessageLayout CLICK_OUT_FAMILY_NOTIFY_USER = new MessageLayout(). - titleContent("移出家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("您已被移出家族:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族幣將不可使用,重新加入家族可還原家族幣").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - - /** - * 創建家族 族長家族幣獎勵通知 {時間} {獎勵金額-帶小數點} {家族幣} {訂單編號} {獎勵方式} {獎勵時間} - */ - public static final MessageLayout FAMILY_MONEY_REWARD_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族幣獎勵通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("獎勵金額:+").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("獎勵方式:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("創建家族獎勵").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 家族幣轉讓通知族長 {時間} {轉讓金額-帶小數點} {接受者用戶名} {訂單編號} {轉讓時間} - */ - public static final MessageLayout FAMILY_TRANSFER_MONEY_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族幣轉讓通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("轉讓金額:-").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("接收人:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 家族幣轉讓通知成員 {時間} {轉讓金額-帶小數點} {轉讓方式} {訂單編號} {轉讓時間} - */ - public static final MessageLayout FAMILY_TRANSFER_MONEY_NOTIFY_MEMBER = new MessageLayout(). - titleContent("家族幣轉讓通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("轉讓金額:+").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("轉讓方式:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("感謝您對家族的付出").contentsFontColor("#333333").contentsFontSize(24 / 2); - - - /** - * 家族幣貢獻通知 族長 {時間} {貢獻金額-帶小數點} {貢獻者} {訂單編號} {轉讓時間} - */ - public static final MessageLayout FAMILY_CONTRIBUTE_MONEY_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族幣貢獻通知").titleFontColor("#333333").titleFontSzie(15).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("貢獻金額:+").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("貢獻者:").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(14); - - /** - * 家族幣貢獻通知 {時間} {貢獻金額-帶小數點} {訂單編號} {轉讓時間} - */ - public static final MessageLayout FAMILY_CONTRIBUTE_MONEY_NOTIFY_MEMBER = new MessageLayout(). - titleContent("家族幣貢獻通知").titleFontColor("#333333").titleFontSzie(15).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("貢獻金額:-").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(14) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(14) - .contengBr() - .contentsNextContent("感謝您對家族的貢獻").contentsFontColor("#333333").contentsFontSize(14); - - - /** - * 解散家族通知 族長 - */ - public static final MessageLayout FAMILY_DISS_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族解散通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("家族解散申請已經通過。所有家族成員將被移出家族且退出群聊").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 家族解散通知 成員 {時間} {族長昵稱} {家族名稱} - */ - public static final MessageLayout FAMILY_DISS_NOTIFY_MEMBER = new MessageLayout(). - titleContent("家族解散通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("操作人:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族已解散,家族幣清空").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 解散家族群通知 群主 {時間} {群聊名稱} - */ - public static final MessageLayout FAMILY_GROUP_DISS_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族群解散通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("群聊已解散,所有群成員已被移出群聊").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 同意加入家族通知 {時間} {用戶昵稱} - */ - public static final MessageLayout JOIN_FAMILY_SUCCESS_FOR_LEADER = new MessageLayout(). - titleContent("加入家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("%s已通過申請,成功加入家族").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 同意加入家族通知 用戶 {時間} {家族名稱} {驗證信息} {家族族長} - */ - public static final MessageLayout JOIN_FAMILY_SUCCESS = new MessageLayout(). - titleContent("加入家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已通過申請,成功加入家族").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 拒絕加入家族通知 用戶 {時間} {家族名稱} {驗證信息} {家族族長} - */ - public static final MessageLayout JOIN_FAMILY_FAILD = new MessageLayout(). - titleContent("加入家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你的申請被拒絕").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 同意家族邀請通知 族長 {時間} {邀請的用戶昵稱} - */ - public static final MessageLayout FAMILY_AGREE_REPONSE_INVITE_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族邀請通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你邀請的%s接受了你的邀請並加入家族").contentsFontColor("#999999").contentsFontSize(24 / 2); - - /** - * 同意家族邀請通知 用戶 {時間} {家族名稱} - */ - public static final MessageLayout FAMILY_AGREE_REPONSE_INVITE_NOTIFY_MEMBER = new MessageLayout(). - titleContent("家族邀請通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已接受邀請並成功加入家族").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2); - /** - * 拒絕家族邀請通知 族長 {時間} {邀請的用戶昵稱} {家族名稱} - */ - public static final MessageLayout FAMILY_REJECT_REPONSE_INVITE_NOTIFY_LEADER = new MessageLayout(). - titleContent("家族邀請通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你邀請的%s拒絕了你的家族邀請").contentsFontColor("#FF6565").contentsFontSize(28 / 2); - - - /** - * 加入群聊並加入家族通知 通知成員 {時間} {家族名稱} {群聊名稱} {家族族長} - */ - - public static final MessageLayout FAMILY_AGREE_FAMILY_WITH_GROUP = new MessageLayout(). - titleContent("加入家族並加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已通過申請加入家族並加入群聊").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 加入家族 加入群聊失敗 {時間} {家族名稱} {群聊名稱} {族長} - */ - public static final MessageLayout FAMILY_AGREE_FAMILY_WITH_GROUP_FAILD = new MessageLayout(). - titleContent("加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已通過申請但入群失敗").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 加入家族失敗導致群聊失敗 {時間} {家族名稱} {群聊名稱} {族長} - */ - public static final MessageLayout FAMILY_REJCT_FAMILY_WITH_GROUP_FAILD = new MessageLayout(). - titleContent("加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你未通過申請無法加入群聊").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 加入群聊通知 成員 {時間} {群聊名稱} {族長昵稱} - */ - public static final MessageLayout FAMILY_AGREE_GROUOP_APPLICATION = new MessageLayout(). - titleContent("加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已通過申請並加入群聊").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 加入家族並加入群聊通知 族長 {時間} {用戶} {家族名稱} {群聊名稱} - */ - public static final MessageLayout FAMILY_GROUOP_AGREE_FOR_LEADER = new MessageLayout(). - titleContent("加入家族並加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("已成功加入家族並加入群聊").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2); - - /** - * 加入群聊通知 族長 {時間} {用戶} {群聊名稱} - */ - public static final MessageLayout GROUOP_AGREE_FOR_LEADER = new MessageLayout(). - titleContent("加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("已成功加入群聊").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2); - - /** - * 加入 群聊失敗 通知 成員 {時間} {家族名稱} {群聊名稱} {族長昵稱} - */ - public static final MessageLayout FAMILY_REJECT_GROUOP_APPLICATION = new MessageLayout(). - titleContent("加入群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你未通過群聊申請").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 退出群通知 族長 {時間} {家族名稱} {群聊名稱} - */ - public static final MessageLayout a1 = new MessageLayout(). - titleContent("退出群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("已退出群:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2); - - /** - * 退出群通知 成員 {時間} {家族名稱} {群聊名稱} - */ - public static final MessageLayout LEAVE_CHAT = new MessageLayout(). - titleContent("退出群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("已退出群:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2); - - /** - * 踢出群聊通知 成員 {時間} {用戶昵稱} {群聊名稱} {群主昵稱} - */ - public static final MessageLayout KICKOUT_CHAT = new MessageLayout(). - titleContent("移出群聊通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("已被移出群聊:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 創建家族 通知族長 {時間} - */ - public static final MessageLayout CREATE_FAMILY = new MessageLayout(). - titleContent("創建家族通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("家族創建申請已通過。點擊前往查看>>").contentsFontColor("#999999").contentsFontSize(28 / 2); - - /** - * 加入家族申請 通知族長 {時間} {申請人昵稱} {驗證信息} {成員被踢信息} - */ - public static final MessageLayout APPLY_JOIN_FAMILY_TO_LEADER = new MessageLayout(). - titleContent("加入家族申請").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("申請加入家族").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("%s").contentsFontColor("#FF6565").contentsFontSize(28 / 2); - - /** - * 加入家族群申請 通知族長 {時間} {申請人昵稱} {群名稱} {驗證信息} - */ - public static final MessageLayout APPLY_JOIN_GROUP = new MessageLayout(). - titleContent("加入家族群申請").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("用戶名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("申請加入家族群:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr(); - - - /** - * 家族邀請通知 通知 {時間} {邀請人昵稱} {家族名稱} - */ - public static final MessageLayout FAMILY_INVITE_NOTIFY = new MessageLayout(). - titleContent("家族邀請通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你的好友%s邀請你加入家族 ").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2); - - /** - * 設為管理員通知 {時間} {家族名稱} {群聊名稱} {操作者} - */ - public static final MessageLayout SET_ADMIN = new MessageLayout(). - titleContent("群通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已被設置為管理員").contentsFontColor("#67CD44").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - - /** - * 取消管理員通知 {時間} {家族名稱} {群聊名稱} {操作者} - */ - public static final MessageLayout CANCEL_ADMIN = new MessageLayout(). - titleContent("群通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你已被取消群管理員").contentsFontColor("#FF6565").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱: ").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("操作者:%s").contentsFontColor("#67CD44").contentsFontSize(28 / 2); - - /** - * 族長家族幣獎勵通知 {時間} {獎勵金額-帶小數點} {家族幣名稱} {訂單編號} {獎勵時間} - */ - public static final MessageLayout SYSTEM_FAMILY_MONEY_REWARD = new MessageLayout(). - titleContent("家族幣獎勵通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("獎勵金額:+").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("獎勵方式:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("系統獎勵").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 族長家族幣扣除通知 {時間} {獎勵金額-帶小數點} {家族幣名稱} {訂單編號} {獎勵時間} - */ - public static final MessageLayout SYSTEM_FAMILY_MONEY_DEDUCT = new MessageLayout(). - titleContent("家族幣扣除通知").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("扣除金額:-").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%.2f").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("訂單編號:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%d").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("扣除方式:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("系統扣除").contentsFontColor("#333333").contentsFontSize(24 / 2) - .contengBr() - .contentsNextContent("到賬時間:").contentsFontColor("#999999").contentsFontSize(24 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(24 / 2); - - /** - * 申請過期提醒 通知用戶 {時間} {} {驗證信息} {成員被踢信息} - */ - public static final MessageLayout FAMILY_APPLY_EXPIRED_NOTIFY = new MessageLayout(). - titleContent("申請過期提醒").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你的申請未處理,已經過期").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("申請時間:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("家族名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("請重新申請加入家族").contentsFontColor("#999999").contentsFontSize(28 / 2); - - /** - * 申請過期提醒 通知用戶 {時間} {} {驗證信息} {成員被踢信息} - */ - public static final MessageLayout GROUP_APPLY_EXPIRED_NOTIFY = new MessageLayout(). - titleContent("申請過期提醒").titleFontColor("#333333").titleFontSzie(30 / 2).titleFontBold(true) - .timeContent("%s").timeFontSize(24 / 2).timeFontColor("#999999") - .contentsNextContent("你的申請未處理,已經過期").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("申請時間:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("群聊名稱:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("驗證信息:").contentsFontColor("#999999").contentsFontSize(28 / 2) - .contentsNextContent("%s").contentsFontColor("#333333").contentsFontSize(28 / 2) - .contengBr() - .contentsNextContent("請重新申請加入群聊").contentsFontColor("#999999").contentsFontSize(28 / 2); - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteAdminMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteAdminMapper.java deleted file mode 100644 index fa6ab4360..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteAdminMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.UserMuteAdmin; -import com.accompany.business.model.UserMuteAdminExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface UserMuteAdminMapper { - int countByExample(UserMuteAdminExample example); - - int deleteByPrimaryKey(Integer id); - - int insert(UserMuteAdmin record); - - int insertSelective(UserMuteAdmin record); - - List selectByExample(UserMuteAdminExample example); - - UserMuteAdmin selectByPrimaryKey(Integer id); - - int updateByExampleSelective(@Param("record") UserMuteAdmin record, @Param("example") UserMuteAdminExample example); - - int updateByExample(@Param("record") UserMuteAdmin record, @Param("example") UserMuteAdminExample example); - - int updateByPrimaryKeySelective(UserMuteAdmin record); - - int updateByPrimaryKey(UserMuteAdmin record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapper.java deleted file mode 100644 index 2a73c2965..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.UserMuteRecord; -import com.accompany.business.model.UserMuteRecordExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface UserMuteRecordMapper { - int countByExample(UserMuteRecordExample example); - - int deleteByPrimaryKey(Integer id); - - int insert(UserMuteRecord record); - - int insertSelective(UserMuteRecord record); - - List selectByExample(UserMuteRecordExample example); - - UserMuteRecord selectByPrimaryKey(Integer id); - - int updateByExampleSelective(@Param("record") UserMuteRecord record, @Param("example") UserMuteRecordExample example); - - int updateByExample(@Param("record") UserMuteRecord record, @Param("example") UserMuteRecordExample example); - - int updateByPrimaryKeySelective(UserMuteRecord record); - - int updateByPrimaryKey(UserMuteRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapperExpand.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapperExpand.java deleted file mode 100644 index d815b969d..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserMuteRecordMapperExpand.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.UserMuteRecord; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -public interface UserMuteRecordMapperExpand { - - /** - * 统计有效记录的数量 - * @param uid - * @param roomId - * @param date - * @return - */ - int countEnabledRecord(@Param("uid") Long uid, @Param("roomId") Long roomId, @Param("date") Date date); - - /** - * 查询有效记录列表 - * @param uid - * @param roomId - * @param date - * @return - */ - List queryEnabledRecord(@Param("uid") Long uid, @Param("roomId") Long roomId, @Param("date") Date date); - - /** - * 将有效记录设置为无效记录 - * @param uid - * @param roomId - * @param date - * @return - */ - int disableEnabledRecord(@Param("uid") Long uid, @Param("roomId") Long roomId, @Param("date") Date date); - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java index b7ee3ded4..aa3591bb7 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java @@ -5,28 +5,22 @@ import com.accompany.business.model.AppVersionExample; import com.accompany.business.mybatismapper.AppVersionMapper; import com.accompany.business.vo.AppVersionVo; import com.accompany.business.vo.ComponentContrlVo; -import com.accompany.business.vo.EditVersionVo; -import com.accompany.business.vo.UploadFileInfoVo; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.BusinessException; import com.accompany.common.redis.RedisKey; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.AppVersionUtil; import com.accompany.common.utils.BlankUtil; import com.accompany.common.utils.GsonUtil; +import com.accompany.core.exception.ServiceException; import com.accompany.core.service.SysConfService; import com.accompany.core.service.base.BaseService; import com.accompany.core.util.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeanUtils; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.Date; import java.util.List; import java.util.Objects; import java.util.function.Predicate; @@ -34,11 +28,10 @@ import java.util.function.Predicate; /** * Created by liuguofu on 2017/7/10. */ +@Slf4j @Service public class AppVersionService extends BaseService { - private static final Logger logger = LoggerFactory.getLogger(AppVersionService.class); - @Autowired private AppVersionMapper appVersionMapper; @Autowired @@ -168,7 +161,7 @@ public class AppVersionService extends BaseService { AppVersion newestVersion = getNewestAppVersion(appVersion.getOs(),appVersion.getPlatform()); if (newestVersion == null) { logger.error("Not found newestVersion. The version: " + appVersion.getVersion() + ", os: " + appVersion.getOs()); - throw new BusinessException("Not found newestVersion."); + throw new ServiceException("Not found newestVersion."); } // 将最新的版本及描述加入Vo @@ -261,11 +254,6 @@ public class AppVersionService extends BaseService { jedisService.hwrite(RedisKey.app_version.getKey(), key, GsonUtil.getGson().toJson(appVersion)); } - private void deleteAppVersionCache(String version, String os, String channel) { - String key = getAppVersionKey(version, os, channel); - jedisService.hdel(RedisKey.app_version.getKey(), key); - } - private void batchSaveAppVersion(List appVersionList) { if (CollectionUtils.isEmpty(appVersionList)) { return; @@ -369,136 +357,4 @@ public class AppVersionService extends BaseService { return toVo(newestVersion); } - - @Transactional(rollbackFor = Exception.class) - public int batchSave(EditVersionVo versionVo, String operator) { - int result = 0; - List fileInfoVoList = versionVo.getFileInfoList(); - if(versionVo.getVersionId()==null){ - // 新增 根据平台可能多个 - String[] platformList = versionVo.getPlatform().split(","); - for(String platform : platformList){ - AppVersion saveAppVersion = new AppVersion(); - BeanUtils.copyProperties(versionVo,saveAppVersion); - saveAppVersion.setPlatform(platform); - saveAppVersion.setCreateTime(new Date()); - convertProperties(saveAppVersion,fileInfoVoList); - result += saveAppVersion(saveAppVersion, operator); - } - - }else{ - if (fileInfoVoList.size()>1){ - throw new BusinessException("只能上传一个文件"); - } - AppVersion appVersion = versionVo.getAppVersion(); - convertProperties(appVersion,fileInfoVoList); - result += saveAppVersion(appVersion, operator); - String key = this.getAppVersionKey(versionVo.getVersion(), versionVo.getOs(), versionVo.getPlatform()); - jedisService.hdel(RedisKey.app_version.getKey(), key); - } - return result; - } - - /** - * 替换相关属性 - * @param appVersion - * @param fileInfoVoList - */ - private void convertProperties(AppVersion appVersion,List fileInfoVoList){ - if(StringUtils.isBlank(appVersion.getPlatform())){ - return; - } - appVersion.setDownloadLink(null); - appVersion.setFileMd5(null); - for(UploadFileInfoVo infoVo : fileInfoVoList){ - if(infoVo.isSuccess()){ - String[] infoArray = infoVo.getPath().split("-"); - // 获取最后一个 - String lastFlag = infoArray[infoArray.length-1]; - // 去掉文件扩展名 - String platform = lastFlag.split("\\.")[0]; - if(appVersion.getPlatform().equals(platform)){ - appVersion.setDownloadLink(infoVo.getPath()); - appVersion.setFileMd5(infoVo.getMd5()); - break; - } - } - } - } - - private int saveAppVersion(AppVersion entity, String operator) { - int result = 0; - if(Constant.AppVersion.audit.equals(entity.getStatus())) { - if(checkHasAudit(entity.getVersionId(),entity.getPlatform())) { - throw new BusinessException("已存在审核状态中的版本记录.请修改后再试"); - } - } - // 如果之前版本是审核中版本,则去除当前审核版本 - AppVersion beforeVersion = this.appVersionMapper.selectByPrimaryKey(entity.getVersionId()); - if(beforeVersion != null && Constant.AppVersion.audit.equals(beforeVersion.getStatus())) { - //sysConfService.setConfValueById(this.getAuditingVersionKey(entity.getPlatform()), "", operator); - } - AppVersion appVersion = this.queryAppVersionBy(entity.getVersion(),entity.getOs(),entity.getPlatform()); - if((entity.getVersionId()==null && appVersion!=null) - || (entity.getVersionId()!=null && appVersion!=null && !appVersion.getVersionId().equals(entity.getVersionId()))){ - throw new BusinessException("已存在版本:"+entity.getOs()+"+"+entity.getVersion()+"+"+entity.getPlatform()); - - } - if(entity.getVersionId()==null){ - result += appVersionMapper.insert(entity); - }else{ - entity.setCreateTime(beforeVersion.getCreateTime()); - result += appVersionMapper.updateByPrimaryKeyWithBLOBs(entity); - } - - // 更新配置中的审核版本 - if(Constant.AppVersion.audit.equals(entity.getStatus())) { - //sysConfService.setConfValueById(this.getAuditingVersionKey(entity.getPlatform()), entity.getVersion(), operator); - } - return result; - } - - /** - * 统计是否有审核状态中的记录 - * @return - */ - private boolean checkHasAudit(Integer id,String platform) { - if(id == null) { - int count = countByStatus(Constant.AppVersion.audit, platform); - if (count > 0) { - return true; - } - } else { - AppVersion auditingVersion = getVersionByStatus(Constant.AppVersion.audit, platform); - // 判断审核版本的记录是否跟当前id一致 - if(auditingVersion != null && !id.equals(auditingVersion.getVersionId())) { - return true; - } - } - return false; - } - - /** - * 通过状态统计版本记录 - * @param status - * @return - */ - public int countByStatus(byte status, String platform) - { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andStatusEqualTo(status).andPlatformEqualTo(platform); - return appVersionMapper.countByExample(example); - } - - /** - * 根据状态获取版本 - * @param status - * @return - */ - public AppVersion getVersionByStatus(byte status, String platform) { - AppVersionExample example = new AppVersionExample(); - example.createCriteria().andStatusEqualTo(status).andPlatformEqualTo(platform); - List list = appVersionMapper.selectByExampleWithBLOBs(example); - return list.size()>0?list.get(0):null; - } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java index 07700ded7..f2668e35c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java @@ -16,8 +16,7 @@ import com.accompany.business.service.vip.VipMessageService; import com.accompany.business.util.VipUtil; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; -import com.accompany.common.exception.BusinessException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.UUIDUtil; @@ -161,11 +160,11 @@ public class ChargeService extends BaseService { log.error("applyCharge3() error,uid={},chargeProdId={},channel={},clientIp={},successUrl={},openId={}", uid, chargeProdId, channel, clientIp, successUrl, openId); log.error("applyCharge3() errorMsg={}", e.getMessage()); int status = BusiStatus.SERVERBUSY.value(); - if (e instanceof ApiException) { - ApiException exception = (ApiException) e; + if (e instanceof AdminServiceException) { + AdminServiceException exception = (AdminServiceException) e; status = exception.getResponseCode(); } - throw new ApiException(status, e.getMessage()); + throw new AdminServiceException(status, e.getMessage()); } finally { jedisLockService.unlock(RedisKey.lock_apply_charge.getKey(uid.toString()), lockVal); } @@ -206,12 +205,12 @@ public class ChargeService extends BaseService { Long uid = chargeRecord.getUid(); String chargeRecordId = chargeRecord.getChargeRecordId(); if (null == chargeRecordId) { - throw new BusinessException("支付訂單號異常"); + throw new ServiceException("支付訂單號異常"); } String chargeProdId = chargeRecord.getChargeProdId(); ChargeProd chargeProd = chargeProdService.getChargeProdById(chargeProdId); if (chargeProd == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "檔位不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "檔位不存在"); } int vipLevel = 1; String prodDesc = chargeProd.getProdDesc(); @@ -231,7 +230,7 @@ public class ChargeService extends BaseService { } UserVipRecord userVipRecord = userVipRecordService.getByChargeRecordId(chargeRecordId); if (null == userVipRecord) { - throw new BusinessException("支付訂單號異常"); + throw new ServiceException("支付訂單號異常"); } final Date expireTime = VipUtil.genVipExpireTime(new Date()); updateUserRecord(chargeRecord, userVipRecord, expireTime); @@ -294,7 +293,7 @@ public class ChargeService extends BaseService { int result = completedOrder(chargeRecord); if (result <= 0) { log.info("重複請求:chargeRecordId: " + chargeRecord.getChargeRecordId()); - throw new ApiException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); + throw new AdminServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); } // 更新用戶vip記錄 userVipRecord.setLastVipLevel(lastVipLevel); @@ -424,7 +423,7 @@ public class ChargeService extends BaseService { String chargeRecordId = chargeRecord.getChargeRecordId(); String tradeNo = chargeRecord.getPingxxChargeId(); if (chargeRecordId == null || tradeNo == null) { - throw new BusinessException("支付訂單號或商戶訂單號異常"); + throw new ServiceException("支付訂單號或商戶訂單號異常"); } Long chargeUid = chargeRecord.getUid(); int outTradeNum = getLastNumFromOrder(chargeRecordId); @@ -513,7 +512,7 @@ public class ChargeService extends BaseService { int result = completedOrder(chargeRecord); if (result <= 0) { log.info("重复请求:chargeRecordId: " + chargeRecord.getChargeRecordId()); - throw new ApiException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); + throw new AdminServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); } // 更新塔羅充值記錄 luckyTarotRecord.setDrawStatus(drawStatus); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/account/AccountBlockService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/account/AccountBlockService.java index 82ba98df3..9911497e8 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/account/AccountBlockService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/account/AccountBlockService.java @@ -3,13 +3,12 @@ package com.accompany.business.service.account; import com.accompany.business.service.AccountLoginRecordService; import com.accompany.business.service.room.RoomService; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.BusinessException; import com.accompany.common.redis.RedisKey; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.constant.BlockSourceEnum; import com.accompany.core.constant.BlockStatusEnum; import com.accompany.core.constant.BlockTypeEnum; -import com.accompany.core.exception.ServiceException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.AccountBlock; import com.accompany.core.model.AccountLoginRecord; import com.accompany.core.model.Users; @@ -148,13 +147,13 @@ public class AccountBlockService extends ServiceImpl>(){}.getType())); return result; @@ -165,7 +157,7 @@ public class ActivitiesDrawService { public Integer getTicketNum(ActivitiesTicketRuleEnum ruleType, ActivitiesDrawTypeEnum drawType){ String numStr = getRedisMapValue(drawType.name().toLowerCase(), ruleType.name().toLowerCase(), RedisKey.draw_ticket_rule.getKey()); if (StringUtils.isEmpty(numStr)){ - throw new ApiException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return Integer.valueOf(numStr); } @@ -179,7 +171,7 @@ public class ActivitiesDrawService { public Integer getUserNum(ActivitiesTicketRuleEnum ruleType, ActivitiesDrawTypeEnum drawType){ String numStr = getRedisMapValue(drawType.name().toLowerCase(), ruleType.name().toLowerCase(), RedisKey.draw_user_num_rule.getKey()); if (StringUtils.isEmpty(numStr)){ - throw new ApiException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return Integer.valueOf(numStr); } @@ -255,7 +247,7 @@ public class ActivitiesDrawService { }else if (typeEnum.equals(ActivitiesDrawTypeEnum.turntable2)){ poolType = PrizePoolItemTypeEnum.diamond_prize_pool.getValue(); }else{ - throw new ApiException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } List items = prizePgetListByPool(poolType); if (CollectionUtils.isEmpty(items)){ diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/ActivitiesLuckySeaServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/ActivitiesLuckySeaServiceImpl.java index ecaaf0e8b..03d7eeb7b 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/ActivitiesLuckySeaServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/ActivitiesLuckySeaServiceImpl.java @@ -96,7 +96,7 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } ActivityPack pack = activityPackService.getPackById(packId); @@ -108,7 +108,7 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService log.info("updateTicketNum, num = {}",pieceNum); } catch (InterruptedException e) { log.error("[春日游园]", e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (locked){ lock.unlock(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/LuckySeaDrawServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/LuckySeaDrawServiceImpl.java index c1493b91c..c1b1be144 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/LuckySeaDrawServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/luckySea/impl/LuckySeaDrawServiceImpl.java @@ -98,7 +98,7 @@ public class LuckySeaDrawServiceImpl implements LuckySeaDrawService { Long roomUid = userInOutRoomRecordService.getUserCurrentRoomUid(uid); if (!drawRecordService.updateUserDrawRecord(uid, roomUid, roundId, item, num)){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } billRecordService.insertGeneralBillRecord(uid, null, null, BillObjTypeEnum.ACTIVITY_LUCKY_SEA_DRAW, num.doubleValue()); @@ -107,7 +107,7 @@ public class LuckySeaDrawServiceImpl implements LuckySeaDrawService { applicationContext.publishEvent(new LuckySeaDrawMessageEvent(message)); } catch (InterruptedException e) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (StringUtils.isNoneBlank(roundId)){ RAtomicLong atomic = redissonClient.getAtomicLong(RedisKey.lucky_sea_curr_write_data_user_count.getKey(roundId)); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activity/ActivityPackService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activity/ActivityPackService.java index ea9571564..d3731d810 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activity/ActivityPackService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activity/ActivityPackService.java @@ -234,7 +234,7 @@ public class ActivityPackService implements InitializingBean, BeanSelfAware { try { boolean result = userPurseService.subDiamond(uid, totalPriceD, BillObjTypeEnum.ACTIVITY_PACKET.getDesc()); if (!result) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } userPurseService.sendSysMsgByModifyGold(userPurseService.queryUserPurse(uid)); //购买礼包记录 diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java index d5afa1626..86642eb63 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/anchor/impl/AnchorFansTeamAudioRecordServiceImpl.java @@ -99,7 +99,7 @@ public class AnchorFansTeamAudioRecordServiceImpl extends ServiceImpl= certificationCount) { - throw new ApiException("超过当日最大认证次数,请明天再试"); + throw new AdminServiceException("超过当日最大认证次数,请明天再试"); } verify(usersService.getUsersByUid(uid), phone, code, identityNumber); } @@ -160,21 +158,21 @@ public abstract class AbstractCertifyService { */ protected void verify(Users users, String phone, String code, String identityNumber) { if (users == null) { - throw new ApiException(BusiStatus.USERNOTEXISTS); + throw new AdminServiceException(BusiStatus.USERNOTEXISTS); } //验证码验证 boolean verify = smsService.verifySmsCode(phone, code); if (!verify) { - throw new ApiException(BusiStatus.SMSCODEERROR); + throw new AdminServiceException(BusiStatus.SMSCODEERROR); } //身份证绑定账号验证 String bindAccount = jedisService.hget(RedisKey.id_card_bind_user_count.getKey(), identityNumber); if (StrUtil.isNotEmpty(bindAccount) && Integer.parseInt(bindAccount) >= Constant.usersCertification.ID_CARD_BIND_USER_LIMIT) { - throw new ApiException(BusiStatus.ID_CARD_BIND_LIMIT); + throw new AdminServiceException(BusiStatus.ID_CARD_BIND_LIMIT); } // 2020-03-04 实名认证修改次数超过限制,实名认证后,用户有一次修改认证信息的机会 if (users.getCertifyModifyTimes() != null && users.getCertifyModifyTimes() >= 1) { - throw new ApiException(BusiStatus.MODIFY_BIND_TIMES_LIMITS); + throw new AdminServiceException(BusiStatus.MODIFY_BIND_TIMES_LIMITS); } } @@ -230,7 +228,7 @@ public abstract class AbstractCertifyService { example.createCriteria().andUidEqualTo(uid).andTokenEqualTo(token); List records = userCertifyRecordMapper.selectByExample(example); if (CollectionUtil.isEmpty(records)) { - throw new ApiException(BusiStatus.NOTEXISTS); + throw new AdminServiceException(BusiStatus.NOTEXISTS); } return records.get(0); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java index ac257c0b4..7dd13ab5b 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java @@ -10,7 +10,7 @@ import com.accompany.business.mybatismapper.withdraw.WithdrawUserAccountMapper; import com.accompany.business.service.certification.aliyun.FinancialFaceVerify; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.utils.DESUtils; import com.accompany.common.utils.DateTimeUtil; @@ -57,7 +57,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { log.info("username : {}, identityNumber : {}, phone : {}", username, identityNumber, phone); } catch (Exception e) { log.error("解密信息时出现异常", e); - throw new ApiException("解密異常"); + throw new AdminServiceException("解密異常"); } DeviceInfo deviceInfo = DeviceInfoContextHolder.get(); String deviceId = deviceInfo.getDeviceId(); @@ -68,7 +68,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { String ticket = record.getTicket(); InitFaceVerifyResponse.InitFaceVerifyResponseResultObject result = financialFaceVerify.initFaceVerify(ticket, username, identityNumber, returnUrl, metaInfo, phone, ipAddress, uid, certType, deviceId); if (result == null) { - throw new ApiException("认证失败"); + throw new AdminServiceException("认证失败"); } String certifyId = result.getCertifyId(); record.setToken(certifyId); @@ -84,7 +84,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { DescribeFaceVerifyResponse.DescribeFaceVerifyResponseResultObject responseResultObject = financialFaceVerify.describeFaceVerify(certifyId); if (responseResultObject == null) { log.error("callback responseResultObject is null, uid : {}, certifyId : {}, certType : {}, deviceId : {}", uid, certifyId, certType, deviceId); - throw new ApiException("认证失败"); + throw new AdminServiceException("认证失败"); } String passed = responseResultObject.getPassed(); updateCertifyResult(uid, certifyId, certType, passed.getBytes()[0], CERTIFY_RESULT_FOR_SUCCESS.equals(passed)); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java index 6eddd6daa..2490e9297 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java @@ -1,7 +1,7 @@ package com.accompany.business.service.certification.aliyun; import com.accompany.common.config.AliYunFinancialFaceConfig; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyun.cloudauth20190307.models.DescribeFaceVerifyRequest; @@ -49,7 +49,7 @@ public class FinancialFaceVerify { if (String.valueOf(HttpStatus.OK.value()).equals(response.getCode())) { return response.getResultObject(); } else { - throw new ApiException(Integer.parseInt(response.getCode()), response.getMessage()); + throw new AdminServiceException(Integer.parseInt(response.getCode()), response.getMessage()); } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java index b62cdadb1..07e0a2764 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java @@ -30,7 +30,7 @@ import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; @@ -187,7 +187,7 @@ public class FirstChargeRewardService extends BaseService { private LimitFirstChargeConfig getLimitFirstChargeRewardConfig() { String result = sysConfService.getSysConfValueById(Constant.SysConfId.LIMIT_FIRST_CHARGE_REWARD); if (StringUtils.isBlank(result)) { - throw new ApiException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } LimitFirstChargeConfig config = JSONObject.parseObject(result, LimitFirstChargeConfig.class); return config; @@ -196,7 +196,7 @@ public class FirstChargeRewardService extends BaseService { public FirstChargeRewardConfigVo getFirstChargeRewardConfig() { String result = sysConfService.getSysConfValueById(Constant.SysConfId.FIRST_CHARGE_REWARD); if (StringUtils.isBlank(result)) { - throw new ApiException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return JSONObject.parseObject(result, FirstChargeRewardConfigVo.class); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java index 6d410b0c7..dcd31d4ad 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/RedeemCodeService.java @@ -63,7 +63,7 @@ public class RedeemCodeService extends BaseService { try { // 加分布式锁,防止 if(StringUtils.isEmpty(lockVal)){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } redeemCode = redeemCodeMapper.selectByPrimaryKey(code); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/VipChargeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/VipChargeService.java index 51c79980f..28cda6503 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/VipChargeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/VipChargeService.java @@ -83,7 +83,7 @@ public class VipChargeService { } ChargeProd chargeProd = params.getChargeProd(); if (null == chargeProd) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } DeviceInfo deviceInfo = params.getDeviceInfo(); if (null == deviceInfo) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java index 2c7045fb7..1a3c7582e 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java @@ -3,19 +3,17 @@ package com.accompany.business.service.chat.impl; import com.accompany.business.dto.chat.PrivateChatNumberLimitConfig; import com.accompany.business.service.chat.PrivateChatService; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.UidContextHolder; import com.accompany.core.service.SysConfService; import com.accompany.core.service.common.JedisService; import com.accompany.sharding.mapper.UserChatMsgRecordMapper; -import com.accompany.sharding.model.UserChatMsgRecord; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.time.YearMonth; import java.util.Date; /** @@ -48,10 +46,10 @@ public class PrivateChatServiceImpl implements PrivateChatService { Date now = new Date(); Long fromUid = UidContextHolder.get(); if (fromUid == null) { - throw new ApiException("缺少用户ID"); + throw new AdminServiceException("缺少用户ID"); } if (jedisService.exits(RedisKey.user_private_chat.getKey(fromUid.toString()))) { - throw new ApiException("消息发送过于频繁,请稍后再试"); + throw new AdminServiceException("消息发送过于频繁,请稍后再试"); } String yearMonth = DateTimeUtil.convertDate(new Date(), DateTimeUtil.DATE_FORMAT_YEAR_MONTH); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/ClanManageService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/ClanManageService.java index 0452b5375..3dae8a6dc 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/ClanManageService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/ClanManageService.java @@ -103,7 +103,7 @@ public class ClanManageService extends BaseService { try { lock.tryLock(3, TimeUnit.SECONDS); if (!lock.isLocked()){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Users users = usersService.getUsersByUid(uid); if (users == null) { @@ -147,7 +147,7 @@ public class ClanManageService extends BaseService { } } catch (InterruptedException e) { logger.error("apply clan join failed,uid={},clanId={},e={}", uid, clanId, e); - throw new ServiceException(BusiStatus.SERVER_BUSY.getReasonPhrase(), e); + throw new ServiceException(BusiStatus.SERVERBUSY.getReasonPhrase(), e); } finally { if (lock.isLocked()){ lock.unlock(); @@ -170,7 +170,7 @@ public class ClanManageService extends BaseService { try { lock.tryLock(3, TimeUnit.SECONDS); if (!lock.isLocked()){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } ClanHallOperateRecord record = clanHallOperateRecordMapper.selectByPrimaryKey(recordId); @@ -232,7 +232,7 @@ public class ClanManageService extends BaseService { } } catch (InterruptedException e) { logger.error("dealApplyClanRecord failed,recordId={},e={}", recordId, e); - throw new ServiceException(BusiStatus.SERVER_BUSY.getReasonPhrase(), e); + throw new ServiceException(BusiStatus.SERVERBUSY.getReasonPhrase(), e); } finally { if (lock.isLocked()){ lock.unlock(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/impl/ClanServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/impl/ClanServiceImpl.java index 11601d3d9..ee8c87850 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/impl/ClanServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/clan/impl/ClanServiceImpl.java @@ -232,7 +232,7 @@ public class ClanServiceImpl extends ServiceImpl implements Cl try { cdl.await(5, TimeUnit.SECONDS); } catch (InterruptedException e) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return vo; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java index b55ec032d..6a3ae94b9 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java @@ -19,7 +19,7 @@ import com.accompany.business.service.world.WorldService; import com.accompany.business.util.VipUtil; import com.accompany.business.vo.RoomVo; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.*; @@ -196,7 +196,7 @@ public class DynamicService extends CommunityBaseService { Dynamic dynamic = getDynamic(shareVo.getDynamicId()); validDynamic(dynamic); if (!shareVo.getWorldId().equals(dynamic.getWorldId()) || !shareVo.getUid().equals(dynamic.getUid())){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } DynamicShare share = BeanMapper.map(shareVo, DynamicShare.class); share.setCreateTime(new Date()); @@ -240,7 +240,7 @@ public class DynamicService extends CommunityBaseService { String lockVal = null; LikeStatusEnum statusEnum = LikeStatusEnum.getEnumByValue(likeVo.getStatus()); if (statusEnum == null){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } //动态状态校验 Dynamic dynamic = getDynamic(likeVo.getDynamicId()); @@ -250,7 +250,7 @@ public class DynamicService extends CommunityBaseService { lockVal = jedisLockService.lock(lockKey, 10 * 1000); if (BlankUtil.isBlank(lockVal)){ logger.error("request too fast, uid = {}", likeVo.getUid()); - throw new ApiException(BusiStatus.REQUEST_FAST); + throw new AdminServiceException(BusiStatus.REQUEST_FAST); } DynamicLike likeOld = iDynamicLikeService.getUniqueRecord(likeVo.getDynamicId(), likeVo.getUid()); //如果没有点赞记录,第一条必须是点赞 @@ -268,12 +268,12 @@ public class DynamicService extends CommunityBaseService { like.setUpdateTime(new Date()); return iDynamicLikeService.insertLike(like); } else { - throw new ApiException(BusiStatus.ACT_WISH_NOEXIST); + throw new AdminServiceException(BusiStatus.ACT_WISH_NOEXIST); } } //判断是否重复点赞/取消 if (likeVo.getStatus().equals(likeOld.getStatus())) { - throw new ApiException(BusiStatus.ACTION_REPEAT); + throw new AdminServiceException(BusiStatus.ACTION_REPEAT); } likeOld.setStatus(likeVo.getStatus()); likeOld.setUpdateTime(new Date()); @@ -311,18 +311,18 @@ public class DynamicService extends CommunityBaseService { public int deleteDynamic(DynamicQuery dynamicVo){ Dynamic dynamic = getDynamic(dynamicVo.getDynamicId()); if (dynamic == null || dynamic.getStatus().equals(DynamicStatusEnum.DELETE.getValue()) || dynamic.getStatus().equals(DynamicStatusEnum.UNSHELVE)){ - throw new ApiException(BusiStatus.DYNAMIC_NOT_EXIST); + throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_EXIST); } World world = worldService.getByIdFromCache(dynamic.getWorldId()); if ((world == null || !dynamicVo.getUid().equals(world.getOwnerUid())) && !dynamic.getUid().equals(dynamicVo.getUid())){ - throw new ApiException(BusiStatus.DYNAMIC_NOT_SELF_ACTION); + throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_SELF_ACTION); } String lockKey = RedisKey.lock_community_dynamic_delete.getKey(dynamicVo.getUid().toString()); String lock = null; try { lock = jedisLockService.lock(lockKey, 10 * 1000); if(StringUtils.isBlank(lock)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } dynamic.setStatus(DynamicStatusEnum.DELETE.getValue()); dynamic.setUpdateTime(new Date()); @@ -368,7 +368,7 @@ public class DynamicService extends CommunityBaseService { */ public List getMyDynamic(GetMyDynamicReq request){ if (request.getUid() == null || request.getUid() == 0){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } Users users = usersService.getUsersByUid(request.getUid()); @@ -456,7 +456,7 @@ public class DynamicService extends CommunityBaseService { String lockVal = jedisLockService.lock(lockKey, 1000, 10000); try { if(StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 话题校验,排除特殊的话题 if (null != req.getWorldId() && req.getWorldId() != Constant.Dynamic.WORLD_ID_DYNAMIC_SQUARE) { @@ -536,7 +536,7 @@ public class DynamicService extends CommunityBaseService { Set typeSet = Sets.newHashSet(ConvertUtil.toIntArray(req.getTypes())); try { if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 获取热门动态id,热门动态不要频繁从 redis 中获取了,本地缓存下 Set hotDynamicSet = getHotDynamicIdsByWorldId(req.getWorldId()); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicSquareService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicSquareService.java index 8f8250062..54bfc5904 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicSquareService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicSquareService.java @@ -159,7 +159,7 @@ public class DynamicSquareService extends CommunityBaseService { String userReadRecommendKey = RedisKey.dynamic_recommend_list_user_read.getKey(String.valueOf(uid)); try { if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 获取热门动态id,热门动态不要频繁从 redis 中获取了,本地缓存下 List recommendDynamicList = getHotDynamicIdsByWorldId(Constant.Dynamic.WORLD_ID_ALL); @@ -696,7 +696,7 @@ public class DynamicSquareService extends CommunityBaseService { String lockVal = jedisLockService.lock(lockKey); if (StringUtils.isEmpty(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java index 13c33dbc6..4a605319f 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java @@ -4,7 +4,7 @@ import com.accompany.business.model.UserExpand; import com.accompany.business.service.dfa.DfaService; import com.accompany.business.service.user.UserExpandService; import com.accompany.business.service.user.UsersService; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; import com.accompany.community.condition.InteractiveMsgCondition; @@ -61,7 +61,7 @@ public class InteractiveService extends CommunityBaseService { InteractiveMsg interactiveMsg = new InteractiveMsg(); Dynamic dynamic = getDynamic(dynamicId); if (dynamic == null){ - throw new ApiException(BusiStatus.DYNAMIC_NOT_EXIST); + throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_EXIST); } interactiveMsg.setDynamicId(dynamicId); interactiveMsg.setActionType(actionType); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserChatBubbleBizService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserChatBubbleBizService.java index 639c8d68b..41c2fcd3a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserChatBubbleBizService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserChatBubbleBizService.java @@ -86,7 +86,7 @@ public class UserChatBubbleBizService { if (null == bubbleId) { // 取消装扮 if (usingBubble == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "聊天气泡装扮不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "聊天气泡装扮不存在"); } usingBubble.setUsed(Constant.UserInfoCardUsed.NOT_USING); userChatBubbleService.updateById(usingBubble); @@ -96,11 +96,11 @@ public class UserChatBubbleBizService { // 装扮气泡 ChatBubble chatBubble = chatBubbleService.getById(bubbleId); if (chatBubble == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "聊天气泡装扮不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "聊天气泡装扮不存在"); } UserChatBubble userChatBubble = userChatBubbleService.getByBubbleIdAndUid(uid, bubbleId); if (null == userChatBubble) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "聊天气泡装扮不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "聊天气泡装扮不存在"); } Date now = new Date(); if (now.compareTo(userChatBubble.getExpireTime()) >= 0) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserHeadwearService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserHeadwearService.java index 5a9b09e29..de3a2cd05 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserHeadwearService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/dress/UserHeadwearService.java @@ -44,7 +44,7 @@ public class UserHeadwearService extends BaseService { try { lockVal = jedisLockService.lock(RedisKey.buy_headwear_lock.getKey(uid.toString()), 10 * 1000, 12 * 1000); if (BlankUtil.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if(null == addDay){ throw new ServiceException(BusiStatus.PARAMETERILLEGAL,"购买天数为空"); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/GoldExchangeDiamondService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/GoldExchangeDiamondService.java index aa577fd30..c52d003db 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/GoldExchangeDiamondService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/GoldExchangeDiamondService.java @@ -117,14 +117,14 @@ public class GoldExchangeDiamondService { String configStr = sysConfService.getSysConfValueById(Constant.SysConfId.GOLD_EXCHANGE_DIAMOND_CONFIG); if (!StringUtils.hasText(configStr)){ log.error("[金币兑换钻石] 没有兑换比率配置 {}", Constant.SysConfId.GOLD_EXCHANGE_DIAMOND_CONFIG); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { return objectMapper.readValue(configStr, GoldExchangeDiamondConfigDto.class); } catch (IOException e) { log.error("[金币兑换钻石] 获取兑换比率异常 {}", Constant.SysConfId.GOLD_EXCHANGE_DIAMOND_CONFIG, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } @@ -163,7 +163,7 @@ public class GoldExchangeDiamondService { throw new ServiceException(BusiStatus.GOLD_EXCHANGE_DIAMOND_NOT_ENOUGH_GOLD); } log.error("[金币兑换钻石] {} 当前钱包金币数 {} ,兑换钻石时扣金币 {} 加钻石 {} 不成功", uid, currentGoldNum, goldD, diamondD); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } HallMember hallMember = hallService.getHallMember(uid); @@ -209,7 +209,7 @@ public class GoldExchangeDiamondService { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[金币兑换钻石] {} 获取 {} 锁超时", uid, RedisKey.clan_gold_exchange_record_lock.getKey()); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } count = clanGoldExchangeService.count(queryWrapper); if (count < 1){ @@ -219,7 +219,7 @@ public class GoldExchangeDiamondService { } } catch (InterruptedException e) { log.error("[金币兑换钻石] {} 获取 {} 锁失败", uid, RedisKey.clan_gold_exchange_record_lock.getKey()); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/WithdrawService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/WithdrawService.java index d0529df44..1b2a0e47c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/WithdrawService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/exchange/WithdrawService.java @@ -138,7 +138,7 @@ public class WithdrawService { throw new ServiceException(BusiStatus.WITHDRAW_NOT_ENOUGH_GOLD); } log.error("[金币提现] {} 当前钱包金币数 {} ,扣金币数 {} 不成功", uid, currentGolds, goldNum); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Double actualGolds = BigDecimal.valueOf(goldNum).multiply(BigDecimal.valueOf(1d - config.getFee())).doubleValue(); @@ -178,7 +178,7 @@ public class WithdrawService { String configStr = sysConfService.getSysConfValueById(Constant.SysConfId.WITHDRAWAL_CONFIG); if (!StringUtils.hasText(configStr)){ log.error("[金币提现] 配置为空 {}", Constant.SysConfId.WITHDRAWAL_CONFIG); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } WithdrawConfigDto config = null; try { @@ -191,10 +191,10 @@ public class WithdrawService { } catch (IOException e) { log.error("[金币提现] 获取配置异常 {}", Constant.SysConfId.WITHDRAWAL_CONFIG); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } catch (ParseException e) { log.error("[金币提现] 解析cron表达式异常 {}", config.getCron(), e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return config; } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/findlove/FindLovePoolService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/findlove/FindLovePoolService.java index 180e54265..b91cd7c4b 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/findlove/FindLovePoolService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/findlove/FindLovePoolService.java @@ -136,7 +136,7 @@ public class FindLovePoolService implements InitializingBean { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } poolSize = pool.size(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/flow/FlowTeamSettlementBizService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/flow/FlowTeamSettlementBizService.java index 8daa98bdc..528c6a8f0 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/flow/FlowTeamSettlementBizService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/flow/FlowTeamSettlementBizService.java @@ -147,7 +147,7 @@ public class FlowTeamSettlementBizService { String cacheKey = RedisKey.flow_team_settlement_init_lock.getKey(teamId); String lockKey = jedisLockService.lock(cacheKey, 3000, 10 * 1000); if (StringUtils.isBlank(lockKey)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { List flowTeamSettlementInfos = flowTeamSettlementInfoMapper.listFlowTeamSettlementInfo(teamId, true, null); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/follow/FansService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/follow/FansService.java index a9ae72af7..df8b71e28 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/follow/FansService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/follow/FansService.java @@ -144,7 +144,7 @@ public class FansService extends ServiceImpl { String lock = this.jedisLockService.lock(RedisKey.lock_like_fans.getKey(likedUid.toString()), ApplicationConstant.DEFAULT_LOCK_WAIT_MILLIS); try { if (StringUtils.isEmpty(lock)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if (type.equals(LIKE)) { likeSomeBody(likeUid, likedUid); @@ -867,7 +867,7 @@ public class FansService extends ServiceImpl { String followNumStr = jedisService.hget(RedisKey.user_follow_limit_count.getKey(date), uid.toString()); Integer currCount = com.accompany.common.utils.StringUtils.isBlank(followNumStr) ? 0 : Integer.parseInt(followNumStr); if (currCount >= limitFollowNum) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "今日关注数已达上限,可升级等级解锁哟!"); + throw new ServiceException(BusiStatus.SERVERBUSY, "今日关注数已达上限,可升级等级解锁哟!"); } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java index a9157ef09..e9c004ad9 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java @@ -30,7 +30,7 @@ import com.accompany.business.vo.luckybag.LuckyBagGiftVo; import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; @@ -50,7 +50,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -527,10 +526,10 @@ public class GiftSendService extends BaseService { Map usersMap = usersService.getUsersMapBatch(uidsArray); // 校验用户是否都存在或者收礼用户是否重复 if (!flag && usersMap.size() != recvUids.length + 1) { - throw new ApiException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); } if (flag && usersMap.size() != recvUids.length) { - throw new ApiException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); } Room room = null; @@ -549,7 +548,7 @@ public class GiftSendService extends BaseService { if ((gift.getGiftType() != null && gift.getGiftType() == Constant.GiftType.CARDS) || gift.getConsumeType() == Constant.GiftConsumeType.RADISH_GIFT) { - throw new ApiException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); + throw new AdminServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); } // 校验贵族礼物(只有面板送礼才需要校验) @@ -613,10 +612,10 @@ public class GiftSendService extends BaseService { Map usersMap = usersService.getUsersMapBatch(uidsArray); // 校验用户是否都存在或者收礼用户是否重复 if (!flag && usersMap.size() != recvUids.length + 1) { - throw new ApiException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); } if (flag && usersMap.size() != recvUids.length) { - throw new ApiException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); } Room room = null; @@ -635,7 +634,7 @@ public class GiftSendService extends BaseService { if ((gift.getGiftType() != null && gift.getGiftType() == Constant.GiftType.CARDS) || gift.getConsumeType() == Constant.GiftConsumeType.RADISH_GIFT) { - throw new ApiException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); + throw new AdminServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); } // 校验贵族礼物(只有面板送礼才需要校验) diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/SuperLuckyGiftSendService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/SuperLuckyGiftSendService.java index 3062025f2..3e68982f4 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/SuperLuckyGiftSendService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/SuperLuckyGiftSendService.java @@ -104,7 +104,7 @@ public class SuperLuckyGiftSendService { try { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } rewardList = rewardService.listRewardByRangeId(rangeConfig.getId()); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallGroupChatService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallGroupChatService.java index e373e6d0a..1a5aed726 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallGroupChatService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallGroupChatService.java @@ -94,7 +94,7 @@ public class HallGroupChatService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_create_hall_group.getKey(uid + "_" + hallId)); if (StringUtils.isEmpty(lockVal)) { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } String[] members = StringUtils.isNotBlank(memberUids) ? memberUids.split(",") : new String[0]; @@ -896,7 +896,7 @@ public class HallGroupChatService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_group_join.getKey(uid.toString())); if (StringUtils.isEmpty(lockVal)) { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } HallGroupChat groupChat = this.getGroupChat(chatId); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallManageService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallManageService.java index bae7cc70f..b6b1bd974 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallManageService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/hall/HallManageService.java @@ -327,7 +327,7 @@ public class HallManageService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_apply_join.getKey(uid.toString())); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Users users = usersService.getUsersByUid(uid); if (users == null) { @@ -559,7 +559,7 @@ public class HallManageService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_invite.getKey(recordId.toString())); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } HallOperateRecord record = hallOperateRecordMapper.selectByPrimaryKey(recordId); if (record == null || !record.getType().equals(Constant.HallOperateType.INVITE_USER) || !record.getTargetUid().equals(uid)) { @@ -655,7 +655,7 @@ public class HallManageService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_apply.getKey(recordId.toString())); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } HallOperateRecord record = hallOperateRecordMapper.selectByPrimaryKey(recordId); if (record == null || !record.getType().equals(Constant.HallOperateType.APPLY_HALL)) { @@ -784,7 +784,7 @@ public class HallManageService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_quit.getKey(recordId.toString())); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } HallOperateRecord record = hallOperateRecordMapper.selectByPrimaryKey(recordId); if (record == null || !record.getType().equals(Constant.HallOperateType.QUIT_HALL)) { @@ -1295,7 +1295,7 @@ public class HallManageService extends BaseService { try { lockVal = this.jedisLockService.lock(RedisKey.lock_hall_apply.getKey(uid.toString())); if (StringUtils.isBlank(lockVal)) { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } Map map = this.checkCode(uid, code); BusiStatus status = (BusiStatus) map.get("busiStatus"); @@ -1329,7 +1329,7 @@ public class HallManageService extends BaseService { } finally { this.jedisLockService.unlock(RedisKey.lock_hall_apply.getKey(uid.toString()), lockVal); } - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/HomeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/HomeService.java index d7cd1c679..c3816724c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/HomeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/home/HomeService.java @@ -1237,7 +1237,7 @@ public class HomeService extends BaseService { } return null; } catch (IOException e) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } @@ -1264,7 +1264,7 @@ public class HomeService extends BaseService { if (pickUidOp.isPresent()) { return pickUidOp.get(); } - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } /** diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/luckybag/LuckyBagLinearPoolService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/luckybag/LuckyBagLinearPoolService.java index 27836c677..3d1dea399 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/luckybag/LuckyBagLinearPoolService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/luckybag/LuckyBagLinearPoolService.java @@ -149,7 +149,7 @@ public class LuckyBagLinearPoolService extends ServiceImpl vipNameplateIds = vipCustomNameplateService.getVipNameplateIds(uid); if (CollectionUtils.isEmpty(vipNameplateIds) || !vipNameplateIds.contains(nameplateId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "當前用戶的貴族等級不足,無法申請該等級銘牌"); + throw new ServiceException(BusiStatus.SERVERBUSY, "當前用戶的貴族等級不足,無法申請該等級銘牌"); } // 铭牌生成 @@ -719,7 +719,7 @@ public class UserNameplateService extends BaseService { isCustomWord = true; } catch (Exception e) { log.error("生成用户对应贵族铭牌图片异常, 用户id:{}, 异常铭牌id:{} ", uid, nameplate.getId(), e); - throw new ServiceException(BusiStatus.SERVER_BUSY, "生成用戶對應貴族銘牌圖片異常"); + throw new ServiceException(BusiStatus.SERVERBUSY, "生成用戶對應貴族銘牌圖片異常"); } } @@ -785,7 +785,7 @@ public class UserNameplateService extends BaseService { try { lockVal = jedisLockService.lock(RedisKey.buy_nameplate_lock.getKey(uid.toString()), 10 * 1000, 12 * 1000); if (BlankUtil.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if (null == addDay) { throw new ServiceException(BusiStatus.PARAMETERILLEGAL, "購買天數為空"); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/payment/GooglePlayBillingService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/payment/GooglePlayBillingService.java index ff1d8c34b..935cacdc6 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/payment/GooglePlayBillingService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/payment/GooglePlayBillingService.java @@ -49,7 +49,7 @@ public class GooglePlayBillingService { isLocked = lock.tryLock(5L, TimeUnit.SECONDS); if (!isLocked){ log.error("[google play billing]加锁失败。chargeRecordId: {}", chargeRecordId); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } ChargeRecord chargeRecord = chargeRecordService.getChargeRecordById(chargeRecordId); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarService.java index b273e10d6..d0419e377 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarService.java @@ -201,7 +201,7 @@ public class PromiseStarService { try { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // double check lastestRoundId diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarStickService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarStickService.java index 98f90fa68..e4f93876a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarStickService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/promiseStar/PromiseStarStickService.java @@ -41,7 +41,7 @@ public class PromiseStarStickService { double stickTotalPrice = stickPrice * num; if (!userPurseService.subDiamond(uid, stickTotalPrice, BillObjTypeEnum.ACTIVITY_PACKET.getDesc())){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } billRecordService.insertGeneralBillRecord(uid, null, null, BillObjTypeEnum.ACTIVITY_PACKET, stickTotalPrice); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/DiamondGiveHistoryService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/DiamondGiveHistoryService.java index ed23d170a..6505d82ff 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/DiamondGiveHistoryService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/DiamondGiveHistoryService.java @@ -100,7 +100,7 @@ public class DiamondGiveHistoryService extends ServiceImpl getRecordVos(Long uid, Integer pageNum, Integer pageSize) { if (uid == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Date date = DateTimeUtil.addMonth(new Date(), -3); PageHelper.startPage(pageNum, pageSize); @@ -210,7 +210,7 @@ public class DiamondGiveHistoryService extends ServiceImpl giveRecordVoByType(Long uid, Long toUid, Integer pageNum, Integer pageSize, Byte type) { if (uid == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Date date = DateTimeUtil.addMonth(new Date(), -3); PageHelper.startPage(pageNum, pageSize); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/UserPurseService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/UserPurseService.java index c341f94d2..751d9691c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/UserPurseService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/purse/UserPurseService.java @@ -335,13 +335,13 @@ public class UserPurseService extends ServiceImpl { isLocked = lock.tryLock(3, TimeUnit.SECONDS); if (!isLocked){ log.error("[用户钱包] {} 获取 {} 锁超时", uid, lockKey); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } UserPurse userPurse = getById(uid); return function.apply(userPurse); } catch (InterruptedException e) { log.error("[用户钱包] {} 获取 {} 锁异常", uid, lockKey, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { if (isLocked){ lock.unlock(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/record/ExchangeDiamondGoldRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/record/ExchangeDiamondGoldRecordService.java index ac97749ae..cea79e31c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/record/ExchangeDiamondGoldRecordService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/record/ExchangeDiamondGoldRecordService.java @@ -81,7 +81,7 @@ public class ExchangeDiamondGoldRecordService { try { lockVal = jedisLockService.lock(RedisKey.lock_user_gold.getKey(uid.toString()), 10 * 1000); if (BlankUtil.isBlank(lockVal)) { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } UserPurse userPurse = userPurseService.queryUserPurse(uid); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java index f0fb81ccd..5a5ea91a4 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java @@ -21,7 +21,7 @@ import com.accompany.business.vo.redenvelope.RedEnvelopeResponseVo; import com.accompany.business.vo.redenvelope.RedEnvelopeVo; import com.accompany.business.vo.redenvelope.SendRedEnvelopeRequest; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.UidContextHolder; import com.accompany.core.model.Room; @@ -258,7 +258,7 @@ public class RedEnvelopeService extends ServiceImpl validRedEnvelopes = getValidRedEnvelopes(roomUid); if (CollectionUtil.isNotEmpty(validRedEnvelopes)) { - throw new ApiException(BusiStatus.RED_ENVELOPE_ROOM_EXIST); + throw new AdminServiceException(BusiStatus.RED_ENVELOPE_ROOM_EXIST); } //生效类型 int validityType = request.getValidityType(); @@ -308,10 +308,10 @@ public class RedEnvelopeService extends ServiceImpl 10) { - throw new ApiException("紅包標題長度不能超過10"); + throw new AdminServiceException("紅包標題長度不能超過10"); } if (YidunCheckUtil.checkHasSensitiveWord(message)) { - throw new ApiException("當前內容不符合規範,請修改后重試哦~"); + throw new AdminServiceException("當前內容不符合規範,請修改后重試哦~"); } Users users = usersService.getUsersByUid(uid); String payPassWord = users.getPaymentPwd(); if (payPassWord == null) { - throw new ApiException("請設置支付密碼"); + throw new AdminServiceException("請設置支付密碼"); } if (!usersService.checkPaymentPwd(password, payPassWord)) { - throw new ApiException(BusiStatus.USER_INCORRECT_PAYMENT_PASS.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.USER_INCORRECT_PAYMENT_PASS.getReasonPhrase()); } int minAmount = type.equals(RedEnvelopeTypeConstant.IN_ROOM) ? 10 : 100; if (amount % minAmount > 0) { - throw new ApiException("紅包鉆石數量必須為" + minAmount + "的倍數"); + throw new AdminServiceException("紅包鉆石數量必須為" + minAmount + "的倍數"); } if (!roomRedEnvelopeService.hasRedEnvelope(roomUid, uid, type)) { - throw new ApiException("對應權限不足,請更新版本"); + throw new AdminServiceException("對應權限不足,請更新版本"); } Double redEnvelopeAmount = redEnvelopeAmount(amount); if (DoubleUtil.sub(num * 1.0, redEnvelopeAmount) > 0) { - throw new ApiException("單個紅包金額過小"); + throw new AdminServiceException("單個紅包金額過小"); } UserPurse userPurse = userPurseService.queryUserPurse(uid); Double currentDiamonds = userPurse.getDiamonds(); if (currentDiamonds < amount) { - throw new ApiException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } } doSend(context); @@ -170,23 +169,23 @@ public abstract class IRedEnvelopeStrategy { try { RedEnvelopStateEnum state = redEnvelopeService.stateById(redEnvelopeId); if (state == RedEnvelopStateEnum.TIME_OUT) { - throw new ApiException("紅包已超時"); + throw new AdminServiceException("紅包已超時"); } if (state == RedEnvelopStateEnum.REMAIN_ZERO) { - throw new ApiException("紅包已經搶完了"); + throw new AdminServiceException("紅包已經搶完了"); } if (state == RedEnvelopStateEnum.WILL) { - throw new ApiException("紅包還沒開始"); + throw new AdminServiceException("紅包還沒開始"); } if (state != RedEnvelopStateEnum.ING) { - throw new ApiException("此紅包不在進行時"); + throw new AdminServiceException("此紅包不在進行時"); } beforeOpen(context); doOpen(context); SpringContextHolder.getApplicationContext().publishEvent(new RedEnvelopeEvent(redEnvelopeId)); } catch (Exception e) { log.error(e.getMessage(), e); - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } finally { jedisLockService.unlock(lockKey, lockVal); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java index 447f0bf49..14d6e7354 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java @@ -1,7 +1,6 @@ package com.accompany.business.service.redenvelope.strategy; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; import com.accompany.business.constant.redenvelope.OuterRedEnvelopeTypeEnum; import com.accompany.business.constant.redenvelope.RedEnvelopPositionEnum; import com.accompany.business.dto.redenvelope.RedEnvelopeConfig; @@ -14,7 +13,7 @@ import com.accompany.business.model.redenvelope.RedEnvelope; import com.accompany.business.service.follow.FansService; import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; import com.accompany.core.enumeration.BillObjTypeEnum; @@ -65,10 +64,10 @@ public abstract class InRoomRedEnvelopeStrategy extends IRedEnvelopeStrategy { double currentDiamonds = userPurse.getDiamonds(); if (currentDiamonds < amount) { log.error("[发放红包] " + uid + " 钱包钻石数 " + currentDiamonds + " 少于发放需要扣钻石数 " + amount); - throw new ApiException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } log.error("[发放红包] " + uid + " 当前钱包钻石数 " + currentDiamonds + " ,扣钻石数 " + amount + " 不成功"); - throw new ApiException(BusiStatus.SERVER_BUSY); + throw new AdminServiceException(BusiStatus.SERVERBUSY); } } RedEnvelopeDTO redEnvelope = buildRedEnvelope(context); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java index 71c654ebc..795669a43 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java @@ -3,7 +3,7 @@ package com.accompany.business.service.redenvelope.strategy; import com.accompany.business.model.UserShareRecordExample; import com.accompany.business.model.redenvelope.RedEnvelope; import com.accompany.business.mybatismapper.UserShareRecordMapper; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.base.SpringContextHolder; public class ShareRedEnvelopeStrategy extends InRoomRedEnvelopeStrategy { @@ -31,7 +31,7 @@ public class ShareRedEnvelopeStrategy extends InRoomRedEnvelopeStrategy { @Override public void beforeOpen(RedEnvelopeContext context) { if (!isFinish(context)) { - throw new ApiException("未參與活動,無法搶該紅包"); + throw new AdminServiceException("未參與活動,無法搶該紅包"); } } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomFreeGiftService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomFreeGiftService.java index 5060650b2..f6cab8fdb 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomFreeGiftService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomFreeGiftService.java @@ -278,7 +278,7 @@ public class RoomFreeGiftService implements InitializingBean, ApplicationListene return objectMapper.readValue(configStr, RoomFreeGiftConfigDto.class); } catch (IOException e) { log.error("[房间免费礼物] 序列化配置异常 {}", configStr); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomPKService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomPKService.java index be2e8731d..664573f05 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomPKService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomPKService.java @@ -75,7 +75,7 @@ public class RoomPKService extends BaseService { @Transactional(rollbackFor = Exception.class) public RoomRet updateRoomPkInfo(Long roomUid, Long operUid, Boolean isOpenPk) throws Exception{ if(!roomQueueLimiter.tryAcquire(1, TimeUnit.SECONDS)){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } RoomNotifyVo roomNotifyVo = new RoomNotifyVo(); Integer secord = Constant.DefineProtocol.CUSTOM_MESS_SUB_ROOM_PK_MODE_CLOSE; @@ -368,7 +368,7 @@ public class RoomPKService extends BaseService { try { lockVal = jedisLockService.lock(RedisKey.lock_finish_pk.getKey(pkId),5000); if(StringUtils.isEmpty(lockVal)){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } RoomPK roomPk = roomPkMapper.selectById(pkId); if (roomPk == null) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomQueueMicroService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomQueueMicroService.java index bd22d196a..5c92fd185 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomQueueMicroService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomQueueMicroService.java @@ -62,7 +62,7 @@ public class RoomQueueMicroService extends BaseService { public RoomRet updateMircoInfo(Long roomUid,Long operUid,Boolean isOpenQueueMirco) throws Exception{ if(!roomQueueLimiter.tryAcquire(1,TimeUnit.SECONDS)){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } RoomNotifyVo roomNotifyVo = new RoomNotifyVo(); Integer secord = Constant.DefineProtocol.CUSTOM_MESS_SUB_QUEUE_MICRO_MODE_CLOSE; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java index a60194bdd..bb9d8ceb1 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java @@ -163,7 +163,7 @@ public class RoomSearchService extends BaseService { String lockKey = RedisKey.search_text_lock.getKey(searchTextKey); String lockVal = this.jedisLockService.lock(lockKey, 3000, 2000); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { @@ -369,7 +369,7 @@ public class RoomSearchService extends BaseService { } String lockVal = jedisLockService.lock(lockKey); if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java index 5ab4c8a53..6f96fb4f9 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java @@ -30,7 +30,6 @@ import com.accompany.business.service.ErBanNetEaseService; import com.accompany.business.service.RobotV2Service; import com.accompany.business.service.SendSysMsgService; import com.accompany.business.service.administrator.SuperAdminWebService; -import com.accompany.business.service.api.QinniuService; import com.accompany.business.service.dfa.DfaService; import com.accompany.business.service.follow.FansRoomService; import com.accompany.business.service.follow.FansService; @@ -41,7 +40,6 @@ import com.accompany.business.service.miniGame.MiniGameRoomService; import com.accompany.business.service.miniGame.MiniGameService; import com.accompany.business.service.miniGame.MiniGameSwitchRecordService; import com.accompany.business.service.redenvelope.RedEnvelopeServerNotifySwitchService; -import com.accompany.business.service.redenvelope.RedEnvelopeService; import com.accompany.business.service.redenvelope.RoomRedEnvelopeService; import com.accompany.business.service.user.UsersService; import com.accompany.business.service.world.WorldRoomService; @@ -60,7 +58,7 @@ import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.constant.UserRoomIdentityEnum; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.model.GamePlayer; import com.accompany.common.netease.neteaseacc.NetEaseBaseClient; import com.accompany.common.netease.util.NetEaseConstant; @@ -421,10 +419,10 @@ public class RoomService extends BaseService { if (Constant.RoomModeType.OPEN_BLIND_DATE_MODE.equals(room.getRoomModeType())) { String os = deviceInfo.getOs(); if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, "20.20.7") < 0) { - throw new ApiException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, "2.5.0") < 0) { - throw new ApiException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } } //个播版本检查 @@ -2231,7 +2229,7 @@ public class RoomService extends BaseService { public BusiResult invite(Long roomUid, String uids) { String lockval = this.jedisLockService.lock(RedisKey.room_invite_lock.getKey(roomUid.toString()), 1000); if (StringUtils.isEmpty(lockval)) { - throw new ApiException(BusiStatus.REQUEST_FAST); + throw new AdminServiceException(BusiStatus.REQUEST_FAST); } try { BusiResult result = new BusiResult(BusiStatus.SUCCESS); @@ -2303,7 +2301,7 @@ public class RoomService extends BaseService { public boolean addMatchPool(Long uid, Long roomId, String gameId) { String lockval = this.jedisLockService.lock(RedisKey.add_match_pool_room.getKey(uid.toString() + gameId), 1000); if (StringUtils.isEmpty(lockval)) { - throw new ApiException(BusiStatus.REQUEST_FAST); + throw new AdminServiceException(BusiStatus.REQUEST_FAST); } try { /* GamePlayer player = getPlayerByUid(uid); @@ -2333,7 +2331,7 @@ public class RoomService extends BaseService { public boolean addIsomerismMatchPool(Long uid, Long roomId) { String lockval = this.jedisLockService.lock(RedisKey.add_isomerism_match_pool_room.getKey(uid.toString()), 1000); if (StringUtils.isEmpty(lockval)) { - throw new ApiException(BusiStatus.REQUEST_FAST); + throw new AdminServiceException(BusiStatus.REQUEST_FAST); } try { GamePlayer player = getPlayerByUid(uid); @@ -3173,7 +3171,7 @@ public class RoomService extends BaseService { String lockKey = RedisKey.mini_game_switch_lock.getKey(String.valueOf(room.getUid())); String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVER_BUSY); + if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); Integer micNum; try { if (ObjectUtil.isNull(roomDb)) { @@ -3369,10 +3367,10 @@ public class RoomService extends BaseService { String os = deviceInfo.getOs(); if (jedisService.hexists(RedisKey.corss_room_round_pking.getKey(), String.valueOf(room.getUid()))) { if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, "20.20.7") < 0) { - throw new ApiException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, "2.5.0") < 0) { - throw new ApiException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/BlindDateMaxGiftValueServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/BlindDateMaxGiftValueServiceImpl.java index d89253bae..66ac2c0c0 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/BlindDateMaxGiftValueServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/BlindDateMaxGiftValueServiceImpl.java @@ -75,7 +75,7 @@ public class BlindDateMaxGiftValueServiceImpl implements BlindDateMaxGiftValueSe try { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } long roomId = roomDTO.getRoomId(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java index 58fd89d2c..c16620666 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java @@ -28,7 +28,7 @@ import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.netease.neteaseacc.result.RoomRet; import com.accompany.common.netease.neteaseacc.result.RubbishRet; import com.accompany.common.redis.RedisKey; @@ -134,7 +134,7 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl crossRoomPkRecords = crossRoomPkRecordService.queryByRoundId(roundId); Optional invitePkOpt = crossRoomPkRecords.stream().filter(pkRecord -> Constant.CrossRoomPKType.invite.equals(pkRecord.getType())).findFirst(); @@ -1325,7 +1325,7 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl pkUidList.forEach(uidStr -> pipeline.hdel(RedisKey.corss_room_round_pking.getKey(), uidStr)))); } catch (Exception e) { log.error("结束pk出现异常", e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } @@ -1381,7 +1381,7 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl pkRecordList = crossRoomPkRecordService.queryByRoundId(roundId); if (CollectionUtils.isEmpty(pkRecordList)) return panelDto; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/QueueServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/QueueServiceImpl.java index a000c6e45..b44e12f0e 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/QueueServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/QueueServiceImpl.java @@ -39,7 +39,7 @@ public class QueueServiceImpl implements QueueService { try { locked = lock.tryLock(3, TimeUnit.SECONDS); if (!locked) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } List queueList = queryRoomService.queueList(dto.getRoomid()).getDesc().listDTO(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java index f28df8270..84c169a63 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/skillcard/impl/SkillCardUserRecordServiceImpl.java @@ -312,7 +312,7 @@ public class SkillCardUserRecordServiceImpl extends ServiceImpl 客户端携带了记录id过来 期望: 新增记录 @@ -749,7 +749,7 @@ public class SkillCardUserRecordServiceImpl extends ServiceImpl getByRewardIds(List rewardIdList) { if (CollectionUtil.isEmpty(rewardIdList)) { - throw new ApiException("奖池为空"); + throw new AdminServiceException("奖池为空"); } return lambdaQuery().in(SeizeTreasureReward::getId, rewardIdList).list(); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java index 3c957450f..1b4eeaa08 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java @@ -2,12 +2,10 @@ package com.accompany.business.service.treasure; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; -import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.accompany.business.constant.activities.ActivitesPackTypeEnum; import com.accompany.business.enums.UserActPropertyObjType; import com.accompany.business.enums.resource.ResourceCodeEnum; -import com.accompany.business.enums.resource.RuleCodeEnum; import com.accompany.business.model.resource.Resource; import com.accompany.business.model.treasure.*; import com.accompany.business.model.user.UserActPropertyInfoRecord; @@ -28,8 +26,7 @@ import com.accompany.business.service.user.UserActPropertyInfoRecordService; import com.accompany.business.vo.treasure.SeizeTreasureSalvageConfig; import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageRecordVo; import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageReq; -import com.accompany.common.exception.ApiException; -import com.accompany.core.base.UidContextHolder; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.service.message.MessageRobotPushService; import com.accompany.business.service.room.RoomService; import com.accompany.business.service.user.UserActPropertyInfoV2Service; @@ -75,7 +72,6 @@ import com.accompany.core.service.common.JedisLockService; import com.accompany.core.service.common.JedisService; import com.accompany.core.vo.UserLevelVo; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import lombok.extern.slf4j.Slf4j; @@ -1397,7 +1393,7 @@ public class SeizeTreasureService { @Transactional(rollbackFor = Exception.class) public List elfSalvage(Long uid, SeizeTreasureElfSalvageReq salvageReq) { if (!checkAuthority()) { - throw new ApiException(BusiStatus.NOT_ENOUGH_LEVEL); + throw new AdminServiceException(BusiStatus.NOT_ENOUGH_LEVEL); } log.info("SeizeTreasureService elfSalvage uid : {}, salvageReq : {}", uid, salvageReq); List expendList = salvageReq.getExpendList(); @@ -1414,14 +1410,14 @@ public class SeizeTreasureService { .in(SeizeTreasureProp::getId, elfIdMap.keySet()).list(); //参数中的道具信息有不存在的相关道具信息 if (propList.size() != elfIdMap.keySet().size()) { - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } //扣除道具 propList.forEach(prop -> { Long propId = prop.getId(); Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, propId, elfIdMap.get(propId).getElfNum()); if (!reduceSuccess) { - throw new ApiException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH.value(), prop.getName() + "數量不足"); + throw new AdminServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH.value(), prop.getName() + "數量不足"); } }); log.info("SeizeTreasureService elfSalvage reduceUserProp uid : {}, propList : {} success", uid, propList); @@ -1436,7 +1432,7 @@ public class SeizeTreasureService { rateMap.put(PropLevel.L3, Arrays.asList(400, 500)); } if (CollectionUtil.isEmpty(rateMap)) { - throw new ApiException("缺少分解率"); + throw new AdminServiceException("缺少分解率"); } List records = new ArrayList<>(); //分解 diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java index e9bef488c..f82ab180a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java @@ -12,7 +12,7 @@ import com.accompany.business.service.treasure.SeizeTreasureShardService; import com.accompany.business.service.user.UserActPropertyInfoV2Service; import com.accompany.business.vo.treasure.SeizeTreasureSwitchConfig; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.enumeration.BillObjTypeEnum; import com.accompany.core.exception.ServiceException; @@ -61,7 +61,7 @@ public class SeizeTreasureShardServiceImpl implements SeizeTreasureShardService UserPurse userPurse = userPurseService.queryUserPurse(uid); double currentDiamonds = userPurse.getDiamonds(); if (Double.compare(currentDiamonds, diamondNum) < 0) { - throw new ApiException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } //扣减钱包 if (!userPurseService.subDiamond(uid, (double) diamondNum, BillObjTypeEnum.ACTIVITY_SEIZE_TREASURE_PACK.getDesc())) { @@ -69,10 +69,10 @@ public class SeizeTreasureShardServiceImpl implements SeizeTreasureShardService currentDiamonds = userPurse.getDiamonds(); if (Double.compare(currentDiamonds, diamondNum) < 0) { log.error("[购买精灵碎片] {} 钱包钻石数 {} 少于需要扣钻石数 {}", uid, currentDiamonds, diamondNum); - throw new ApiException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } log.error("[购买精灵碎片] {} 当前钱包钻石数 {},扣钻石数 {} 不成功", uid, currentDiamonds, diamondNum); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } //增加道具 Long recordId = userActPropertyInfoV2Service.updateUserPiece(uid, (long) num, ActivitesPackTypeEnum.SEIZE_TREASURE_TICKET.getValue(), UserActPropertyObjType.SEIZE_TREASURE_TICKET); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java index 2c41d5508..96d073581 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserBackpackService.java @@ -330,7 +330,7 @@ public class UserBackpackService extends BaseService { this.jedisService.hset(RedisKey.user_backpacket.getKey(uid.toString()), giftId.toString(), this.gson.toJson(userBackpack)); } catch (ServiceException e) { // 出现错误时,清除缓存,解决缓存不一致问题 - if (BusiStatus.SERVER_BUSY.equals(e.getBusiStatus())){ + if (BusiStatus.SERVERBUSY.equals(e.getBusiStatus())){ this.jedisService.del(RedisKey.user_backpacket.getKey(String.valueOf(uid))); } throw e; @@ -377,7 +377,7 @@ public class UserBackpackService extends BaseService { userBackpackMapper.updateByPrimaryKey(userBackpack); } catch (ServiceException e) { // 出现错误时,清除缓存,解决缓存不一致问题 - if (BusiStatus.SERVER_BUSY.equals(e.getBusiStatus())){ + if (BusiStatus.SERVERBUSY.equals(e.getBusiStatus())){ this.jedisService.del(RedisKey.user_backpacket.getKey(String.valueOf(uid))); } throw e; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteAdminService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteAdminService.java deleted file mode 100644 index b20dc69e5..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteAdminService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.service.user; - -import com.accompany.business.model.UserMuteAdmin; -import com.accompany.business.model.UserMuteAdminExample; -import com.accompany.business.mybatismapper.UserMuteAdminMapper; -import com.accompany.core.service.base.BaseService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-05-08 11:56 - */ -@Service("userMuteAdminService2") -public class UserMuteAdminService extends BaseService { - - @Autowired - private UserMuteAdminMapper userMuteAdminMapper; - - private byte enabled = 1; - private byte disabled = 2; - - /** - * 查询有效的记录 - * @param uid - * @param roomId - * @return - */ - public List queryEnableRecord(long uid, long roomId) { - UserMuteAdminExample example = new UserMuteAdminExample(); - UserMuteAdminExample.Criteria criteria = example.createCriteria(); - criteria.andUidEqualTo(uid).andRoomIdEqualTo(roomId).andStatusEqualTo(enabled); - return userMuteAdminMapper.selectByExample(example); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteRecordService.java deleted file mode 100644 index 5903d4c82..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserMuteRecordService.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.accompany.business.service.user; - -import com.accompany.business.model.UserMuteAdmin; -import com.accompany.business.model.UserMuteRecord; -import com.accompany.business.mybatismapper.UserMuteRecordMapper; -import com.accompany.business.mybatismapper.UserMuteRecordMapperExpand; -import com.accompany.business.service.ErBanNetEaseService; -import com.accompany.common.exception.BusinessException; -import com.accompany.common.netease.neteaseacc.result.RubbishRet; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.base.BaseService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; - -/** - * {这里添加描述} - * - * @author fangchengyan - * @date 2019-05-08 19:13 - */ -@Service -public class UserMuteRecordService extends BaseService { - - @Autowired - private UserMuteRecordMapperExpand userMuteRecordMapperExpand; - @Autowired - private UserMuteRecordMapper userMuteRecordMapper; - @Autowired - private UserMuteAdminService userMuteAdminService; - @Autowired - private ErBanNetEaseService erBanNetEaseService; - @Autowired - private UsersService usersService; - @Autowired - private SysConfService sysConfService; - - public UserMuteRecordService() { - } - - /** - * 添加一条用户禁言记录 - * @param operatorId:当前用户uid,必须为房间的管理员或创建者 - * @param roomId:房间id,不传为公聊大厅roomId - * @param targetUid:被禁言的用户id - * @param muteTime:禁言时间,0:解除禁言;>0设置禁言的秒数,不能超过2592000秒(30天) - * @param reason:禁言原因,10个字内 - * @return - */ - public int add(Long operatorId, Long roomId, Long targetUid, int muteTime, String reason) throws Exception { - if(null == roomId) { - throw new BusinessException("公聊大厅未配置,请选配置!"); - } - Users users = usersService.getUsersByUid(targetUid); - if(null == users) { - logger.warn("禁言失败,用户{}不存在!", targetUid); - throw new BusinessException("失败,该用户不存在!"); - } - List list = userMuteAdminService.queryEnableRecord(operatorId, roomId); - if(null == list || list.isEmpty()) { - String msg = String.format("失败,用户%s不是房间%s的管理员", operatorId, roomId); - logger.warn(msg); - throw new BusinessException(msg); - } - if(muteTime > 0) { - //判断当前是否存在有效的禁言记录 - int count = countEnabledRecord(targetUid, roomId, new Date()); - if (count > 0) { - logger.warn("禁言失败,用户{}在房间{}存在有效的禁言记录!", targetUid, roomId); - throw new BusinessException("失败,该用户已被禁言中"); - } - } - //reason在数据库最大的保存长度为255 - if(StringUtils.length(reason) > 255) { - reason.substring(0, 255); - } - //先准备好记录 - UserMuteRecord record = new UserMuteRecord(); - //被禁言的用户 - record.setUid(targetUid); - record.setErbanNo(users.getErbanNo()); - record.setNick(users.getNick()); - //管理员 - Users userAdmin = usersService.getUsersByUid(operatorId); - record.setOperator(userAdmin.getNick()); - record.setOperatorId(userAdmin.getUid()); - //禁言时间 - record.setMuteTime(muteTime); - record.setReason(reason); - record.setRoomId(roomId); - //时间处理 - Date now = new Date(); - record.setCreateTime(now); - record.setUpdateTime(now); - RubbishRet ret = erBanNetEaseService.temporaryMuteFromRoom(roomId, - String.valueOf(operatorId), String.valueOf(targetUid), muteTime, "true", null); - if(ret.getCode() != 200) { - if(ret.getCode() == 403) { - throw new BusinessException("失败,无禁言权限或仅房间创建者可以禁言管理员"); - } - logger.warn("添加用户禁言记录失败,用户id:{},房间id:{}, 云信返回:{}", operatorId, roomId, ret.getCode()); - return 0; - } - //禁言时间为0,表示解除禁言,需要将生效的记录设置为无效,并新增一条解禁记录 - if(muteTime == 0) { - userMuteRecordMapperExpand.disableEnabledRecord(targetUid, roomId, new Date()); - } - return userMuteRecordMapper.insertSelective(record); - } - - /** - * 查询指定时刻,用户的某个房间是否存在有效的禁言记录 - * @param uid - * @param roomId - * @param date - * @return - * - * 对应的sql语句: - * SELECT * FROM user_mute_record WHERE uid = ? and room_id = ? and create_time > FROM_UNIXTIME(UNIX_TIMESTAMP(?) - mute_time); - * - */ - public int countEnabledRecord(Long uid, Long roomId, Date date) { - if(null == date) { - date = new Date(); - } - return userMuteRecordMapperExpand.countEnabledRecord(uid, roomId, date); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserActPropertyInfoServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserActPropertyInfoServiceImpl.java index a8db34013..f69896a8a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserActPropertyInfoServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserActPropertyInfoServiceImpl.java @@ -52,7 +52,7 @@ public class UserActPropertyInfoServiceImpl extends ServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq("uid", uid).eq("property_type", propertyType); @@ -94,7 +94,7 @@ public class UserActPropertyInfoV2ServiceImpl extends ServiceImpl blackIdList = getBlackIdList(uid, type); if (CollectionUtils.isNotEmpty(blackIdList) && blackIdList.contains(objId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY,msg); + throw new ServiceException(BusiStatus.SERVERBUSY,msg); } UserBlackRecord record = buildUserBlackRecord(uid, objId, type); @@ -108,7 +108,7 @@ public class UserBlackRecordServiceImpl extends ServiceImpl blackIdList = getBlackIdList(uid, type); if (CollectionUtils.isEmpty(blackIdList) || !blackIdList.contains(objId)) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "找不到对应的记录"); + throw new ServiceException(BusiStatus.SERVERBUSY, "找不到对应的记录"); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java index bc3212e19..a9d93aab4 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java @@ -189,7 +189,7 @@ public class UserCoupleServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipBizService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipBizService.java index 4d0a5fc5d..eb0a7b498 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipBizService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipBizService.java @@ -328,7 +328,7 @@ public class VipBizService { String lockval = jedisLockService.lock(lockKey, 10 * 1000, 30 * 1000); if (StringUtils.isEmpty(lockval)) { log.error("发送房间小喇叭加锁失败"); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 发送自定义消息 try { @@ -356,7 +356,7 @@ public class VipBizService { throw e1; } catch (Exception e) { log.error("sendRoomHorn error, uid :" + uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { jedisLockService.unlock(lockKey, lockval); } @@ -433,7 +433,7 @@ public class VipBizService { public void changeInvisibleInRoom(Long uid, Boolean open) { VipBaseInfoVO userBaseVipInfo = VipUtil.getUserBaseVipInfo(uid); if (null == userBaseVipInfo) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "無權限進行此操作"); + throw new ServiceException(BusiStatus.SERVERBUSY, "無權限進行此操作"); } // 校验用户等级是否够 List vipAuthItems = vipAuthItemService.listValidItemByVipLevel(userBaseVipInfo.getVipLevel()); @@ -441,7 +441,7 @@ public class VipBizService { vipAuthItem.getAuthType().equals(Constant.VipAuthType.INVISIBLE_IN_ROOM)) .findFirst().orElse(null); if (null == invisibleInRoom) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "無權限進行此操作"); + throw new ServiceException(BusiStatus.SERVERBUSY, "無權限進行此操作"); } // 变更开关 jedisService.hset(RedisKey.user_invisible_in_room.getKey(), uid.toString(), open.toString()); @@ -491,7 +491,7 @@ public class VipBizService { // 获取当前用户可申请的铭牌id List applyNameplateIds = vipCustomNameplateService.getVipNameplateIds(uid); if (CollectionUtils.isEmpty(vipNameplateIds)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if (!vipNameplateIds.contains(nameplateId)) { throw new ServiceException(BusiStatus.PARAMETERILLEGAL); @@ -519,7 +519,7 @@ public class VipBizService { String lockval = jedisLockService.lock(lockKey, 10 * 1000, 30 * 1000); if (StringUtils.isEmpty(lockval)) { log.error("用户申请贵族铭牌加锁失败, uid:{} nameplateId:{}", uid, nameplateId); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } try { // 再次校验 @@ -553,7 +553,7 @@ public class VipBizService { throw e1; } catch (Exception e) { log.error("vipMpApply error, uid :" + uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { jedisLockService.unlock(lockKey, lockval); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipDiamondOpenService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipDiamondOpenService.java index a38e363cb..168501b29 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipDiamondOpenService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipDiamondOpenService.java @@ -100,7 +100,7 @@ public class VipDiamondOpenService { // 扣减用户钻石 boolean result = userPurseService.subDiamond(uid, diamond.doubleValue(), BillObjTypeEnum.OPEN_VIP_WITH_DIAMOND.getDesc()); if (!result) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } // 更新数据 SpringContextHolder.getBean(this.getClass()).updateDataAfterOpen(roomUid, uid, diamond, vipLevel); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipLevelBizService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipLevelBizService.java index 86d4edc14..baea6ca9c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipLevelBizService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipLevelBizService.java @@ -411,7 +411,7 @@ public class VipLevelBizService { if (StrUtil.isNotEmpty(prodDesc)) { int vipLevel = Integer.parseInt(prodDesc); if (vipInfo.getVipLevel() == vipLevel) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "當前VIP等級已開通"); + throw new ServiceException(BusiStatus.SERVERBUSY, "當前VIP等級已開通"); } } } @@ -419,7 +419,7 @@ public class VipLevelBizService { OpenVipConfigDTO openVipConfig = VipUtil.getOpenVipConfig(); Boolean parentMode = user.getParentMode(); if (parentMode && !openVipConfig.getOpenToParentMode()) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "青少年模式下无法使用贵族功能哦~"); + throw new ServiceException(BusiStatus.SERVERBUSY, "青少年模式下无法使用贵族功能哦~"); } // 用户是否已经实名认证 boolean hasCertification = StringUtils.isNotBlank(user.getRealName()) && StringUtils.isNotBlank(user.getIdCardNum()); @@ -432,7 +432,7 @@ public class VipLevelBizService { isTeen = CommonUtil.checkUserIsUnderAge(user.getIdCardNum()); } if (isTeen && !openVipConfig.getOpenToTeen()) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "未成年用户 (<18岁),无法使用贵族功能哦"); + throw new ServiceException(BusiStatus.SERVERBUSY, "未成年用户 (<18岁),无法使用贵族功能哦"); } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipTaskService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipTaskService.java index baa0e08b9..baf5cf20b 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipTaskService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/VipTaskService.java @@ -71,7 +71,7 @@ public class VipTaskService { // 带push的通知小时 Integer notifyExpireHoursWithPush = vipMessageConfig.getNotifyExpireHoursWithPush(); if (notifyExpireHoursNotPush <= notifyExpireHoursWithPush) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "配置有误"); + throw new ServiceException(BusiStatus.SERVERBUSY, "配置有误"); } Date now = new Date(); // 不需要推送的到期时间A @@ -151,7 +151,7 @@ public class VipTaskService { Integer vipLevel = userVipInfo.getVipLevel(); VipInfo vipInfo = vipInfoService.getByVipLevel(vipLevel); if (vipInfo == null) { - throw new ServiceException(BusiStatus.SERVER_BUSY, "贵族信息不存在"); + throw new ServiceException(BusiStatus.SERVERBUSY, "贵族信息不存在"); } String scoreField = VipUtil.getUserVipScoreCacheFieldName(userVipInfo.getUid(), userVipInfo.getExpireTime().getTime()); String scoreStr = jedisService.hget(RedisKey.user_vip_curr_score.getKey(), scoreField); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java index 62e34cc65..f0f8542d2 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java @@ -10,7 +10,7 @@ import com.accompany.business.service.vip.VipMessageService; import com.accompany.business.service.vip.VipReturnProfitRecordService; import com.accompany.business.service.vip.VipReturnProfitService; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.UidContextHolder; import com.accompany.core.enumeration.BillObjTypeEnum; @@ -106,7 +106,7 @@ public class VipReturnProfitRecordServiceImpl extends ServiceImpllambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (count > 0) { - throw new ApiException(BusiStatus.SERVERERROR.value(), "該提現方式已添加"); + throw new AdminServiceException(BusiStatus.SERVERERROR.value(), "該提現方式已添加"); } int updateNum = 1; if ((WithdrawAccountTypeConstant.CHINA_UNION_PAY & accountType) != 0) { @@ -163,7 +163,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpllambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (count == 0) { - throw new ApiException("非法賬戶"); + throw new AdminServiceException("非法賬戶"); } List accountDtls = withdrawAccountDtlService.list(Wrappers.lambdaQuery().eq(WithdrawAccountDtl::getAccountType, accountType)); if (CollectionUtil.isEmpty(accountDtls)) { @@ -201,7 +201,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl withdrawUserLimits = withdrawUserLimitService.list(Wrappers.lambdaQuery() .eq(WithdrawUserLimit::getUid, uid)); @@ -209,34 +209,34 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl userAccounts = withdrawUserAccountService.list(Wrappers.lambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (CollectionUtil.isEmpty(userAccounts)) { - throw new ApiException("賬戶不存在"); + throw new AdminServiceException("賬戶不存在"); } WithdrawUserAccount withdrawUserAccount = userAccounts.get(0); if (withdrawUserAccount.getAccountType() != null && withdrawUserAccount.getAccountType() == WithdrawAccountTypeConstant.CHINA_UNION_PAY) { Integer isRealCertify = withdrawUserAccount.getIsRealCertify(); if (isRealCertify == null || isRealCertify == Constant.Yes1No0.NO) { - throw new ApiException("账号未进行实名认证"); + throw new AdminServiceException("账号未进行实名认证"); } } List configs = withdrawConfigService.list(Wrappers.lambdaQuery().eq(WithdrawConfig::getIsEnabled, Constant.Yes1No0.YES)); if (CollectionUtil.isEmpty(configs)) { - throw new ApiException("系統缺少配置,請聯繫管理員"); + throw new AdminServiceException("系統缺少配置,請聯繫管理員"); } WithdrawConfig withdrawConfig = configs.get(0); Long minValue = withdrawConfig.getMinValue(); Long weekMaxValue = withdrawConfig.getWeekMaxValue(); Integer weekLimitCount = withdrawConfig.getWeekLimitCount(); if (goldNum < minValue) { - throw new ApiException("金幣數不能低於限制數:" + minValue); + throw new AdminServiceException("金幣數不能低於限制數:" + minValue); } //提现账户限制(大陆提现限制) if (accountType != null && (accountType & WithdrawAccountTypeConstant.CHINA_UNION_PAY) != 0) { @@ -246,7 +246,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl= weekLimitCount) { - throw new ApiException("提現已達到周上限"); + throw new AdminServiceException("提現已達到周上限"); } } if ((totalGoldNum + goldNum) > weekMaxValue) { - throw new ApiException("周總金幣數超過限制數:" + weekMaxValue); + throw new AdminServiceException("周總金幣數超過限制數:" + weekMaxValue); } //余额校验 UserPurse userPurse = userPurseService.queryUserPurse(uid); double currentGolds = userPurse.getGolds(); if (Double.compare(currentGolds, goldNum) < 0) { - throw new ApiException("金幣不足,無法提現"); + throw new AdminServiceException("金幣不足,無法提現"); } //扣减钱包 if (!userPurseService.subGold(uid, goldNum.doubleValue(), BillObjTypeEnum.WITHDRAW.getDesc())) { @@ -282,7 +282,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl resultMap = new HashMap<>(4); try { @@ -315,7 +315,7 @@ public class WorldService extends BaseService { String lockKey = RedisKey.world_lock.getKey(String.valueOf(worldId)); String lockVal = jedisLockService.lock(lockKey, 1000, 10 * 1000); if (StringUtils.isEmpty(lockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } try { World world = iWorldService.getByIdFromCache(worldId); @@ -370,7 +370,7 @@ public class WorldService extends BaseService { String lockKey = RedisKey.world_lock.getKey(String.valueOf(worldId)); String lockVal = jedisLockService.lock(lockKey, 1000, 10 * 1000); if (StringUtils.isEmpty(lockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } try { World world = iWorldService.getByIdFromCache(worldId); @@ -447,7 +447,7 @@ public class WorldService extends BaseService { worldNameChange = true; lockVal = jedisLockService.lock(lockKey, 1000, 10 * 1000); if (StringUtils.isEmpty(lockVal)) { - throw new WorldException(BusiStatus.SERVER_BUSY.getReasonPhrase()); + throw new WorldException(BusiStatus.SERVERBUSY.getReasonPhrase()); } } try { diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteAdminMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteAdminMapper.xml deleted file mode 100644 index 1ef421af0..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteAdminMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, uid, erban_no, nick, room_id, room_uid, room_erban_no, operator_id, operator, - status, create_time, update_time - - - - - delete from user_mute_admin - where id = #{id,jdbcType=INTEGER} - - - - SELECT LAST_INSERT_ID() - - insert into user_mute_admin (uid, erban_no, nick, - room_id, room_uid, room_erban_no, - operator_id, operator, status, - create_time, update_time) - values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{nick,jdbcType=VARCHAR}, - #{roomId,jdbcType=BIGINT}, #{roomUid,jdbcType=BIGINT}, #{roomErbanNo,jdbcType=BIGINT}, - #{operatorId,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) - - - - SELECT LAST_INSERT_ID() - - insert into user_mute_admin - - - uid, - - - erban_no, - - - nick, - - - room_id, - - - room_uid, - - - room_erban_no, - - - operator_id, - - - operator, - - - status, - - - create_time, - - - update_time, - - - - - #{uid,jdbcType=BIGINT}, - - - #{erbanNo,jdbcType=BIGINT}, - - - #{nick,jdbcType=VARCHAR}, - - - #{roomId,jdbcType=BIGINT}, - - - #{roomUid,jdbcType=BIGINT}, - - - #{roomErbanNo,jdbcType=BIGINT}, - - - #{operatorId,jdbcType=INTEGER}, - - - #{operator,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update user_mute_admin - - - id = #{record.id,jdbcType=INTEGER}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - - - nick = #{record.nick,jdbcType=VARCHAR}, - - - room_id = #{record.roomId,jdbcType=BIGINT}, - - - room_uid = #{record.roomUid,jdbcType=BIGINT}, - - - room_erban_no = #{record.roomErbanNo,jdbcType=BIGINT}, - - - operator_id = #{record.operatorId,jdbcType=INTEGER}, - - - operator = #{record.operator,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=TINYINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update user_mute_admin - set id = #{record.id,jdbcType=INTEGER}, - uid = #{record.uid,jdbcType=BIGINT}, - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - nick = #{record.nick,jdbcType=VARCHAR}, - room_id = #{record.roomId,jdbcType=BIGINT}, - room_uid = #{record.roomUid,jdbcType=BIGINT}, - room_erban_no = #{record.roomErbanNo,jdbcType=BIGINT}, - operator_id = #{record.operatorId,jdbcType=INTEGER}, - operator = #{record.operator,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=TINYINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update user_mute_admin - - - uid = #{uid,jdbcType=BIGINT}, - - - erban_no = #{erbanNo,jdbcType=BIGINT}, - - - nick = #{nick,jdbcType=VARCHAR}, - - - room_id = #{roomId,jdbcType=BIGINT}, - - - room_uid = #{roomUid,jdbcType=BIGINT}, - - - room_erban_no = #{roomErbanNo,jdbcType=BIGINT}, - - - operator_id = #{operatorId,jdbcType=INTEGER}, - - - operator = #{operator,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=INTEGER} - - - update user_mute_admin - set uid = #{uid,jdbcType=BIGINT}, - erban_no = #{erbanNo,jdbcType=BIGINT}, - nick = #{nick,jdbcType=VARCHAR}, - room_id = #{roomId,jdbcType=BIGINT}, - room_uid = #{roomUid,jdbcType=BIGINT}, - room_erban_no = #{roomErbanNo,jdbcType=BIGINT}, - operator_id = #{operatorId,jdbcType=INTEGER}, - operator = #{operator,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapper.xml deleted file mode 100644 index aa1ebd228..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapper.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, uid, erban_no, nick, room_id, operator_id, operator, reason, mute_time, create_time, - update_time, status - - - - - delete from user_mute_record - where id = #{id,jdbcType=INTEGER} - - - - SELECT LAST_INSERT_ID() - - insert into user_mute_record (uid, erban_no, nick, - room_id, operator_id, operator, - reason, mute_time, create_time, - update_time, status) - values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{nick,jdbcType=VARCHAR}, - #{roomId,jdbcType=BIGINT}, #{operatorId,jdbcType=BIGINT}, #{operator,jdbcType=VARCHAR}, - #{reason,jdbcType=VARCHAR}, #{muteTime,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}) - - - - SELECT LAST_INSERT_ID() - - insert into user_mute_record - - - uid, - - - erban_no, - - - nick, - - - room_id, - - - operator_id, - - - operator, - - - reason, - - - mute_time, - - - create_time, - - - update_time, - - - status, - - - - - #{uid,jdbcType=BIGINT}, - - - #{erbanNo,jdbcType=BIGINT}, - - - #{nick,jdbcType=VARCHAR}, - - - #{roomId,jdbcType=BIGINT}, - - - #{operatorId,jdbcType=BIGINT}, - - - #{operator,jdbcType=VARCHAR}, - - - #{reason,jdbcType=VARCHAR}, - - - #{muteTime,jdbcType=INTEGER}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=TINYINT}, - - - - - - update user_mute_record - - - id = #{record.id,jdbcType=INTEGER}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - - - nick = #{record.nick,jdbcType=VARCHAR}, - - - room_id = #{record.roomId,jdbcType=BIGINT}, - - - operator_id = #{record.operatorId,jdbcType=BIGINT}, - - - operator = #{record.operator,jdbcType=VARCHAR}, - - - reason = #{record.reason,jdbcType=VARCHAR}, - - - mute_time = #{record.muteTime,jdbcType=INTEGER}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - status = #{record.status,jdbcType=TINYINT}, - - - - - - - - update user_mute_record - set id = #{record.id,jdbcType=INTEGER}, - uid = #{record.uid,jdbcType=BIGINT}, - erban_no = #{record.erbanNo,jdbcType=BIGINT}, - nick = #{record.nick,jdbcType=VARCHAR}, - room_id = #{record.roomId,jdbcType=BIGINT}, - operator_id = #{record.operatorId,jdbcType=BIGINT}, - operator = #{record.operator,jdbcType=VARCHAR}, - reason = #{record.reason,jdbcType=VARCHAR}, - mute_time = #{record.muteTime,jdbcType=INTEGER}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - status = #{record.status,jdbcType=TINYINT} - - - - - - update user_mute_record - - - uid = #{uid,jdbcType=BIGINT}, - - - erban_no = #{erbanNo,jdbcType=BIGINT}, - - - nick = #{nick,jdbcType=VARCHAR}, - - - room_id = #{roomId,jdbcType=BIGINT}, - - - operator_id = #{operatorId,jdbcType=BIGINT}, - - - operator = #{operator,jdbcType=VARCHAR}, - - - reason = #{reason,jdbcType=VARCHAR}, - - - mute_time = #{muteTime,jdbcType=INTEGER}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=INTEGER} - - - update user_mute_record - set uid = #{uid,jdbcType=BIGINT}, - erban_no = #{erbanNo,jdbcType=BIGINT}, - nick = #{nick,jdbcType=VARCHAR}, - room_id = #{roomId,jdbcType=BIGINT}, - operator_id = #{operatorId,jdbcType=BIGINT}, - operator = #{operator,jdbcType=VARCHAR}, - reason = #{reason,jdbcType=VARCHAR}, - mute_time = #{muteTime,jdbcType=INTEGER}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=TINYINT} - where id = #{id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapperExpand.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapperExpand.xml deleted file mode 100644 index 9c780ffee..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserMuteRecordMapperExpand.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - id, uid, erban_no, nick, room_id, operator_id, operator, reason, mute_time, create_time, - update_time, status - - - WHERE `status` = 1 - - - - - - - - FROM_UNIXTIME(UNIX_TIMESTAMP(#{date}) - `mute_time`) ]]> - - - - - - UPDATE user_mute_record - SET `status` = 2 - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java index a8ed091fe..71ac60db8 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/common/BaseController.java @@ -70,7 +70,7 @@ public class BaseController { try { desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); } catch (Exception e) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return desInfo; } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/ExceptionController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/ExceptionController.java index 9de501db9..b7c6a04c0 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/ExceptionController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/ExceptionController.java @@ -1,10 +1,9 @@ package com.accompany.business.controller; -import com.accompany.common.status.BusiStatusInterface; import com.accompany.common.utils.StringUtils; import com.accompany.core.exception.ServiceException; import com.accompany.world.common.WorldException; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import org.slf4j.Logger; @@ -44,14 +43,14 @@ public class ExceptionController { return new BusiResult<>(BusiStatus.REQUEST_PARAM_ERROR, msg, null); } else if (exception instanceof ServiceException) { ServiceException serviceException = (ServiceException) exception; - BusiStatusInterface status = serviceException.getBusiStatus(); + BusiStatus status = serviceException.getBusiStatus(); if (status != null) { return new BusiResult<>(status, StringUtils.isNotBlank(exception.getMessage()) ? exception.getMessage() : status.getMessage(), null); } else { return new BusiResult<>(BusiStatus.SERVERERROR, exception.getMessage(), null); } - } else if (exception instanceof ApiException) { - ApiException apiException = (ApiException) exception; + } else if (exception instanceof AdminServiceException) { + AdminServiceException apiException = (AdminServiceException) exception; return new BusiResult<>(BusiStatus.SERVERERROR, apiException.getMessage(), null); } else if (exception instanceof MethodArgumentNotValidException) { MethodArgumentNotValidException ex = (MethodArgumentNotValidException) exception; diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/IOSPayPlaController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/IOSPayPlaController.java index f66c3df26..bbb7ba009 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/IOSPayPlaController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/IOSPayPlaController.java @@ -48,7 +48,7 @@ public class IOSPayPlaController extends BaseController { DeviceInfo deviceInfo = getDeviceInfo(request); ChargeProd chargeProd = chargeProdService.getChargeProdById(chargeProdId); if (null == chargeProd) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } BusiResult busiResult; if (vipChargeService.isVipCharge(chargeProd)) { diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activities/ActivitiesDrawController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activities/ActivitiesDrawController.java index c3029d3df..d8bd026ad 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activities/ActivitiesDrawController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/activities/ActivitiesDrawController.java @@ -6,7 +6,7 @@ import com.accompany.business.service.box.DrawLotteryRecordService; import com.accompany.business.vo.openbox.DrawPrizeItemVo; import com.accompany.business.common.BaseController; import com.accompany.common.annotation.Authorization; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import lombok.extern.slf4j.Slf4j; @@ -38,7 +38,7 @@ public class ActivitiesDrawController extends BaseController { public BusiResult queryTicketNum(Long uid){ log.info("queryTicketNum, uid = {}", uid); if (uid == null || uid == 0){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } return activitiesDrawService.queryTicketNum(uid); } @@ -47,7 +47,7 @@ public class ActivitiesDrawController extends BaseController { public BusiResult queryTicketRule(ActivitiesDrawTypeEnum drawType){ log.info("queryTicketRule, drawType = {}", drawType); if (drawType == null){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } return activitiesDrawService.queryTicketRule(drawType); } @@ -57,7 +57,7 @@ public class ActivitiesDrawController extends BaseController { public BusiResult getPackList(Long uid){ log.info("getPackList, uid = {}", uid); if (uid == null || uid == 0){ - throw new ApiException(BusiStatus.PARAMERROR); + throw new AdminServiceException(BusiStatus.PARAMERROR); } return activitiesDrawService.getActPackList(uid); } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java index c1c5f6302..b2c78ccb6 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/anchor/AnchorFansTeamController.java @@ -2,12 +2,10 @@ package com.accompany.business.controller.anchor; import com.accompany.business.annotation.CancelUidTag; import com.accompany.business.common.BaseController; -import com.accompany.business.service.anchor.AnchorFansTeamAudioRecordService; import com.accompany.business.service.anchor.AnchorFansTeamService; import com.accompany.business.service.netease.YidunCheckUtil; import com.accompany.business.vo.anchor.*; import com.accompany.common.annotation.Authorization; -import com.accompany.common.exception.ApiException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.core.exception.ServiceException; diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/apppay/PayermaxPayController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/apppay/PayermaxPayController.java index c2a3e3ee9..76fef62e9 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/apppay/PayermaxPayController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/apppay/PayermaxPayController.java @@ -87,7 +87,7 @@ public class PayermaxPayController { isLocked = lock.tryLock(5L, TimeUnit.SECONDS); if (!isLocked){ log.error("【payermax支付回调】加锁失败 chargeRecordId: {}", chargeRecordId); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } ChargeRecord chargeRecord = chargeRecordService.getChargeRecordById(chargeRecordId); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/certification/UserCertificationController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/certification/UserCertificationController.java index 975c3299b..824ae07b8 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/certification/UserCertificationController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/certification/UserCertificationController.java @@ -1,21 +1,17 @@ package com.accompany.business.controller.certification; -import cn.hutool.core.util.StrUtil; import com.accompany.business.common.BaseController; import com.accompany.business.dto.certification.CertifyInfo; import com.accompany.business.model.UserCertifyRecord; import com.accompany.business.service.certification.*; import com.accompany.common.annotation.H5Authorization; -import com.accompany.common.constant.Constant; import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatusInterface; import com.accompany.common.utils.DESUtils; import com.accompany.common.utils.IPUtils; import com.accompany.core.util.KeyStore; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.exceptions.ClientException; import com.accompany.core.exception.ServiceException; -import com.accompany.core.util.StringUtils; import com.google.common.collect.Maps; import com.google.common.util.concurrent.RateLimiter; import com.google.gson.Gson; @@ -78,7 +74,7 @@ public class UserCertificationController extends BaseController { DeviceInfo deviceInfo = gson.fromJson(deviceInfoStr, DeviceInfo.class); logger.info("sendCertificationCode(), phone={}, uid={}, device={}", phone, uid, deviceInfo); if (!certificationLimit.tryAcquire(5, TimeUnit.SECONDS)) { - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } String ip = IPUtils.getRealIpAddress(request); try { @@ -151,7 +147,7 @@ public class UserCertificationController extends BaseController { phone = DESUtils.DESAndBase64Decrypt(phone, KeyStore.DES_ENCRYPT_KEY); } catch (Exception e) { logger.error("解密信息时出现异常", e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Map data = Maps.newHashMap(); DeviceInfo deviceInfo = getDeviceInfo(request); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/exchange/GoldExchangeDiamondController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/exchange/GoldExchangeDiamondController.java index cd80ab63d..4660ceba0 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/exchange/GoldExchangeDiamondController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/exchange/GoldExchangeDiamondController.java @@ -9,7 +9,7 @@ import com.accompany.business.service.withdraw.WithdrawUserLimitService; import com.accompany.business.vo.exchange.GoldExchangeDiamondVo; import com.accompany.common.annotation.Authorization; import com.accompany.common.annotation.H5Authorization; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.core.exception.ServiceException; @@ -54,7 +54,16 @@ public class GoldExchangeDiamondController extends BaseController { throw new ServiceException(BusiStatus.PARAMERROR); } Long uid = getUid(request); - withdrawUserLimitService.checkDiamond(uid); + List withdrawUserLimits = withdrawUserLimitService.list(Wrappers.lambdaQuery() + .eq(WithdrawUserLimit::getUid, uid)); + if (CollectionUtil.isNotEmpty(withdrawUserLimits)) { + for (WithdrawUserLimit withdrawUserLimit : withdrawUserLimits) { + Integer limitType = withdrawUserLimit.getLimitType(); + if ((limitType & WithdrawUserLimitConstant.LIMIT_TYPE_OF_DIAMOND) != 0) { + throw new AdminServiceException("你無法使用該功能,請與你的公會長聯繫你無法使用該功能"); + } + } + } service.exchange(uid, goldNum, diamondNum); return new BusiResult<>(BusiStatus.GOLD_EXCHANGE_DIAMOND_SUCCESS); } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/GiftV2Controller.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/GiftV2Controller.java index b7325c6fa..d21ceb537 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/GiftV2Controller.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/GiftV2Controller.java @@ -14,7 +14,7 @@ import com.accompany.business.vo.luckybag.LuckyBagPlayInfoVo; import com.accompany.common.annotation.Authorization; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.core.enumeration.BusinessStatusCodeEnum; @@ -78,7 +78,7 @@ public class GiftV2Controller extends BaseController { return new BusiResult(BusiStatus.SEND_GIFT_NUM_TOO_LARGE); } if (Arrays.asList(targetUids).contains(uid)) { - throw new ApiException(BusiStatus.GIFT_SEND_MY_SELF_ERROR); + throw new AdminServiceException(BusiStatus.GIFT_SEND_MY_SELF_ERROR); } // 对接口限流 if (!sendAllLimiter.tryAcquire(5, TimeUnit.SECONDS)) { @@ -91,7 +91,7 @@ public class GiftV2Controller extends BaseController { return new BusiResult(giftSendService.sendV4(uid, targetUids, roomUid, giftId, giftNum, msg, giftSource, sendType)); } catch (ServiceException s) { return new BusiResult(s.getBusiStatus(), s.getMessage(), null); - } catch (ApiException a) { + } catch (AdminServiceException a) { return new BusiResult(a.getMessage()); } catch (Exception e) { logger.error("sendV4 error param==>>> uid:{},targetUids:{},roomUid:{},giftId:{},giftNum:{},sendType:{},giftSource:{}", diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/SpecialGiftController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/SpecialGiftController.java index 23a15bee5..901ebae86 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/SpecialGiftController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/gift/SpecialGiftController.java @@ -4,10 +4,9 @@ import com.accompany.business.model.Gift; import com.accompany.business.service.gift.GiftSendService; import com.accompany.business.service.gift.GiftService; import com.accompany.common.constant.Constant; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; -import com.accompany.common.status.BusiStatusInterface; import com.accompany.core.base.UidContextHolder; import com.accompany.core.exception.ServiceException; import com.accompany.core.service.SysConfService; @@ -48,7 +47,7 @@ public class SpecialGiftController { public BusiResult getSpecialGift() { int giftId = sysConfService.getIntValueById(Constant.SysConfId.SPECIAL_GIFT_SEND_FOR_ID); if (giftId == 0) { - throw new ApiException("未配置礼物ID"); + throw new AdminServiceException("未配置礼物ID"); } return BusiResult.success(giftService.getGiftById(giftId)); } @@ -65,26 +64,26 @@ public class SpecialGiftController { public BusiResult send(@RequestParam("targetId") Long targetId) { int giftId = sysConfService.getIntValueById(Constant.SysConfId.SPECIAL_GIFT_SEND_FOR_ID); if (giftId == 0) { - throw new ApiException("未配置礼物ID"); + throw new AdminServiceException("未配置礼物ID"); } Long uid = UidContextHolder.get(); int giftNum = 1; try { return BusiResult.success(giftSendService.sendV4(uid, new Long[]{targetId}, null, giftId, giftNum, null, Constant.GiftSource.COMMON, Constant.SendGiftType.person)); - } catch (ServiceException | ApiException e) { + } catch (ServiceException | AdminServiceException e) { if (e instanceof ServiceException) { ServiceException se = (ServiceException) e; - BusiStatusInterface busiStatus = se.getBusiStatus(); + BusiStatus busiStatus = se.getBusiStatus(); if (busiStatus != null) { - throw new ApiException(busiStatus.getCode(), busiStatus.getMessage()); + throw new AdminServiceException(busiStatus.getCode(), busiStatus.getMessage()); } } else { - ApiException ae = (ApiException) e; - throw new ApiException(ae.getResponseCode(), ae.getMessage()); + AdminServiceException ae = (AdminServiceException) e; + throw new AdminServiceException(ae.getResponseCode(), ae.getMessage()); } } catch (Exception e) { throw new RuntimeException(e); } - return BusiResult.fail(BusiStatus.SERVER_BUSY); + return BusiResult.fail(BusiStatus.SERVERBUSY); } } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomBlindDateController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomBlindDateController.java index eeb7a9faa..af89a5657 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomBlindDateController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomBlindDateController.java @@ -70,7 +70,7 @@ public class RoomBlindDateController { try { locked = lock.tryLock(5, TimeUnit.SECONDS); if (!locked){ - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } Long roomUserId = request.getRoomUserId(); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java index a60bde231..661924d6a 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/room/RoomController.java @@ -276,7 +276,7 @@ public class RoomController extends BaseController { @SneakyThrows public BusiResult getRoom(Long uid, Long intoUid, HttpServletRequest request) { if (!roomGetLimiter.tryAcquire(5, TimeUnit.SECONDS)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if (uid == null) { throw new ServiceException(BusiStatus.PARAMETERILLEGAL); diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/FansController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/FansController.java index e1014ed2f..ead51f273 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/FansController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/FansController.java @@ -49,7 +49,7 @@ public class FansController extends BaseController { @Transactional(rollbackFor = Exception.class) public BusiResult likeSomeBody(@RequestParam Long uid, @RequestParam Long likedUid, @RequestParam Byte type) throws Exception { if (!followLimiter.tryAcquire(5, TimeUnit.SECONDS)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } if ((!FansService.LIKE.equals(type) && !FansService.UNLIKE.equals(type))) { diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UserMuteRecordController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UserMuteRecordController.java deleted file mode 100644 index a6081c4d4..000000000 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UserMuteRecordController.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.accompany.business.controller.user; - -import com.accompany.business.service.user.UserMuteRecordService; -import com.accompany.business.common.BaseController; -import com.accompany.common.exception.BusinessException; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -/** - * 用户禁言记录 - * - * @author fangchengyan - * @date 2019-05-08 18:36 - */ -@RestController -@RequestMapping("/userMute/record") -public class UserMuteRecordController extends BaseController { - - protected final Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private UserMuteRecordService userMuteRecordService; - - /** - * 添加一条用户禁言记录 - * @param operatorId:当前用户uid,必须为房间的管理员或创建者 - * @param roomId:房间id,不传为公聊大厅roomId - * @param targetUid:被禁言的用户id - * @param muteTime:禁言时间,0:解除禁言;>0设置禁言的秒数,不能超过2592000秒(30天) - * @param reason:禁言原因,10个字内 - * @return - */ - @RequestMapping(value = "/add", method = RequestMethod.POST) - public BusiResult add(@RequestHeader(value = "pub_uid") Long operatorId, Long roomId, Long targetUid, int muteTime, String reason) { - if(null == targetUid || targetUid <= 0 || muteTime < 0) { - return new BusiResult(BusiStatus.PARAMERROR); - } - try { - int result = userMuteRecordService.add(operatorId, roomId, targetUid, muteTime, reason); - if(result > 0) { - return new BusiResult(BusiStatus.SUCCESS); - } else { - return new BusiResult(BusiStatus.UNKNOWN, "添加失败!", null); - } - } catch (BusinessException e){ - return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(), null); - } catch (Exception e){ - logger.error(e.getMessage(), e); - return new BusiResult(BusiStatus.SERVERERROR); - } - } -} diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java index 191102d1c..1788ca378 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/user/UsersController.java @@ -30,7 +30,7 @@ import com.accompany.common.annotation.Authorization; import com.accompany.common.annotation.H5Authorization; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; @@ -128,7 +128,7 @@ public class UsersController extends BaseController { } if (!userGetLimiter.tryAcquire(5, TimeUnit.SECONDS)) { - return new BusiResult<>(BusiStatus.SERVER_BUSY); + return new BusiResult<>(BusiStatus.SERVERBUSY); } Long requestUid = getUid(request); @@ -165,7 +165,7 @@ public class UsersController extends BaseController { userVo.setBanAccount(accountBlockService.checkAccountBlock(userVo.getErbanNo(), userVo.getPhone())); } catch (Exception e) { logger.error("[getUserByUid] 查询 {} 个人信息类信息 异常 ", uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { cdl.countDown(); } @@ -185,7 +185,7 @@ public class UsersController extends BaseController { } catch (Exception e) { logger.error("[getUserByUid] 查询 {} 个人信息类信息 异常 ", uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { cdl.countDown(); } @@ -228,7 +228,7 @@ public class UsersController extends BaseController { } catch (Exception e) { logger.error("[getUserByUid] 查询 {} 社交类信息 异常 ", uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { cdl.countDown(); } @@ -269,7 +269,7 @@ public class UsersController extends BaseController { } } catch (Exception e) { logger.error("[getUserByUid] 查询 {} 充值类信息 异常 ", uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } finally { cdl.countDown(); } @@ -279,7 +279,7 @@ public class UsersController extends BaseController { cdl.await(5, TimeUnit.SECONDS); } catch (InterruptedException e) { logger.error("[getUserByUid] 组装 {} UserVo 超时 ", uid, e); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return new BusiResult<>(userVo); @@ -370,8 +370,8 @@ public class UsersController extends BaseController { return usersService.saveOrUpdateUserByUidV2(users, deviceInfo); } catch (Exception e) { logger.error("saveOrUpdateUserByUid error..uid=" + userParam.getUid(), e); - if (e instanceof ApiException) { - ApiException exception = (ApiException) e; + if (e instanceof AdminServiceException) { + AdminServiceException exception = (AdminServiceException) e; return BusiResult.fail(exception.getMessage()); } else if (e instanceof ServiceException) { ServiceException exception = (ServiceException) e; @@ -393,8 +393,8 @@ public class UsersController extends BaseController { return usersService.saveOrUpdateUserByUidV2(users, deviceInfo); } catch (Exception e) { logger.error("saveOrUpdateUserByUidV2 error..uid=" + userParam.getUid(), e); - if (e instanceof ApiException) { - ApiException exception = (ApiException) e; + if (e instanceof AdminServiceException) { + AdminServiceException exception = (AdminServiceException) e; return BusiResult.fail(exception.getMessage()); } else if (e instanceof ServiceException) { ServiceException exception = (ServiceException) e; diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/withdraw/SmsWithdrawController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/withdraw/SmsWithdrawController.java index 55d06d131..57426afe0 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/withdraw/SmsWithdrawController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/withdraw/SmsWithdrawController.java @@ -3,7 +3,7 @@ package com.accompany.business.controller.withdraw; import com.accompany.business.common.BaseController; import com.accompany.business.service.withdraw.SmsWithdrawService; import com.accompany.common.annotation.Authorization; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.core.service.user.PhoneBlackService; @@ -50,7 +50,7 @@ public class SmsWithdrawController extends BaseController { HttpServletRequest request) { phone = decryptSensitiveInfo(request, phone); if (phoneBlackService.checkIsNeedIntercept(phone)) { - throw new ApiException(BusiStatus.PHONE_BE_INTERCEPTED); + throw new AdminServiceException(BusiStatus.PHONE_BE_INTERCEPTED); } return BusiResult.success(withdrawService.boundPhone(getUid(), phone, code, phoneAreaCode)); } diff --git a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/world/WorldGroupChatController.java b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/world/WorldGroupChatController.java index 0dfc08779..315e04aa8 100644 --- a/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/world/WorldGroupChatController.java +++ b/accompany-business/accompany-business-web/src/main/java/com/accompany/business/controller/world/WorldGroupChatController.java @@ -89,7 +89,7 @@ public class WorldGroupChatController { if(result != null && result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } @@ -106,7 +106,7 @@ public class WorldGroupChatController { if(result != null && result > 0) { return new BusiResult(BusiStatus.SUCCESS); } else { - return new BusiResult(BusiStatus.SERVER_BUSY); + return new BusiResult(BusiStatus.SERVERBUSY); } } diff --git a/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/constant/OAuthStatus.java b/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/constant/OAuthStatus.java deleted file mode 100644 index cd045fbd4..000000000 --- a/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/constant/OAuthStatus.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.accompany.oauth2.constant; - -import com.accompany.common.status.BusiStatus; -import com.accompany.common.status.BusiStatusInterface; - -/** - * @author liuguofu - */ -public enum OAuthStatus implements BusiStatusInterface { - - ACCESS_DENIED(100,"access denied"), //拒絕訪問 - - INVALID_REQUEST(101,"invalid request"), //請求不合法 - - INVALID_REQUEST_SCHEME(102,"invalid request scheme"), //錯誤的請求協議 - - INVALID_REQUEST_METHOD(103,"invalid request method"), //錯誤的請求方法 - - INVALID_CLIENT_ID(104,"invalid client id"), //client id不存在或已刪除 - - CLIENT_ID_IS_BLOCKED(105,"client id is blocked"), //client id已被禁用 - - UNAUTHORIZED_CLIENT_ID(106,"unauthorized client id"), //client id未授權 - - USERNAME_PASSWORD_MISMATCH(107,"用戶名密碼不匹配"), //用戶名密碼不匹配 - - INVALID_REQUEST_SCOPE(108,"invalid request scope"), //訪問的scope不合法,開發者不用太關注,一般不會出現該錯誤 - - INVALID_USER(109,"用戶不存在或密碼錯誤"), //用戶不存在或已刪除 - - USER_HAS_BLOCKED(110,"user has blocked"), //用戶已被屏蔽 - - INVALID_TOKEN(111,"invalid token"), //token不存在或已被用戶刪除,或者用戶修改了密碼 - - ACCESS_TOKEN_IS_MISSING(112,"access token is missing"), //未找到access_token - - ACCESS_TOKEN_HAS_EXPIRED(113,"access token has expired"), //access_token已過期 - - INVALID_REQUEST_URI(114,"invalid request uri"), //請求地址未註冊 - - INVALID_CREDENTIAL_1(115,"invalid credential 1"), //用戶未授權訪問此數據 - - INVALID_CREDENTIAL_2(116,"invalid credential 2"), //client id未申請此權限 - - NOT_TRIAL_USER(117,"not trial user"), //未註冊的測試用戶 - - REQUIRED_PARAMETER_IS_MISSING(118,"required parameter is missing"), //缺少參數 - - INVALID_GRANT(119,"invalid grant type"), - - UNSUPPORTED_GRANT_TYPE(120,"unsupported grant type"), //錯誤的grant_type - - UNSUPPORTED_RESPONSE_TYPE(121,"unsupported response type"), //錯誤的response_type - - CLIENT_SECRET_MISMATCH(122,"client secret mismatch"), //client_secret不匹配 - - REDIRECT_URI_MISMATCH(123,"redirect uri mismatch"), //redirect_uri不匹配 - - INVALID_AUTHORIZATION_CODE(124,"invalid authorization code"), //authorization_code不存在或已過期 - - ACCESS_TOKEN_HAS_EXPIRED_SINCE_PASSWORD_CHANGED(125,"access token has expired since password changed"), //因用戶修改密碼而導致access_token過期 - - ACCESS_TOKEN_HAS_NOT_EXPIRED(126,"access token has not expired"), //access_token未過期; - - UNSUPPORTED_TICKET_ISSUE_TYPE(127,"unsupported ticket issue type"), - - INVALID_TICKET(128,"invalid ticket"),//ticket不存在或已過期 - - TICKET_IS_MISSING(129,"ticket is missing"), //未找到ticket - - TICKET_HAS_EXPIRED(130,"ticket has expired"), //ticket過期 - - TICKET_HAS_NOT_EXPIRED(131,"ticket has not expired"), //ticket未過期 - - TICKET_HAS_EXPIRED_SINCE_PASSWORD_CHANGED(132,"ticket has expired since password changed"), //因為用戶修改密碼而ticket過期 - - INVALID_SCOPE(133,"invalid scope"), - - RATE_LIMIT_EXCEEDED1(134,"rate limit exceeded 1"), //用戶訪問速度限制 - - RATE_LIMIT_EXCEEDED2(135,"rate limit exceeded 2"), //IP訪問速度限制 - - INVALID_IDENTIFYING_CODE(150, "短信驗證碼不正確"), //不可用的驗證碼 - - INVALID_USERNAME(151,"invalid username"), //用戶名不合法 - - USER_HAS_SIGNED_UP(152,"user has signed up"), //用戶名已被註冊 - - INVALID_RESET_CODE(153,"invalid reset code"), //重置碼無效 - - INVALID_NICK(161,"invalid nick"), //昵稱不合法 - - INVALID_THIRD_TOKEN(162,"invalid third token"), //第三方token不合法 - - THIRD_ACCOUNT_HAVE_BIND(163,"the third account have bind"), //第三方賬戶已經綁定或之前已使用該賬戶登陸過系統 - - UNBIND_OPENID_NOT_MATCH(164,"unbind openId not match error" ), //賬戶解綁失敗 - - UNBIND_MAIN_ACCOUNT(165,"unbind main account error"), //解綁主賬戶錯誤 - - PARAMETERILLEGAL(166, "parameter illegal"), - - USER_NOT_EXISTED(167, "用戶不存在"), - - SUCCESS(200,"success"), //成功 - - INVALID_SERVICE(199,"invalid service"),//服務不可用 - SIGN_IP_TO_OFTEN(301,"註冊過於頻繁"),//註冊過於頻繁 - SMS_IP_TO_OFTEN(302,"獲取短信過於頻繁"),//獲取短信過於頻繁 - - ACCOUNT_ERROR(407,"用戶賬號異常,請聯繫官方客服"),//賬號異常-賬號被封 - DECEIVE_ERROR(408,"用戶賬號異常,請聯繫官方客服"),//賬號異常-設備被封 - - VERSION_ERROR(409,"版本過低,請升級版本"), - - UNKNOWN(999,"unknown"), //未知錯誤 - - ALREADY_BOUND(1799,"該賬號已經綁定過"), //缺少參數 - - ALREADY_BOUND_WEIXIN(1811,"該賬號已經綁定微信"), - - WEAK_PASSWORD(3001, "密碼必須使用6-16個字符內的數字和英文字母組合哦"), - - VERIFY_CODE_ERROR(3002, "驗證碼結果不正確"), - - CLOSE_SIGNUP_ERROR(3003, "需要更新版本才可以註冊哦"), - - APP_VERSION_TOO_OLD(3004, BusiStatus.VERSIONTOOOLD.getReasonPhrase()), - - SUPER_ADMIN_USER_ERROR(136, "超級管理員error:136"), - - INVALID_LOGIN_TYPE_ERROR(3004, "該賬號只允許通過ID登錄"), - - PHONE_BIND_TOO_MANY_ACCOUNT(3005, "該手機號存在多個ID的綁定關係,請聯繫公會運營處理"), - - PHONE_BIND_TOO_MANY_ACCOUNT2(25002, "該手機號存在多個ID的綁定關係,請輸入用戶ID進行登錄"), - - PHONE_BE_INTERCEPTED(3006, BusiStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()), - PASSWORD_ERROR(3007, "手機號或密碼錯誤"), - OLD_PASSWORD_ERROR(3008, "原密碼錯誤"), - - ACCOUNT_CANCEL(3009, "該賬號已註銷"), - ACCOUNT_CANCEL_INFO_NOT_EXIST(3010, "獲取不到賬號註銷信息"), - PWD_WRONG_OVER_LIMIT(3011, "密碼錯誤次數過多,請10分鐘后重試"), - - PHONE_BIND_ERROR(3012, "绑定手机号错误,请重新输入"), - ACCOUNT_NOT_BIND_PHONE(3013, "未绑定手机号"), - - ; - - - private final int value; - - private final String reasonPhrase; - - private OAuthStatus(int value, String reasonPhrase) { - this.value = value; - this.reasonPhrase = reasonPhrase; - } - - /** - * Return the integer value of this status code. - */ - public int value() { - return this.value; - } - - /** - * Return the reason phrase of this status code. - */ - public String getReasonPhrase() { - return reasonPhrase; - } - - /** - * Return a string representation of this status code. - */ - @Override - public String toString() { - return Integer.toString(value); - } - - @Override - public String getName() { - return name(); - } - - @Override - public int getCode() { - return value(); - } - - @Override - public String getMessage() { - return getReasonPhrase(); - } -} diff --git a/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/result/ServiceRes.java b/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/result/ServiceRes.java deleted file mode 100644 index fd213bc68..000000000 --- a/accompany-oauth2/accompany-oauth2-sdk/src/main/java/com/accompany/oauth2/result/ServiceRes.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.oauth2.result; - -import com.accompany.oauth2.constant.OAuthStatus; - -public class ServiceRes { - private int code; - private String message; - private T data; - - public ServiceRes(OAuthStatus status) { - this(status, null); - } - - public ServiceRes(OAuthStatus status, T data) { - this.code = status.value(); - this.message = status.getReasonPhrase(); - this.data = data; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } - - public T getData() { - return data; - } -} diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/exception/CustomOAuthExceptionJacksonSerializer.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/exception/CustomOAuthExceptionJacksonSerializer.java index a4f7477dd..bf67762ec 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/exception/CustomOAuthExceptionJacksonSerializer.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/exception/CustomOAuthExceptionJacksonSerializer.java @@ -1,7 +1,7 @@ package com.accompany.oauth2.exception; +import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.StringUtils; -import com.accompany.oauth2.constant.OAuthStatus; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; @@ -19,7 +19,7 @@ public class CustomOAuthExceptionJacksonSerializer extends StdSerializer= maxCount) { - throw new CustomOAuth2Exception(CustomOAuth2Exception.PWD_WRONG_OVER_LIMIT, OAuthStatus.PWD_WRONG_OVER_LIMIT.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.PWD_WRONG_OVER_LIMIT, BusiStatus.PWD_WRONG_OVER_LIMIT.getReasonPhrase()); } if (!password.equals(userDetails.getPassword())) { currCount = jedisService.hincrBy(cacheKey, username, 1L); @@ -280,7 +278,7 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService { jedisService.expire(cacheKey, 10 * 60);//10分钟后解锁 } if (currCount >= maxCount) { - throw new CustomOAuth2Exception(CustomOAuth2Exception.PWD_WRONG_OVER_LIMIT, OAuthStatus.PWD_WRONG_OVER_LIMIT.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.PWD_WRONG_OVER_LIMIT, BusiStatus.PWD_WRONG_OVER_LIMIT.getReasonPhrase()); } else { Long remainCount = maxCount - currCount; throw new CustomOAuth2Exception(CustomOAuth2Exception.PASSWORD_ERROR, String.format(BusiStatus.PASSWORD_ERROR_COUNT.getReasonPhrase(), remainCount)); diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountH5LoginService.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountH5LoginService.java index bae6af5d1..bf10d5336 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountH5LoginService.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountH5LoginService.java @@ -1,35 +1,19 @@ package com.accompany.oauth2.service.account; -import com.accompany.common.constant.ApplicationConstant; -import com.accompany.common.constant.Constant; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; -import com.accompany.common.exception.BusinessException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.CommonUtil; -import com.accompany.common.utils.UUIDUtil; import com.accompany.core.base.SpringContextHolder; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Account; -import com.accompany.core.model.AccountH5LoginRecord; -import com.accompany.core.mybatismapper.AccountH5LoginRecordMapper; import com.accompany.core.mybatismapper.AccountLoginRecordMapperExpand; -import com.accompany.core.service.account.AccountService; import com.accompany.core.service.common.JedisService; import com.accompany.core.util.JwtUtils; import com.accompany.oauth2.support.h5.H5TokenGranter; import com.accompany.oauth2.token.H5AccessToken; -import com.accompany.sms.service.SmsService; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.web.context.request.ServletWebRequest; -import java.util.Date; -import java.util.HashMap; import java.util.Map; /** @@ -41,127 +25,13 @@ public class AccountH5LoginService { private static final long H5_JWT_TOKEN_EX = 60 * 60 * 1000 * 2L; - /** - * code有效时间为10分钟 - **/ - private static final int CODE_EXPIRE_TIME = 60 * 10; - - @Autowired - private AccountH5LoginRecordMapper accountH5LoginRecordMapper; @Autowired private AccountLoginRecordMapperExpand accountLoginRecordMapperExpand; @Autowired private JedisService jedisService; - @Autowired - private AccountService accountService; - @Autowired - private AccountBlockCheckService accountBlockCheckService; - @Autowired - private SmsService smsService; - @Autowired private JwtUtils jwtUtils; - @Autowired - private AccountManageService accountManageService; - - public AccountH5LoginRecord buildRecord(Long uid, Byte loginType, String ip, String os, String appVersion, String deviceId) { - AccountH5LoginRecord accountH5LoginRecord = new AccountH5LoginRecord(); - accountH5LoginRecord.setUid(uid); - accountH5LoginRecord.setIp(ip); - accountH5LoginRecord.setOs(os); - accountH5LoginRecord.setAppVersion(appVersion); - accountH5LoginRecord.setDeviceId(deviceId); - accountH5LoginRecord.setLoginType(loginType); - accountH5LoginRecord.setCreateTime(new Date()); - return accountH5LoginRecord; - } - - @Async - public void insertRecord(AccountH5LoginRecord accountH5LoginRecord) { - accountH5LoginRecordMapper.insert(accountH5LoginRecord); - } - - //获取授权码 - public String getAuthCode() { - String code = UUIDUtil.get(); - // 设置code至缓存且设置有效期 - jedisService.write(RedisKey.h5_login_code.getKey(code), "null", CODE_EXPIRE_TIME); - return code; - } - - public String checkCodeIsUsed(String code) throws Exception { - String key = RedisKey.h5_login_code.getKey(code); - Boolean codeIsExist = jedisService.exits(key); - if (!codeIsExist) { - throw new BusinessException(BusiStatus.CODE_ILLEGAL.getReasonPhrase()); - } - String token = jedisService.get(key); - if (StringUtils.isEmpty(token) || ApplicationConstant.NULL_JSON_OBJECT.equals(token)) { - return null; - } else { - return token; - } - } - - /** - * 授权登录 - * - * @param code - * @param uid - */ - public void h5AuthLogin(String code, Long uid, String ip, String os, String appVersion, String deviceId) throws Exception { - String loginToken = UUIDUtil.get(); - jedisService.set(RedisKey.h5_login_code.getKey(code), loginToken); - jedisService.write(RedisKey.h5_login_token.getKey(loginToken), uid.toString(), CODE_EXPIRE_TIME); - AccountH5LoginRecord accountH5LoginRecord = this.buildRecord(uid, Constant.LoginAppType.ExchangeSys, ip, os, appVersion, deviceId); - this.insertRecord(accountH5LoginRecord); - } - - /** - * h5登录 - * - * @param token - */ - public Map h5Login(String token) throws Exception { - String uidStr = jedisService.get(RedisKey.h5_login_token.getKey(token)); - if (StringUtils.isEmpty(uidStr)) { - throw new ApiException(BusiStatus.USERNOTEXISTS); - } - Long uid = Long.valueOf(uidStr); - Account account = accountService.getById(uid); - if (account == null) { - throw new ApiException(BusiStatus.ACCOUNT_NOT_EXISTS); - } - accountBlockCheckService.checkBlockedAccount(account); - String jwtToken = createJwtToken(uid); - jedisService.hset(RedisKey.h5loginjwtoken.getKey(), account.getUid().toString(), jwtToken); - Map map = new HashMap<>(); - map.put("uid", uid.toString()); - map.put("token", jwtToken); - return map; - } - - public Map smsLogin(String mobile, String code) { - // 校验验证码 - if (!smsService.verifySmsCode(mobile, code)) { - throw new ServiceException(BusiStatus.SMSCODEERROR); - } - Account account = accountService.getAccountByPhone(mobile); - if (null == account) { - throw new ApiException(BusiStatus.ACCOUNT_NOT_EXISTS); - } - accountBlockCheckService.checkBlockedAccount(account); - // 生成jwtToken - Long uid = account.getUid(); - String jwtToken = createJwtToken(account.getUid()); - saveH5LoginJwtToken(uid, jwtToken); - Map map = new HashMap<>(); - map.put("uid", account.getUid().toString()); - map.put("token", jwtToken); - return map; - } - public String createJwtToken(Long uid) { return jwtUtils.createJWT(H5_JWT_TOKEN_EX, uid); } @@ -174,26 +44,6 @@ public class AccountH5LoginService { jedisService.hdel(RedisKey.h5loginjwtoken.getKey(), uid.toString()); } - public void register(String mobile, String code, String inviteCode, Long inviteUid, DeviceInfo deviceInfo, String ipAddress, String phoneAreaCode) { - // 校验验证码 - if (!smsService.verifySmsCode(mobile, code)) { - throw new ServiceException(BusiStatus.SMSCODEERROR); - } - Account account = accountService.getAccountByPhone(mobile); - if (null != account) { - throw new ServiceException(BusiStatus.PHONE_REGISTERED); - } - if (!CommonUtil.checkPhoneFormat(phoneAreaCode, mobile)) { - throw new ServiceException(BusiStatus.PHONEINVALID); - } - try { - accountManageService.saveSignUpByPhone(mobile, null, deviceInfo, inviteCode, inviteUid, ipAddress, phoneAreaCode); - } catch (Exception e) { - log.error("h5 注册失败。mobile:{}", mobile); - throw new ServiceException(BusiStatus.H5_REGISTER_ERROR.getReasonPhrase(), e); - } - } - /** * 创建h5令牌 * @@ -227,7 +77,7 @@ public class AccountH5LoginService { Integer isExists = accountLoginRecordMapperExpand.isExists(uid); if (isExists > 0) { deleteH5LoginJwtToken(uid); - throw new ApiException(BusiStatus.REGION_NOT_OPEN_UP); + throw new AdminServiceException(BusiStatus.REGION_NOT_OPEN_UP); } } return token; diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountManageService.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountManageService.java index ed0b6eda1..2aaf2a62b 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountManageService.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/service/account/AccountManageService.java @@ -3,7 +3,6 @@ package com.accompany.oauth2.service.account; import cn.hutool.core.util.ObjectUtil; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.BusinessException; import com.accompany.common.netease.neteaseacc.result.TokenRet; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; @@ -25,9 +24,7 @@ import com.accompany.core.service.common.JedisService; import com.accompany.core.service.user.UserCancelRecordService; import com.accompany.core.service.user.UsersBaseService; import com.accompany.core.util.MD5; -import com.accompany.core.vo.VisitorVo; import com.accompany.oauth2.constant.LoginTypeEnum; -import com.accompany.oauth2.constant.OAuthStatus; import com.accompany.oauth2.dto.IpMaxRegisterLimitConfig; import com.accompany.oauth2.event.UserRegisterSuccessEvent; import com.accompany.oauth2.exception.CustomOAuth2Exception; @@ -279,32 +276,6 @@ public class AccountManageService { return account; } - public VisitorVo genVisitorAccount() throws Exception { - String password = "visitoradmin999"; - Date date = new Date(); - Account account = new Account(); - account.setErbanNo(Constant.Visitor.visitorErbanNo); - account.setPassword(encryptPassword(password)); - account.setNeteaseToken(UUIDUtil.get()); - account.setLastLoginTime(date); - account.setUpdateTime(date); - account.setSignTime(date); - accountMapper.insert(account); - accountService.writeAche(account); - String uidStr = String.valueOf(account.getUid()); - TokenRet tokenRet = netEaseService.createNetEaseAcc(uidStr, account.getNeteaseToken(), ""); - if (tokenRet.getCode() != BusiStatus.SUCCESS.value()) { - log.error("获取游客账号异常code=" + tokenRet.getCode()); - throw new BusinessException("获取游客账号异常code=注册异常,异常原因code=" + tokenRet.getCode()); - } - VisitorVo visitorVo = new VisitorVo(); - visitorVo.setUid(account.getUid()); - visitorVo.setNetEaseToken(account.getNeteaseToken()); - visitorVo.setGender(new Byte("1")); - visitorVo.setNick("游客"); - return visitorVo; - } - /** * 重置密码 * 两个场景调用 => 客户端未登录 忘记密码, 此时uid 为 null 登录状态下忘记密码 uid有值 @@ -318,28 +289,28 @@ public class AccountManageService { if (phone.contains("*")) { Account account = accountService.getById(uid); if (account == null) { - throw new ServiceException(OAuthStatus.USER_NOT_EXISTED); + throw new ServiceException(BusiStatus.USER_NOT_EXISTED); } phone = account.getPhone(); if (!CommonUtil.checkPhoneFormat(account.getPhoneAreaCode(),account.getPhone())) { - throw new ServiceException(OAuthStatus.ACCOUNT_NOT_BIND_PHONE); + throw new ServiceException(BusiStatus.ACCOUNT_NOT_BIND_PHONE); } } int count = accountService.countByPhone(phone); if (count > 1) { - throw new ServiceException(OAuthStatus.PHONE_BIND_TOO_MANY_ACCOUNT); + throw new ServiceException(BusiStatus.PHONE_BIND_TOO_MANY_ACCOUNT); } Account account = accountService.getAccountByPhone(phone); if (null == account || (uid != null && !account.getUid().equals(uid)) ) { - throw new ServiceException(OAuthStatus.PHONE_BIND_ERROR); + throw new ServiceException(BusiStatus.PHONE_BIND_ERROR); } uid = account.getUid(); //检验验证码 if (!accountService.verifySmsCodeByCache(phone, resetCode, uid)){ - throw new ServiceException(OAuthStatus.INVALID_IDENTIFYING_CODE); + throw new ServiceException(BusiStatus.INVALID_IDENTIFYING_CODE); } accountService.resetAccountPwd(account.getUid(), password); @@ -355,13 +326,13 @@ public class AccountManageService { public void resetPasswordByOldPassword(String phone, String password, String newPassword) { Account account = accountService.getAccountByPhone(phone); if (null == account) { - throw new ServiceException(OAuthStatus.USER_NOT_EXISTED); + throw new ServiceException(BusiStatus.USER_NOT_EXISTED); } String oldPwd = account.getPassword(); password = encryptPassword(password); if (!StringUtils.hasText(password) || !password.equals(oldPwd)){ - throw new ServiceException(OAuthStatus.OLD_PASSWORD_ERROR); + throw new ServiceException(BusiStatus.OLD_PASSWORD_ERROR); } accountService.resetAccountPwd(account.getUid(), newPassword); @@ -381,12 +352,12 @@ public class AccountManageService { public void setupInitialPassword(Long uid, String password) { Account account = accountService.getById(uid); if (account == null) { - throw new ServiceException(OAuthStatus.INVALID_USER); + throw new ServiceException(BusiStatus.INVALID_USER); } Boolean result = accountService.updateAccountPwd(account.getUid(), password); if (!result){ - throw new ServiceException(OAuthStatus.INVALID_REQUEST); + throw new ServiceException(BusiStatus.INVALID_REQUEST); } // 更新用户缓存 @@ -410,12 +381,12 @@ public class AccountManageService { if (ObjectUtil.isNull(userCancelRecord)) { //获取不到注销账号信息 log.info("获取不到用户{}注销信息", uid); - throw new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_CANCEL_INFO_NOT_EXIST, OAuthStatus.ACCOUNT_CANCEL_INFO_NOT_EXIST.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_CANCEL_INFO_NOT_EXIST, BusiStatus.ACCOUNT_CANCEL_INFO_NOT_EXIST.getReasonPhrase()); } log.info("检测到注销账号{}昵称{}于{}尝试登录", users.getErbanNo(), userCancelRecord.getNick(), DateTimeUtil.convertDate(userCancelRecord.getUpdateTime())); - CustomOAuth2Exception exception = new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_CANCEL, OAuthStatus.ACCOUNT_CANCEL.getReasonPhrase()); + CustomOAuth2Exception exception = new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_CANCEL, BusiStatus.ACCOUNT_CANCEL.getReasonPhrase()); exception.addAdditionalInformation("erbanNo", String.valueOf(users.getErbanNo())); exception.addAdditionalInformation("cancelDate", String.valueOf(userCancelRecord.getUpdateTime().getTime())); exception.addAdditionalInformation("nick", userCancelRecord.getNick()); diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/PasswordH5TokenGranter.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/PasswordH5TokenGranter.java index 688dfe936..3d3c71dde 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/PasswordH5TokenGranter.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/PasswordH5TokenGranter.java @@ -2,7 +2,7 @@ package com.accompany.oauth2.support.h5; import cn.hutool.core.util.StrUtil; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.DESUtils; import com.accompany.core.util.KeyStore; import com.accompany.core.util.MD5; @@ -63,7 +63,7 @@ public class PasswordH5TokenGranter extends AbstractH5TokenGranter { userDetailsService.login(username, userDetails, LoginTypeEnum.PASSWORD, deviceInfo, code); } catch (Exception e) { log.error(e.getMessage(), e); - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } return accountH5LoginService.createH5AccessToken(((AccountDetails) userDetails).getAccount().getUid()); } diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/VerifyCodeH5TokenGranter.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/VerifyCodeH5TokenGranter.java index 38cb9ead0..4aa7d236c 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/VerifyCodeH5TokenGranter.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/h5/VerifyCodeH5TokenGranter.java @@ -2,11 +2,11 @@ package com.accompany.oauth2.support.h5; import cn.hutool.core.util.StrUtil; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; +import com.accompany.common.status.BusiStatus; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.service.user.PhoneBlackService; import com.accompany.oauth2.constant.GrantTypeEnum; import com.accompany.oauth2.constant.LoginTypeEnum; -import com.accompany.oauth2.constant.OAuthStatus; import com.accompany.oauth2.exception.CustomOAuth2Exception; import com.accompany.oauth2.model.AccountDetails; import com.accompany.oauth2.service.MyUserDetailsService; @@ -52,7 +52,7 @@ public class VerifyCodeH5TokenGranter extends AbstractH5TokenGranter { log.error(e.getMessage(), e); } if (phoneBlackService.checkIsNeedIntercept(phone)) { - throw new CustomOAuth2Exception(CustomOAuth2Exception.PHONE_BE_INTERCEPTED, OAuthStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.PHONE_BE_INTERCEPTED, BusiStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); } UserDetails userDetails = null; try { @@ -62,7 +62,7 @@ public class VerifyCodeH5TokenGranter extends AbstractH5TokenGranter { throw e; } catch (Exception e) { log.error(e.getMessage(), e); - throw new ApiException(e.getMessage()); + throw new AdminServiceException(e.getMessage()); } return accountH5LoginService.createH5AccessToken(((AccountDetails) userDetails).getAccount().getUid()); } diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java index 0534282c3..b80cc578b 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/password/PasswordAuthenticationProvider.java @@ -2,19 +2,17 @@ package com.accompany.oauth2.support.password; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; +import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.AppVersionUtil; import com.accompany.common.utils.DESUtils; import com.accompany.common.utils.StringUtils; import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; import com.accompany.core.service.user.PhoneBlackService; import com.accompany.core.util.KeyStore; import com.accompany.core.util.MD5; import com.accompany.oauth2.constant.LoginTypeEnum; -import com.accompany.oauth2.constant.OAuthStatus; import com.accompany.oauth2.exception.CustomOAuth2Exception; import com.accompany.oauth2.service.MyUserDetailsService; -import com.accompany.oauth2.service.account.AccountH5LoginService; import com.accompany.oauth2.util.RequestContextHolderUtils; import org.apache.commons.beanutils.BeanUtils; import org.slf4j.Logger; @@ -46,12 +44,6 @@ public class PasswordAuthenticationProvider implements AuthenticationProvider { @Autowired private PhoneBlackService phoneBlackService; - @Autowired - private AccountH5LoginService accountH5LoginService; - - @Autowired - private JedisService jedisService; - public PasswordAuthenticationProvider(MyUserDetailsService myUserDetailsService, SysConfService sysConfService) { this.myUserDetailsService = myUserDetailsService; this.sysConfService = sysConfService; @@ -79,7 +71,7 @@ public class PasswordAuthenticationProvider implements AuthenticationProvider { } } catch (Exception e) { throw new CustomOAuth2Exception(CustomOAuth2Exception.ACCOUNT_ERROR, - OAuthStatus.ACCOUNT_ERROR.getReasonPhrase()); + BusiStatus.ACCOUNT_ERROR.getReasonPhrase()); } String password = (String) authentication.getCredentials(); LoginTypeEnum loginTypeEnum = null; @@ -91,11 +83,11 @@ public class PasswordAuthenticationProvider implements AuthenticationProvider { // 低于1.5版本不能进行登录 String limitAppVersion = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.APP_VERSION_LIMIT, Constant.LOWEST_VERSION_FOR_USE); if (deviceInfo.getAppVersion() == null || AppVersionUtil.compareVersion(deviceInfo.getAppVersion(), limitAppVersion) < 0) { - throw new CustomOAuth2Exception(CustomOAuth2Exception.APP_VERSION_TOO_OLD, OAuthStatus.APP_VERSION_TOO_OLD.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.APP_VERSION_TOO_OLD, BusiStatus.APP_VERSION_TOO_OLD.getReasonPhrase()); } if (phoneBlackService.checkIsNeedIntercept(username)) { throw new CustomOAuth2Exception(CustomOAuth2Exception.PHONE_BE_INTERCEPTED, - OAuthStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); + BusiStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); } UserDetails userDetails; try { diff --git a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/verify/VerifyCodeAuthenticationProvider.java b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/verify/VerifyCodeAuthenticationProvider.java index 92cfdce83..b0f64fbf6 100644 --- a/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/verify/VerifyCodeAuthenticationProvider.java +++ b/accompany-oauth2/accompany-oauth2-service/src/main/java/com/accompany/oauth2/support/verify/VerifyCodeAuthenticationProvider.java @@ -1,9 +1,9 @@ package com.accompany.oauth2.support.verify; import com.accompany.common.device.DeviceInfo; +import com.accompany.common.status.BusiStatus; import com.accompany.core.service.user.PhoneBlackService; import com.accompany.oauth2.constant.LoginTypeEnum; -import com.accompany.oauth2.constant.OAuthStatus; import com.accompany.oauth2.exception.CustomOAuth2Exception; import com.accompany.oauth2.service.MyUserDetailsService; import com.accompany.oauth2.util.RequestContextHolderUtils; @@ -49,7 +49,7 @@ public class VerifyCodeAuthenticationProvider implements AuthenticationProvider log.error("populate deviceInfo fail", e); } if (phoneBlackService.checkIsNeedIntercept(phone)) { - throw new CustomOAuth2Exception(CustomOAuth2Exception.PHONE_BE_INTERCEPTED, OAuthStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); + throw new CustomOAuth2Exception(CustomOAuth2Exception.PHONE_BE_INTERCEPTED, BusiStatus.PHONE_BE_INTERCEPTED.getReasonPhrase()); } UserDetails userDetails = null; try { diff --git a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java index d7362da66..4bf957fda 100644 --- a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java +++ b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/common/BaseController.java @@ -66,7 +66,7 @@ public class BaseController { try { desInfo = DESUtils.DESAndBase64Decrypt(sensitiveInfo, KeyStore.DES_ENCRYPT_KEY); } catch (Exception e) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } return desInfo; } diff --git a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/AccountController.java b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/AccountController.java index 32928ca52..ac38536f6 100644 --- a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/AccountController.java +++ b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/AccountController.java @@ -2,17 +2,13 @@ package com.accompany.oauth2.controller; import com.accompany.common.constant.AppEnum; import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.BusinessException; -import com.accompany.common.redis.RedisKey; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.*; import com.accompany.oauth2.common.BaseController; import com.accompany.oauth2.config.OAuthConfig; import com.accompany.oauth2.constant.LoginTypeEnum; -import com.accompany.oauth2.constant.OAuthStatus; import com.accompany.oauth2.model.AccountDetails; -import com.accompany.oauth2.result.ServiceRes; import com.accompany.oauth2.service.MyUserDetailsService; import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; @@ -44,12 +40,12 @@ public class AccountController extends BaseController { @PostMapping("/logout") @ResponseBody - public ServiceRes logout(@RequestParam("access_token") String token) { + public BusiResult logout(@RequestParam("access_token") String token) { if (StringUtils.isBlank(token)) { - return new ServiceRes<>(OAuthStatus.INVALID_REQUEST); + return new BusiResult<>(BusiStatus.INVALID_REQUEST); } myUserDetailsService.logout(token); - return new ServiceRes<>(OAuthStatus.SUCCESS); + return BusiResult.success(); } @RequestMapping("/third/login") diff --git a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/H5LoginController.java b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/H5LoginController.java index f2971707a..65db36e5b 100644 --- a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/H5LoginController.java +++ b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/H5LoginController.java @@ -1,28 +1,18 @@ package com.accompany.oauth2.controller; -import com.accompany.common.annotation.Authorization; -import com.accompany.common.device.DeviceInfo; -import com.accompany.common.exception.ApiException; -import com.accompany.common.exception.BusinessException; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.IPUtils; -import com.accompany.common.utils.StringUtils; import com.accompany.oauth2.common.BaseController; -import com.accompany.oauth2.exception.CustomOAuth2Exception; import com.accompany.oauth2.service.account.AccountH5LoginService; import com.accompany.oauth2.token.H5AccessToken; -import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.ServletWebRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.Map; /** * Created by yuanyi on 2019/2/22. @@ -35,96 +25,6 @@ public class H5LoginController extends BaseController { @Autowired private AccountH5LoginService accountH5LoginService; - /** - * app授权登录 - * - * @param request - * @param code - * @param uid - * @return - */ - @Authorization - @RequestMapping(value = "/authorized/login", method = RequestMethod.POST) - public BusiResult loginAuthorizedByH5(HttpServletRequest request, @RequestParam String code, @RequestParam Long uid, @RequestBody DeviceInfo deviceInfo) { - log.info("h5 authorized login params is: code={},uid={},deviceInfo={}", code, uid, JSONObject.toJSON(deviceInfo)); - try { - String ip = IPUtils.getRealIpAddress(request); - this.accountH5LoginService.h5AuthLogin(code, uid, ip, deviceInfo.getOs(), deviceInfo.getAppVersion(), deviceInfo.getDeviceId()); - return new BusiResult<>(BusiStatus.SUCCESS); - } catch (CustomOAuth2Exception e) { - return new BusiResult<>(BusiStatus.ACCOUNT_ERROR); - } catch (BusinessException e) { - return new BusiResult<>(BusiStatus.SERVERERROR, e.getMessage(), null); - } catch (Exception e) { - log.error("h5 authorized login failed,param is: code={},uid={},deviceInfo={}", code, uid, JSONObject.toJSON(deviceInfo), e); - return new BusiResult<>(BusiStatus.BUSIERROR); - } - } - - /** - * 获取授权码 - * - * @return - */ - @GetMapping(value = "/code/get") - public BusiResult getAuthCode() { - String code = this.accountH5LoginService.getAuthCode(); - return new BusiResult<>(BusiStatus.SUCCESS, code); - } - - /** - * @param code - * @return - */ - @GetMapping(value = "/code/check") - public BusiResult checkCodeIsUsed(String code) { - if (StringUtils.isEmpty(code)) { - return new BusiResult<>(BusiStatus.PARAMERROR); - } - try { - String token = this.accountH5LoginService.checkCodeIsUsed(code); - if (StringUtils.isEmpty(token)) { - return new BusiResult<>(BusiStatus.SERVERERROR); - } - return new BusiResult<>(BusiStatus.SUCCESS, token); - } catch (BusinessException e) { - return new BusiResult<>(BusiStatus.SERVERERROR, e.getMessage()); - } catch (Exception e) { - return new BusiResult<>(BusiStatus.BUSIERROR); - } - } - - /** - * @param token - * @return - */ - @PostMapping(value = "/login") - public BusiResult> loginByToken(String token) { - try { - Map map = this.accountH5LoginService.h5Login(token); - log.info("h5 login ...... token={},result={}", token, JSONObject.toJSON(map)); - return new BusiResult<>(BusiStatus.SUCCESS, map); - } catch (CustomOAuth2Exception e) { - return new BusiResult<>(BusiStatus.ACCOUNT_ERROR); - } catch (Exception e) { - log.error("h5 login failed,token={}", token, e); - return new BusiResult<>(BusiStatus.BUSIERROR); - } - } - - /** - * 手机验证码H5登录 - * - * @param mobile - * @param code - * @return - */ - @PostMapping("/smsLogin") - public BusiResult> loginBySms(String mobile, String code) { - log.info("h5 smsLogin, mobile:{}, code:{}", mobile, code); - return new BusiResult<>(accountH5LoginService.smsLogin(mobile, code)); - } - /** * 授权登录 * diff --git a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/PwdController.java b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/PwdController.java index c04c4c057..1c1cef86a 100644 --- a/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/PwdController.java +++ b/accompany-oauth2/accompany-oauth2-web/src/main/java/com/accompany/oauth2/controller/PwdController.java @@ -1,6 +1,7 @@ package com.accompany.oauth2.controller; import com.accompany.common.annotation.Authorization; +import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DESUtils; import com.accompany.core.exception.ServiceException; @@ -8,14 +9,11 @@ import com.accompany.core.model.Account; import com.accompany.core.service.account.AccountService; import com.accompany.core.util.KeyStore; import com.accompany.oauth2.common.BaseController; -import com.accompany.oauth2.constant.OAuthStatus; -import com.accompany.oauth2.result.ServiceRes; import com.accompany.oauth2.service.account.AccountManageService; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.authentication.BadCredentialsException; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -45,7 +43,7 @@ public class PwdController extends BaseController { //@Authorization @PostMapping("/reset") @SneakyThrows - public ServiceRes resetPassword(HttpServletRequest request, + public BusiResult resetPassword(HttpServletRequest request, String phone, String newPwd, String smsCode) { if (StringUtils.isBlank(phone) || StringUtils.isBlank(newPwd) || StringUtils.isBlank(smsCode)){ throw new ServiceException(BusiStatus.PARAMERROR); @@ -57,24 +55,23 @@ public class PwdController extends BaseController { // 密码长度检查 if(!newPwd.matches(PASSWORD_REGIX_V2)){ - return new ServiceRes<>(OAuthStatus.WEAK_PASSWORD); + return new BusiResult<>(BusiStatus.WEAK_PASSWORD); } accountManageService.resetPasswordByResetCode(uid, phone, newPwd, smsCode); - return new ServiceRes<>(OAuthStatus.SUCCESS); + return new BusiResult<>(BusiStatus.SUCCESS); } /** * 设置新密码 - * @param uid * @param newPwd * @return */ @Authorization @PostMapping("/set") @SneakyThrows - public ServiceRes setupPassword(HttpServletRequest request, String newPwd) { + public BusiResult setupPassword(HttpServletRequest request, String newPwd) { Long uid = getUid(request); //加入密码DES解密 @@ -82,18 +79,18 @@ public class PwdController extends BaseController { // 密码长度检查 if(!newPwd.matches(PASSWORD_REGIX_V2)){ - return new ServiceRes<>(OAuthStatus.WEAK_PASSWORD); + return new BusiResult<>(BusiStatus.WEAK_PASSWORD); } accountManageService.setupInitialPassword(uid, newPwd); - return new ServiceRes<>(OAuthStatus.SUCCESS); + return new BusiResult<>(BusiStatus.SUCCESS); } @Authorization @PostMapping("/modify") @SneakyThrows - public ServiceRes modifyPassword(HttpServletRequest request, + public BusiResult modifyPassword(HttpServletRequest request, String pwd, String newPwd) { Long uid = getUid(request); @@ -104,17 +101,17 @@ public class PwdController extends BaseController { // 密码长度检查 if(!newPwd.matches(PASSWORD_REGIX_V2)){ - return new ServiceRes<>(OAuthStatus.WEAK_PASSWORD); + return new BusiResult<>(BusiStatus.WEAK_PASSWORD); } Account account = this.accountService.getById(uid); if (account == null) { - return new ServiceRes<>(OAuthStatus.INVALID_USER); + return new BusiResult<>(BusiStatus.INVALID_USER); } accountManageService.resetPasswordByOldPassword(account.getPhone(), pwd, newPwd); - return new ServiceRes<>(OAuthStatus.SUCCESS); + return new BusiResult<>(BusiStatus.SUCCESS); } } diff --git a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/ActivitiesCoupleTask.java b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/ActivitiesCoupleTask.java index 271a01ceb..befc9a02c 100644 --- a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/ActivitiesCoupleTask.java +++ b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/ActivitiesCoupleTask.java @@ -67,7 +67,7 @@ public class ActivitiesCoupleTask extends BaseTask { String lockVal = jedisLockService.lock(RedisKey.lock_user_crystal.getKey(uid.toString())); try { if (StringUtils.isBlank(lockVal)) { - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } UserPurse userPurse = userPurseService.queryUserPurse(uid); Double crystalNum = userPurse.getCrystals(); diff --git a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/LuckySeaActTask.java b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/LuckySeaActTask.java index 08168838a..12fc29e9a 100644 --- a/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/LuckySeaActTask.java +++ b/accompany-scheduler/accompany-scheduler-service/src/main/java/com/accompany/scheduler/task/activity/LuckySeaActTask.java @@ -105,7 +105,7 @@ public class LuckySeaActTask extends BaseTask implements InitializingBean, Runna locked = lock.tryLock(10, totalTime, TimeUnit.SECONDS); if (!locked){ log.error("春日游园活动, 获取锁失败"); - throw new ServiceException(BusiStatus.SERVER_BUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } boolean needCreateNewAct = true; diff --git a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/FlowTeamMemberInviteUserBizService.java b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/FlowTeamMemberInviteUserBizService.java index f0d0b55ab..de6c72755 100644 --- a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/FlowTeamMemberInviteUserBizService.java +++ b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/FlowTeamMemberInviteUserBizService.java @@ -10,7 +10,7 @@ */ package com.xuanyin.flowteam.service; -import com.accompany.common.exception.ApiException; +import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.StringUtils; import com.xuanyin.flowteam.constant.FlowTeamConstant; import com.xuanyin.flowteam.model.FlowTeamInfo; @@ -19,7 +19,6 @@ import com.xuanyin.flowteam.model.FlowTeamMemberInviteCode; import com.xuanyin.flowteam.model.FlowTeamMemberInviteUser; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -63,7 +62,7 @@ public class FlowTeamMemberInviteUserBizService { if (FlowTeamConstant.UserSourceType.SELF == source){ return; } - throw new ApiException("請輸入正確的邀請碼"); + throw new AdminServiceException("請輸入正確的邀請碼"); } Long memberId = flowTeamMemberInviteCode.getMemberId(); FlowTeamMember flowTeamMember = flowTeamMemberService.getById(memberId); diff --git a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/impl/FlowTeamSettlementInfoServiceImpl.java b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/impl/FlowTeamSettlementInfoServiceImpl.java index 9c5299654..95616d504 100644 --- a/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/impl/FlowTeamSettlementInfoServiceImpl.java +++ b/xuanyin-flow-team/xuanyin-flow-team-service/src/main/java/com/xuanyin/flowteam/service/impl/FlowTeamSettlementInfoServiceImpl.java @@ -76,7 +76,7 @@ public class FlowTeamSettlementInfoServiceImpl extends ServiceImpl