消息增加昵称字段

This commit is contained in:
tianfeng 2025-11-13 19:33:26 +08:00
parent 172019c0b1
commit 20e7863461
4 changed files with 9 additions and 4 deletions

View File

@ -129,7 +129,7 @@ public class RocketLaunchCmdExe {
try { try {
List<LiveMicUserDTO> userDTOS = liveRoomUserClient.userList(roomId).getBody(); List<LiveMicUserDTO> userDTOS = liveRoomUserClient.userList(roomId).getBody();
userDTOS.forEach(userDTO -> { userDTOS.forEach(userDTO -> {
rocketRewardClaimCmdExe.executeAsync(roomId, roomAccount, userDTO.getId()); rocketRewardClaimCmdExe.executeAsync(roomId, roomAccount, userDTO.getId(), userDTO.getUserNickname());
}); });
} catch (Exception e) { } catch (Exception e) {
log.error("给所有在线的用户发送奖励失败: roomId={}", roomId, e); log.error("给所有在线的用户发送奖励失败: roomId={}", roomId, e);

View File

@ -15,6 +15,7 @@ import com.red.circle.other.domain.gateway.RocketConfigGateway;
import com.red.circle.other.domain.gateway.RocketHistoryGateway; import com.red.circle.other.domain.gateway.RocketHistoryGateway;
import com.red.circle.other.domain.gateway.RocketRewardLogGateway; import com.red.circle.other.domain.gateway.RocketRewardLogGateway;
import com.red.circle.other.domain.gateway.RocketStatusGateway; import com.red.circle.other.domain.gateway.RocketStatusGateway;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.domain.propcoupon.PropCouponSource; import com.red.circle.other.domain.propcoupon.PropCouponSource;
import com.red.circle.other.domain.rocket.*; import com.red.circle.other.domain.rocket.*;
import com.red.circle.other.infra.common.props.PropsSendCommon; import com.red.circle.other.infra.common.props.PropsSendCommon;
@ -62,6 +63,7 @@ public class RocketRewardClaimCmdExe {
private final BadgeBackpackClient badgeBackpackClient; private final BadgeBackpackClient badgeBackpackClient;
private final RocketHistoryGateway rocketHistoryGateway; private final RocketHistoryGateway rocketHistoryGateway;
private final PropsSendCommon propsSendCommon; private final PropsSendCommon propsSendCommon;
private final UserProfileGateway userProfileGateway;
private final Random random = new Random(); private final Random random = new Random();
/** /**
@ -79,7 +81,7 @@ public class RocketRewardClaimCmdExe {
* 无返回值静默领取 * 无返回值静默领取
*/ */
@Async("rocketRewardExecutor") @Async("rocketRewardExecutor")
public void executeAsync(Long roomId, String roomAccount, Long userId) { public void executeAsync(Long roomId, String roomAccount, Long userId, String userNickname) {
try { try {
log.debug("异步自动领取火箭奖励: roomId={}, userId={}", roomId, userId); log.debug("异步自动领取火箭奖励: roomId={}, userId={}", roomId, userId);
@ -95,6 +97,7 @@ public class RocketRewardClaimCmdExe {
map.put("cover", result.getCover()); map.put("cover", result.getCover());
map.put("rocketLevel", result.getRocketLevel()); map.put("rocketLevel", result.getRocketLevel());
map.put("userId", userId); map.put("userId", userId);
map.put("userNickname", userNickname);
imGroupClient.sendCustomMessage(roomAccount, imGroupClient.sendCustomMessage(roomAccount,
CustomGroupMsgBodyCmd.builder() CustomGroupMsgBodyCmd.builder()
.type(GroupMessageTypeEnum.ROCKET_REWARD_USER) .type(GroupMessageTypeEnum.ROCKET_REWARD_USER)

View File

@ -21,6 +21,7 @@ import com.red.circle.other.app.dto.cmd.room.UpdateRoomSettingCmd;
import com.red.circle.other.domain.gateway.user.UserProfileGateway; import com.red.circle.other.domain.gateway.user.UserProfileGateway;
import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway;
import com.red.circle.other.domain.model.user.NobleAbilityCO; import com.red.circle.other.domain.model.user.NobleAbilityCO;
import com.red.circle.other.domain.model.user.UserProfile;
import com.red.circle.other.infra.database.cache.service.other.RoomManagerCacheService; import com.red.circle.other.infra.database.cache.service.other.RoomManagerCacheService;
import com.red.circle.other.infra.database.cache.service.user.UserAgoraTokenCacheService; import com.red.circle.other.infra.database.cache.service.user.UserAgoraTokenCacheService;
import com.red.circle.other.infra.database.mongo.entity.live.RoomProfile; import com.red.circle.other.infra.database.mongo.entity.live.RoomProfile;
@ -128,7 +129,8 @@ public class RoomEnterCmdExe {
// 自动领取火箭奖励 // 自动领取火箭奖励
try { try {
rocketRewardClaimCmdExe.executeAsync(cmd.getRoomId(), manager.getRoomAccount(), cmd.getReqUserId()); UserProfile userProfile = userProfileGateway.getByUserId(cmd.getReqUserId());
rocketRewardClaimCmdExe.executeAsync(cmd.getRoomId(), manager.getRoomAccount(), cmd.getReqUserId(), userProfile.getUserNickname());
} catch (Exception e) { } catch (Exception e) {
log.error("触发自动领取火箭奖励失败: roomId={}, userId={}", cmd.getRoomId(), cmd.getReqUserId(), e); log.error("触发自动领取火箭奖励失败: roomId={}, userId={}", cmd.getRoomId(), cmd.getReqUserId(), e);
} }

View File

@ -55,7 +55,7 @@ public class RocketImPushManager {
imGroupClient.sendMessageBroadcast( imGroupClient.sendMessageBroadcast(
BroadcastGroupMsgBodyCmd.builder() BroadcastGroupMsgBodyCmd.builder()
.toPlatform(SysOriginPlatformEnum.LIKEI) .toPlatform(SysOriginPlatformEnum.LIKEI)
.type(GroupMessageTypeEnum.ROCKET_ENERGY_LAUNCH) // .type(GroupMessageTypeEnum.ROCKET_ENERGY_LAUNCH)
.data(status) .data(status)
.build() .build()
); );