多语言-修改VIP、小游戏、跨房PK小秘书消息
This commit is contained in:
@@ -10,7 +10,7 @@ public interface AccountLoginRecordMapperExpand {
|
||||
|
||||
Long countLoginDay(@Param("uid") Long uid, @Param("startDay") Date startDay, @Param("endDay") Date endDay);
|
||||
|
||||
List<Long> getRecentLoginUids(@Param("startDay") Date startDay);
|
||||
List<Long> getRecentLoginUids(@Param("startDay") Date startDay, @Param("partitionId") Integer partitionId);
|
||||
|
||||
List<String> listUserLoginDevice(Long uid);
|
||||
|
||||
|
@@ -33,6 +33,14 @@ import java.util.concurrent.TimeUnit;
|
||||
@Slf4j
|
||||
public class I18NMessageSourceUtil {
|
||||
|
||||
public static String getMessage(I18nAlertEnum msgEnum, Long uid){
|
||||
return getMessage(msgEnum, null, uid);
|
||||
}
|
||||
|
||||
public static String getMessage(I18nAlertEnum msgEnum, Integer partitionId){
|
||||
return getMessage(msgEnum, null, partitionId);
|
||||
}
|
||||
|
||||
public static String getMessage(I18nAlertEnum msgEnum, Object[] params, Long uid){
|
||||
Users u = SpringContextHolder.getBean(UsersBaseService.class).getUsersByUid(uid);
|
||||
if (null == u){
|
||||
|
@@ -8,7 +8,10 @@
|
||||
GROUP BY days) as a
|
||||
</select>
|
||||
<select id="getRecentLoginUids" resultType="java.lang.Long">
|
||||
SELECT DISTINCT(uid) FROM account_login_record WHERE create_time >= #{startDay}
|
||||
SELECT DISTINCT(uid) FROM account_login_record as alr
|
||||
left join users as u on u.uid = alr.uid
|
||||
WHERE alr.create_time >= #{startDay}
|
||||
and u.partition_id = #{partitionId}
|
||||
</select>
|
||||
<select id="listUserLoginDevice" resultType="java.lang.String">
|
||||
select device_id from account_login_record where uid = #{uid} group by device_id;
|
||||
|
@@ -2756,10 +2756,6 @@ public class Constant {
|
||||
public static class CrossRoomPkConstant {
|
||||
public static final Integer survive_val = 8;//单位小时
|
||||
public static final Integer auto_deny_val = 12;//单位秒
|
||||
public static final String auto_deny_msg_fmt = "%s向你的房間%s發送一條PK邀請,在10秒內未接受,視為自動拒絕。";
|
||||
public static final String deny_msg = "對方拒絕你的PK請求";
|
||||
public static final String accept_msg = "對方接收你的PK請求,PK準備中";
|
||||
public static final String room_notify_msg = "恭喜%s獲得勝利";
|
||||
//礼物价值兑换积分
|
||||
public static final Double gift_val_unit_rate = 1d;
|
||||
//pk结束,同类型房间公示PK结果所需的总分数
|
||||
@@ -2851,7 +2847,6 @@ public class Constant {
|
||||
}
|
||||
|
||||
public static class MiniGameConstant {
|
||||
public static final String deny_msg = "%s拒絕了你的邀請";
|
||||
|
||||
public static final String deny_job_sign = "mini_game_deny_job";//拒绝标识
|
||||
|
||||
|
@@ -24,6 +24,39 @@ public enum I18nAlertEnum {
|
||||
RED_ENVELOPE_AUTO_RESPOND("感謝%s的大紅包"),
|
||||
|
||||
RED_ENVELOPE_TIME_OUT_BACK("您的紅包'%s'已返還%s鑽石"),
|
||||
|
||||
RED_ENVELOPE_SEND_SERVER("%s發出一個全服紅包"),
|
||||
|
||||
//VIP
|
||||
|
||||
OPEN_VIP_SECRETARY_MESSAGE_CONTENT("恭喜你成功開通貴族,當前等級為%s,點擊查看%s升級要求>>>"),
|
||||
|
||||
VIP_LEVEL_UP_SECRETARY_MESSAGE_CONTENT("恭喜你的貴族身份成功從%s升級到%s,點擊查看所獲得的權限>>>"),
|
||||
|
||||
VIP_LEVEL_KEEP_SECRETARY_MESSAGE_CONTENT("恭喜!你的貴族權力值達到%s身份的保級要求,成功保級!"),
|
||||
|
||||
VIP_CANCEL_SECRETARY_MESSAGE_CONTENT("很遺憾你的貴族權力值未能達到保持貴族身份的要求,貴族身份已失效!重新開通貴族身份請點擊>>>"),
|
||||
|
||||
VIP_LEVEL_DOWN_SECRETARY_MESSAGE_CONTENT("很遺憾你的貴族權力值未到達%s身份的保級要求,現已降級為%s,請再接再厲哦~"),
|
||||
|
||||
VIP_LEVEL_UPDATE_SECRETARY_MESSAGE_CONTENT("您的貴族權益發生了變更,當前貴族等級已晉陞為【%s】!請前往貴族中心查看"),
|
||||
|
||||
VIP_RETURN_PROFIT_SECRETARY_MESSAGE_CONTENT("Hi!尊敬的貴族,您的返利鑽石已下發,可前往【貴族中心主頁】-【我的等級】-【返利特權】中領取>>"),
|
||||
|
||||
//个播
|
||||
NOTICE_FANS_MSG("您關注的主播 %s 正在開播,快去看看吧~"),
|
||||
|
||||
//跨房PK
|
||||
CROSS_ROOM_PK_AUTO_DENY_MSG_FMT("%s向你的房間%s發送一條PK邀請,在10秒內未接受,視為自動拒絕。"),
|
||||
|
||||
CROSS_ROOM_PK_DENY_MSG("對方拒絕你的PK請求"),
|
||||
|
||||
CROSS_ROOM_PK_ACCEPT_MSG("對方接收你的PK請求,PK準備中"),
|
||||
|
||||
CROSS_ROOM_PK_ROOM_NOTIFY_MSG("恭喜%s獲得勝利"),
|
||||
|
||||
MINI_GAME_DENY_MSG("%s拒絕了你的邀請"),
|
||||
|
||||
;
|
||||
|
||||
private final String defaultStr;
|
||||
|
@@ -12,11 +12,13 @@ import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -56,8 +58,6 @@ public class SingleBroadcastNoticeFansListener implements ApplicationListener<Si
|
||||
@Autowired
|
||||
private UserExpandService userExpandService;
|
||||
|
||||
|
||||
public static final String NOTICE_FANS_MSG = "您關注的主播 %s 正在開播,快去看看吧~";
|
||||
private ThreadLocal<Boolean> myThreadLocal = new ThreadLocal<>();
|
||||
|
||||
//每分钟最多允许批量发送的消息数
|
||||
@@ -169,9 +169,9 @@ public class SingleBroadcastNoticeFansListener implements ApplicationListener<Si
|
||||
batchParam.setType(0);
|
||||
batchParam.setFromAccid(SystemConfig.secretaryUid);
|
||||
batchParam.setToAccids(likeUidList);
|
||||
batchParam.setContent(String.format(NOTICE_FANS_MSG, user.getNick()));
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.NOTICE_FANS_MSG, new Object[]{user.getNick()}, user.getUid());
|
||||
batchParam.setContent(content);
|
||||
sendSysMsgService.sendBatchMsgMsg(batchParam);
|
||||
|
||||
//发送完成减1
|
||||
jedisService.hincrBy(RedisKey.limit_send_msg_min_num.getKey(), max_num_field, Long.valueOf(-1));
|
||||
updateSendMsgInfoCache(user.getUid());
|
||||
@@ -188,7 +188,8 @@ public class SingleBroadcastNoticeFansListener implements ApplicationListener<Si
|
||||
msg.setType(0);
|
||||
msg.setFrom(SystemConfig.secretaryUid);
|
||||
msg.setTo(likeUid);
|
||||
msg.setBody(String.format(NOTICE_FANS_MSG, user.getNick()));
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.NOTICE_FANS_MSG, new Object[]{user.getNick()}, user.getUid());
|
||||
msg.setBody(content);
|
||||
sendSysMsgService.sendMsg(msg);
|
||||
}
|
||||
|
||||
|
@@ -51,8 +51,8 @@ public class AccountLoginRecordService extends BaseService {
|
||||
/**
|
||||
* 获取最近时间登陆的用户id
|
||||
*/
|
||||
public List<Long> getRecentLoginUids(Date startDay) {
|
||||
return accountLoginRecordMapperExpand.getRecentLoginUids(startDay);
|
||||
public List<Long> getRecentLoginUids(Date startDay, Integer partitionId) {
|
||||
return accountLoginRecordMapperExpand.getRecentLoginUids(startDay, partitionId);
|
||||
}
|
||||
|
||||
public List<String> listUserLoginDevice(Long uid) {
|
||||
|
@@ -120,18 +120,6 @@ public class LuckyBagSendService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 小秘书通知
|
||||
*/
|
||||
public void secretaryNotify(Attach attach, String message) {
|
||||
Date startDate = DateTimeUtil.addDays(new Date(), -7);
|
||||
NeteaseSendMsgBatchParam param = new NeteaseSendMsgBatchParam();
|
||||
param.setType(0);
|
||||
param.setContent(message);
|
||||
sendSysMsgService.sendBatchPersonTextMsg(SystemConfig.secretaryUid,
|
||||
accountLoginRecordService.getRecentLoginUids(startDate), attach, null, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入赠送人礼物记录和账单
|
||||
*/
|
||||
|
@@ -20,12 +20,14 @@ import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -120,8 +122,7 @@ public class MiniGameInviteRecordServiceImpl extends ServiceImpl<MiniGameInviteR
|
||||
|
||||
Users replyUsers = usersBaseService.getUsersByUid(miniGameInviteRecord.getUid());
|
||||
if (ObjectUtil.isNull(replyUsers)) return;
|
||||
|
||||
String denyMsg = String.format(Constant.MiniGameConstant.deny_msg, replyUsers.getNick());
|
||||
String denyMsg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.MINI_GAME_DENY_MSG, new Object[]{replyUsers.getNick()}, miniGameInviteRecord.getRoomUid());
|
||||
|
||||
if (isAccept) {
|
||||
MiniGameRoom miniGameRoom = miniGameRoomService.queryMiniGameByRoomUid(miniGameInviteRecord.getRoomUid());
|
||||
@@ -159,8 +160,7 @@ public class MiniGameInviteRecordServiceImpl extends ServiceImpl<MiniGameInviteR
|
||||
Users replyUsers = usersBaseService.getUsersByUid(replyUid);
|
||||
|
||||
if (ObjectUtil.isNull(replyUsers)) return;
|
||||
|
||||
String msg = String.format(Constant.MiniGameConstant.deny_msg, replyUsers.getNick());
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.MINI_GAME_DENY_MSG, new Object[]{replyUsers.getNick()}, roomUid);
|
||||
crossRoomPkRoundService.sendMsgToDenyRoom(uidList, msg);
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,11 @@ import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.JsonUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.partition.PartitionInfoService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.accompany.core.vo.partition.UserPartitionInfoVo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -51,6 +55,9 @@ public class ServerGiftRedEnvelopeStrategy extends RedEnvelopeStrategy {
|
||||
@Autowired
|
||||
private AccountLoginRecordService accountLoginRecordService;
|
||||
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
|
||||
@Override
|
||||
public RedEnvelopTypeEnum type() {
|
||||
return RedEnvelopTypeEnum.GIFT;
|
||||
@@ -81,9 +88,12 @@ public class ServerGiftRedEnvelopeStrategy extends RedEnvelopeStrategy {
|
||||
sendSysMsgService.broadCastMsg(fromAccId, attachStr);
|
||||
|
||||
// Send private messages to all online users
|
||||
String message = user.getNick() + "發出一個全服紅包";
|
||||
Long sendUserId = sendRedEnvelopeDTO.getUserId();
|
||||
String message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.RED_ENVELOPE_SEND_SERVER, sendUserId);
|
||||
UserPartitionInfoVo partitionInfo = partitionInfoService.getVo(sendUserId);
|
||||
Integer partitionId = partitionInfo.getUserPartitionId();
|
||||
Date startDate = DateTimeUtil.addDays(new Date(), -7);
|
||||
List<Long> toAccids = accountLoginRecordService.getRecentLoginUids(startDate);
|
||||
List<Long> toAccids = accountLoginRecordService.getRecentLoginUids(startDate, partitionId);
|
||||
NeteaseSendMsgBatchParam neteaseSendMsgBatchParam = new NeteaseSendMsgBatchParam();
|
||||
Payload payload = new Payload();
|
||||
JSONObject data = new JSONObject();
|
||||
|
@@ -18,8 +18,12 @@ import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.JsonUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.partition.PartitionInfoService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.accompany.core.vo.partition.UserPartitionInfoVo;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -54,6 +58,9 @@ public class ServerGoldRedEnvelopeStrategy extends RedEnvelopeStrategy {
|
||||
@Autowired
|
||||
private AccountLoginRecordService accountLoginRecordService;
|
||||
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
|
||||
@Override
|
||||
public RedEnvelopTypeEnum type() {
|
||||
return RedEnvelopTypeEnum.DIAMOND;
|
||||
@@ -86,9 +93,12 @@ public class ServerGoldRedEnvelopeStrategy extends RedEnvelopeStrategy {
|
||||
sendSysMsgService.broadCastMsg(fromAccId, attachStr);
|
||||
|
||||
// Send private message to entire server
|
||||
String message = users.getNick() + "發出一個全服紅包";
|
||||
Long sendUserId = sendRedEnvelopeDTO.getUserId();
|
||||
String message = I18NMessageSourceUtil.getMessage(I18nAlertEnum.RED_ENVELOPE_SEND_SERVER, sendUserId);
|
||||
UserPartitionInfoVo partitionInfo = partitionInfoService.getVo(sendUserId);
|
||||
Integer partitionId = partitionInfo.getUserPartitionId();
|
||||
Date startDate = DateTimeUtil.addDays(new Date(), -7);
|
||||
List<Long> toAccids = accountLoginRecordService.getRecentLoginUids(startDate);
|
||||
List<Long> toAccids = accountLoginRecordService.getRecentLoginUids(startDate, partitionId);
|
||||
NeteaseSendMsgBatchParam neteaseSendMsgBatchParam = new NeteaseSendMsgBatchParam();
|
||||
Payload payload = new Payload();
|
||||
JSONObject data = new JSONObject();
|
||||
|
@@ -38,12 +38,14 @@ import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.base.DeviceInfoContextHolder;
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.common.JedisLockService;
|
||||
import com.accompany.core.service.common.JedisService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -289,9 +291,9 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl<CrossRoomPkRoundMap
|
||||
int num = crossRoomPkRecordService.dealAcceptOrDenyPkRecord(round.getId(), CrossRoomRecordStatusEnum.WAIT.getValue(), CrossRoomRecordStatusEnum.DENY.getValue(), operateUid);
|
||||
|
||||
if (num == 0) throw new ServiceException(BusiStatus.INVITE_TIME_OUT);
|
||||
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_DENY_MSG, inviteRoom.getUid());
|
||||
SpringContextHolder.getBean(CrossRoomPkRoundService.class).replyMsg(round.getId(), inviteRoom, inviteeRoom,
|
||||
Constant.CrossRoomPkConstant.deny_msg, false, null, null, inviteRoom.getUid(), round.getPkType());
|
||||
msg, false, null, null, inviteRoom.getUid(), round.getPkType());
|
||||
|
||||
jedisService.del(RedisKey.cross_room_ttl_auto_deny.getKey(String.valueOf(round.getId())));
|
||||
}
|
||||
@@ -383,10 +385,10 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl<CrossRoomPkRoundMap
|
||||
roomMicService.beginSingleRoomPkDownMic(inviteRoom.getRoomId());
|
||||
roomMicService.beginSingleRoomPkDownMic(inviteeRoom.getRoomId());
|
||||
}
|
||||
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_ACCEPT_MSG, inviteRoom.getUid());
|
||||
// 发送接受 跨房pk 消息
|
||||
SpringContextHolder.getBean(CrossRoomPkRoundService.class).replyMsg(round.getId(), inviteRoom, inviteeRoom,
|
||||
Constant.CrossRoomPkConstant.accept_msg, true, startTime.getTime(), round.getPlanEndTime().getTime(), inviteRoom.getUid(), round.getPkType());
|
||||
msg, true, startTime.getTime(), round.getPlanEndTime().getTime(), inviteRoom.getUid(), round.getPkType());
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager")
|
||||
@@ -1235,7 +1237,7 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl<CrossRoomPkRoundMap
|
||||
if (title.length() > maxWordsNum) {
|
||||
title = title.substring(0, maxWordsNum) + "...";
|
||||
}
|
||||
String msg = String.format(Constant.CrossRoomPkConstant.room_notify_msg, title);
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_ROOM_NOTIFY_MSG, new Object[]{title}, winRoom.getUid());
|
||||
try {
|
||||
Users winUsers = usersService.getUsersByUid(winRoom.getUid());
|
||||
Users anotherUsers = usersService.getUsersByUid(anotherRoom.getUid());
|
||||
@@ -1670,9 +1672,9 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl<CrossRoomPkRoundMap
|
||||
if (null == pkRound) {
|
||||
return;
|
||||
}
|
||||
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_DENY_MSG, inviteRoom.getUid());
|
||||
//回复拒绝消息
|
||||
SpringContextHolder.getBean(CrossRoomPkRoundService.class).replyMsg(roundId, inviteRoom, acceptRoom, Constant.CrossRoomPkConstant.deny_msg,
|
||||
SpringContextHolder.getBean(CrossRoomPkRoundService.class).replyMsg(roundId, inviteRoom, acceptRoom, msg,
|
||||
false, null, null, inviteOpt.get().getOperateUid(), pkRound.getPkType());
|
||||
}
|
||||
|
||||
@@ -1695,8 +1697,7 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl<CrossRoomPkRoundMap
|
||||
}
|
||||
uidList.add(String.valueOf(acceptRoom.getUid()));
|
||||
uidList = uidList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
String msg = String.format(Constant.CrossRoomPkConstant.auto_deny_msg_fmt, inviteRoom.getTitle(), acceptRoom.getTitle());
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_AUTO_DENY_MSG_FMT, new Object[]{inviteRoom.getTitle(), acceptRoom.getTitle()}, inviteRoom.getUid());
|
||||
SpringContextHolder.getBean(CrossRoomPkRoundService.class).sendMsgToDenyRoom(uidList, msg);
|
||||
}
|
||||
}
|
@@ -4,9 +4,11 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.accompany.business.model.miniGame.MiniGameInviteRecord;
|
||||
import com.accompany.business.service.miniGame.MiniGameInviteRecordService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.task.AbstractTaskService;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,7 +51,7 @@ public class MiniGameDenyTaskService extends AbstractTaskService {
|
||||
log.info("执行小游戏{}自动拒绝消息发送", inviteId);
|
||||
Users replyUsers = usersBaseService.getUsersByUid(miniGameInviteRecord.getUid());
|
||||
if (ObjectUtil.isNull(replyUsers)) return;
|
||||
String denyMsg = String.format(Constant.MiniGameConstant.deny_msg, replyUsers.getNick());
|
||||
String denyMsg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.MINI_GAME_DENY_MSG, new Object[]{replyUsers.getNick()}, miniGameInviteRecord.getRoomUid());
|
||||
miniGameInviteRecordService.replyMsg(miniGameInviteRecord, denyMsg, false);
|
||||
log.info("跨房小游戏自动拒绝结束....");
|
||||
} catch (Exception e) {
|
||||
|
@@ -27,8 +27,10 @@ import com.accompany.common.config.SystemConfig;
|
||||
import com.accompany.common.constant.Attach;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -66,36 +68,6 @@ public class VipMessageService {
|
||||
@Resource(name = "bizExecutor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
/**
|
||||
* 开通贵族小秘书消息
|
||||
*/
|
||||
private final static String OPEN_VIP_SECRETARY_MESSAGE_CONTENT = "恭喜你成功開通貴族,當前等級為%s,點擊查看%s升級要求>>>";
|
||||
|
||||
/**
|
||||
* 升级贵族小秘书消息
|
||||
*/
|
||||
private final static String VIP_LEVEL_UP_SECRETARY_MESSAGE_CONTENT = "恭喜你的貴族身份成功從%s升級到%s,點擊查看所獲得的權限>>>";
|
||||
|
||||
/**
|
||||
* 保级贵族小秘书消息
|
||||
*/
|
||||
private final static String VIP_LEVEL_KEEP_SECRETARY_MESSAGE_CONTENT = "恭喜!你的貴族權力值達到%s身份的保級要求,成功保級!";
|
||||
|
||||
/**
|
||||
* 撤销贵族小秘书消息
|
||||
*/
|
||||
private final static String VIP_CANCEL_SECRETARY_MESSAGE_CONTENT = "很遺憾你的貴族權力值未能達到保持貴族身份的要求,貴族身份已失效!重新開通貴族身份請點擊>>>";
|
||||
|
||||
/**
|
||||
* 降级贵族小秘书消息
|
||||
*/
|
||||
private final static String VIP_LEVEL_DOWN_SECRETARY_MESSAGE_CONTENT = "很遺憾你的貴族權力值未到達%s身份的保級要求,現已降級為%s,請再接再厲哦~";
|
||||
|
||||
private final static String VIP_LEVEL_UPDATE_SECRETARY_MESSAGE_CONTENT = "您的貴族權益發生了變更,當前貴族等級已晉陞為【%s】!請前往貴族中心查看";
|
||||
|
||||
private final static String VIP_RETURN_PROFIT_SECRETARY_MESSAGE_CONTENT = "Hi!尊敬的貴族,您的返利鑽石已下發,可前往【貴族中心主頁】-【我的等級】-【返利特權】中領取>>";
|
||||
|
||||
|
||||
/**
|
||||
* 一次性批量发送的房间数量
|
||||
**/
|
||||
@@ -256,7 +228,7 @@ public class VipMessageService {
|
||||
* @param uid
|
||||
*/
|
||||
private void sendOpenVipSecretaryMessage(Long uid, VipInfo vipInfo, VipInfo nextLevelVipInfo) {
|
||||
String content = String.format(OPEN_VIP_SECRETARY_MESSAGE_CONTENT, vipInfo.getVipName(), nextLevelVipInfo.getVipName());
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.OPEN_VIP_SECRETARY_MESSAGE_CONTENT, new Object[]{vipInfo.getVipName(), nextLevelVipInfo.getVipName()}, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -265,7 +237,7 @@ public class VipMessageService {
|
||||
if (StrUtil.isNotEmpty(vipName)) {
|
||||
vipName = vipName.replaceAll("Lv", "");
|
||||
}
|
||||
String content = String.format(VIP_LEVEL_UPDATE_SECRETARY_MESSAGE_CONTENT, vipName);
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_LEVEL_UPDATE_SECRETARY_MESSAGE_CONTENT, new Object[]{vipName}, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -285,7 +257,7 @@ public class VipMessageService {
|
||||
if (StrUtil.isNotEmpty(currVipName)) {
|
||||
currVipName = currVipName.replaceAll("Lv", "");
|
||||
}
|
||||
String content = String.format(VIP_LEVEL_UP_SECRETARY_MESSAGE_CONTENT, preVipName, currVipName);
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_LEVEL_UP_SECRETARY_MESSAGE_CONTENT, new Object[]{preVipName, currVipName}, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -296,7 +268,7 @@ public class VipMessageService {
|
||||
* @param currVipInfo
|
||||
*/
|
||||
private void sendLevelKeepSecretaryMessage(Long uid, VipInfo currVipInfo) {
|
||||
String content = String.format(VIP_LEVEL_KEEP_SECRETARY_MESSAGE_CONTENT, currVipInfo.getVipName());
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_LEVEL_KEEP_SECRETARY_MESSAGE_CONTENT, new Object[]{currVipInfo.getVipName()}, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -306,7 +278,7 @@ public class VipMessageService {
|
||||
* @param uid
|
||||
*/
|
||||
public void sendCancelVipSecretaryMessage(Long uid) {
|
||||
String content = VIP_CANCEL_SECRETARY_MESSAGE_CONTENT;
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_CANCEL_SECRETARY_MESSAGE_CONTENT, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -318,7 +290,7 @@ public class VipMessageService {
|
||||
public void sendLevelDownSecretaryMessage(Long uid, Integer preVipLevel, Integer afterLevel) {
|
||||
VipInfo preVipInfo = vipInfoService.getByVipLevel(preVipLevel);
|
||||
VipInfo currVipInfo = vipInfoService.getByVipLevel(afterLevel);
|
||||
String content = String.format(VIP_LEVEL_DOWN_SECRETARY_MESSAGE_CONTENT, preVipInfo.getVipName(), currVipInfo.getVipName());
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_LEVEL_DOWN_SECRETARY_MESSAGE_CONTENT, new Object[]{ preVipInfo.getVipName(), currVipInfo.getVipName()}, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
@@ -505,7 +477,8 @@ public class VipMessageService {
|
||||
}
|
||||
|
||||
public void sendVipReturnProfitSecretaryMessage(Long uid) {
|
||||
sendSecretaryMessage(uid, VIP_RETURN_PROFIT_SECRETARY_MESSAGE_CONTENT, VIP_RETURN_PROFIT_SECRETARY_MESSAGE_CONTENT, Constant.SecretarySkipType.MY_VIP, false);
|
||||
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.VIP_RETURN_PROFIT_SECRETARY_MESSAGE_CONTENT, uid);
|
||||
sendSecretaryMessage(uid, content, content, Constant.SecretarySkipType.MY_VIP, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,12 +27,14 @@ import com.accompany.common.redis.RedisKey;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
import com.accompany.common.utils.DateTimeUtil;
|
||||
import com.accompany.common.utils.UUIDUtil;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.exception.ServiceException;
|
||||
import com.accompany.core.model.Account;
|
||||
import com.accompany.core.model.Room;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.SysConfService;
|
||||
import com.accompany.core.service.account.AccountService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -143,7 +145,7 @@ public class CrossRoomPkTest extends CommonTest {
|
||||
Room winRoom = roomService.getRoomByUid(1003696l);
|
||||
Room anotherRoom = roomService.getRoomByUid(1003696l);
|
||||
|
||||
String msg = String.format(Constant.CrossRoomPkConstant.room_notify_msg, winRoom.getTitle());
|
||||
String msg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.CROSS_ROOM_PK_ROOM_NOTIFY_MSG, new Object[]{winRoom.getTitle()}, winRoom.getUid());
|
||||
|
||||
Users winUsers = usersService.getUsersByUid(winRoom.getUid());
|
||||
Users anotherUsers = usersService.getUsersByUid(anotherRoom.getUid());
|
||||
|
@@ -6,8 +6,10 @@ import com.accompany.business.model.miniGame.MiniGameInviteRecord;
|
||||
import com.accompany.business.mybatismapper.miniGame.MiniGameInviteRecordMapper;
|
||||
import com.accompany.business.service.miniGame.MiniGameInviteRecordService;
|
||||
import com.accompany.common.constant.Constant;
|
||||
import com.accompany.core.enumeration.I18nAlertEnum;
|
||||
import com.accompany.core.model.Users;
|
||||
import com.accompany.core.service.user.UsersBaseService;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -59,7 +61,7 @@ public class MiniGameDenyTask {
|
||||
|
||||
Users replyUsers = usersBaseService.getUsersByUid(miniGameInviteRecord.getUid());
|
||||
if (ObjectUtil.isNull(replyUsers)) return;
|
||||
String denyMsg = String.format(Constant.MiniGameConstant.deny_msg, replyUsers.getNick());
|
||||
String denyMsg = I18NMessageSourceUtil.getMessage(I18nAlertEnum.MINI_GAME_DENY_MSG, new Object[]{replyUsers.getNick()}, miniGameInviteRecord.getRoomUid());
|
||||
miniGameInviteRecordService.replyMsg(miniGameInviteRecord, denyMsg, false);
|
||||
|
||||
}catch(Exception e){
|
||||
|
Reference in New Issue
Block a user