From 2e35bbedc0f8851b232f1673ca3aa47ebe5c4647 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 12 Nov 2025 11:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=AE=AD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/RocketConfigRestController.java | 2 - .../app/service/RocketConfigService.java | 42 ------- .../adapter/app/RocketRestController.java | 2 +- .../command/rocket/RocketLaunchCmdExe.java | 3 +- .../command/rocket/RocketStatusQryExe.java | 4 +- .../other/app/convertor/RocketConvertor.java | 111 ++++++++++++++++++ .../app/dto/cmd/RocketStatusQueryCmd.java | 9 +- .../RocketConfigDAO.java} | 6 +- .../RocketRewardClaimLogDAO.java} | 6 +- .../gateway/RocketConfigGatewayImpl.java | 14 +-- .../gateway/RocketRewardLogGatewayImpl.java | 14 +-- ...etConfigMapper.xml => RocketConfigDAO.xml} | 2 +- ...Mapper.xml => RocketRewardClaimLogDAO.xml} | 2 +- .../endpoint/rocket/RocketConfigEndpoint.java | 7 +- 14 files changed, 143 insertions(+), 81 deletions(-) delete mode 100644 rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/RocketConfigService.java create mode 100644 rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java rename rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/{RocketConfigMapper.java => rocket/RocketConfigDAO.java} (83%) rename rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/{RocketRewardClaimLogMapper.java => rocket/RocketRewardClaimLogDAO.java} (87%) rename rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/{RocketConfigMapper.xml => RocketConfigDAO.xml} (97%) rename rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/{RocketRewardClaimLogMapper.xml => RocketRewardClaimLogDAO.xml} (97%) diff --git a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/admin/RocketConfigRestController.java b/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/admin/RocketConfigRestController.java index 91b1d0e2..ef2209c3 100644 --- a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/admin/RocketConfigRestController.java +++ b/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/admin/RocketConfigRestController.java @@ -7,7 +7,6 @@ import com.red.circle.console.app.dto.clienobject.RocketConfigCO; import com.red.circle.console.app.dto.clienobject.RocketStatisticsCO; import com.red.circle.console.app.dto.cmd.RocketConfigQueryCmd; import com.red.circle.console.app.dto.cmd.RocketConfigUpdateCmd; -import com.red.circle.console.app.service.RocketConfigService; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -27,7 +26,6 @@ import java.util.List; @RequiredArgsConstructor public class RocketConfigRestController { - private final RocketConfigService rocketConfigService; private final RocketConfigUpdateExe rocketConfigUpdateExe; private final RocketStatisticsQueryExe rocketStatisticsQueryExe; private final RocketConfigQueryExe rocketConfigQueryExe; diff --git a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/RocketConfigService.java b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/RocketConfigService.java deleted file mode 100644 index 294f7551..00000000 --- a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/RocketConfigService.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.red.circle.console.app.service; - -import com.red.circle.console.app.dto.clienobject.RocketConfigCO; -import com.red.circle.console.app.dto.clienobject.RocketStatisticsCO; -import com.red.circle.console.app.dto.cmd.RocketConfigQueryCmd; -import com.red.circle.console.app.dto.cmd.RocketConfigUpdateCmd; - -import java.util.List; - -/** - * 火箭配置管理服务 - * - * @author system - * @date 2025-01-15 - */ -public interface RocketConfigService { - - /** - * 查询所有配置 - */ - List queryAll(RocketConfigQueryCmd cmd); - - /** - * 根据ID查询配置 - */ - RocketConfigCO queryById(Long id); - - /** - * 更新配置 - */ - void update(RocketConfigUpdateCmd cmd); - - /** - * 启用/禁用配置 - */ - void updateStatus(Long id, Integer status); - - /** - * 查询火箭数据统计 - */ - RocketStatisticsCO queryStatistics(); -} diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/RocketRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/RocketRestController.java index 0aa3103a..4c05b069 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/RocketRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/RocketRestController.java @@ -41,7 +41,7 @@ public class RocketRestController { /** * 手动触发发射 (测试用) */ - @PostMapping("/manual-launch") +// @PostMapping("/manual-launch") public void manualLaunch(@RequestParam Long roomId) { rocketService.manualLaunch(roomId); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketLaunchCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketLaunchCmdExe.java index 12c2b7bf..d36b3a9c 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketLaunchCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketLaunchCmdExe.java @@ -31,7 +31,6 @@ public class RocketLaunchCmdExe { private final RocketHistoryGateway rocketHistoryGateway; private final DistributedLockUtil distributedLockUtil; private final RocketImPushManager rocketImPushManager; - private final RocketConvertor rocketConvertor; /** * 执行火箭发射 @@ -93,7 +92,7 @@ public class RocketLaunchCmdExe { // 8. 推送发射动画消息 try { - RocketStatusCO statusCO = rocketConvertor.toStatusCO(rocketStatus); + RocketStatusCO statusCO = RocketConvertor.toStatusCO(rocketStatus); rocketImPushManager.pushRocketLaunch(roomId, statusCO); } catch (Exception e) { log.error("推送火箭发射消息失败: roomId={}", roomId, e); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java index 79dd9a8f..23447f36 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/rocket/RocketStatusQryExe.java @@ -51,8 +51,8 @@ public class RocketStatusQryExe { RocketStatusCO statusCO = convertToStatusCO(rocketStatus); // 3. 填充当前用户相关信息 - if (cmd.getCurrentUserId() != null) { - fillUserInfo(statusCO, rocketStatus, cmd.getCurrentUserId()); + if (cmd.getReqUserId() != null) { +// fillUserInfo(statusCO, rocketStatus, cmd.getReqUserId()); } return statusCO; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java new file mode 100644 index 00000000..7e89edae --- /dev/null +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/convertor/RocketConvertor.java @@ -0,0 +1,111 @@ +package com.red.circle.other.app.convertor; + +import com.red.circle.other.app.dto.clientobject.RocketContributorCO; +import com.red.circle.other.app.dto.clientobject.RocketStatusCO; +import com.red.circle.other.domain.rocket.RocketContributor; +import com.red.circle.other.domain.rocket.RocketStatus; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 火箭对象转换器 + * + * @author system + * @date 2025-01-15 + */ +public class RocketConvertor { + + /** + * Domain转StatusCO + */ + public static RocketStatusCO toStatusCO(RocketStatus rocketStatus) { + if (rocketStatus == null) { + return null; + } + + RocketStatusCO co = new RocketStatusCO(); + co.setRoomId(rocketStatus.getRoomId()); + co.setDate(rocketStatus.getDate()); + co.setLevel(rocketStatus.getLevel().getLevel()); + co.setLevelName(rocketStatus.getLevel().getName()); + co.setCurrentEnergy(rocketStatus.getCurrentEnergy()); + co.setMaxEnergy(rocketStatus.getMaxEnergy()); + + // 计算能量百分比 + if (rocketStatus.getMaxEnergy() != null && rocketStatus.getMaxEnergy() > 0) { + BigDecimal percent = BigDecimal.valueOf(rocketStatus.getCurrentEnergy()) + .divide(BigDecimal.valueOf(rocketStatus.getMaxEnergy()), 4, RoundingMode.HALF_UP) + .multiply(BigDecimal.valueOf(100)); + co.setEnergyPercent(percent); + } else { + co.setEnergyPercent(BigDecimal.ZERO); + } + + co.setStatus(rocketStatus.getStatus().name()); + co.setStatusDesc(rocketStatus.getStatus().getDesc()); + + // 转换贡献者列表 + if (rocketStatus.getContributors() != null) { + List contributorCOs = rocketStatus.getContributors().stream() + .map(RocketConvertor::toContributorCO) + .collect(Collectors.toList()); + co.setTopContributors(contributorCOs); + } else { + co.setTopContributors(new ArrayList<>()); + } + + co.setTotalContributors(rocketStatus.getContributors() != null + ? rocketStatus.getContributors().size() : 0); + co.setLaunchTime(rocketStatus.getLaunchTime()); + co.setClaimExpireTime(rocketStatus.getClaimExpireTime()); + co.setClaimCount(rocketStatus.getClaimCount()); + + // 判断是否可领取 + co.setCanClaim(rocketStatus.canClaim()); + + return co; + } + + /** + * Domain转ContributorCO + */ + public static RocketContributorCO toContributorCO(RocketContributor contributor) { + if (contributor == null) { + return null; + } + + RocketContributorCO co = new RocketContributorCO(); + co.setUserId(contributor.getUserId()); + co.setUserName(contributor.getUserName()); + co.setUserAvatar(contributor.getUserAvatar()); + co.setEnergy(contributor.getEnergy()); + co.setContributionRate(contributor.getContributionRate()); + co.setGiftCount(contributor.getGiftCount()); +// co.setRank(contributor.getEnergy()); + + return co; + } + + /** + * 转换贡献者列表(带排名) + */ + public static List toContributorCOList(List contributors) { + if (contributors == null || contributors.isEmpty()) { + return new ArrayList<>(); + } + + List coList = new ArrayList<>(); + for (int i = 0; i < contributors.size(); i++) { + RocketContributor contributor = contributors.get(i); + RocketContributorCO co = toContributorCO(contributor); + co.setRank(i + 1); // 设置排名 + coList.add(co); + } + + return coList; + } +} diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/RocketStatusQueryCmd.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/RocketStatusQueryCmd.java index 154a2bfc..a2e0d1c3 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/RocketStatusQueryCmd.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/RocketStatusQueryCmd.java @@ -1,7 +1,9 @@ package com.red.circle.other.app.dto.cmd; +import com.red.circle.common.business.dto.cmd.AppExtCommand; import jakarta.validation.constraints.NotNull; import lombok.Data; +import lombok.EqualsAndHashCode; /** * 火箭状态查询命令 @@ -9,8 +11,9 @@ import lombok.Data; * @author system * @date 2025-01-15 */ +@EqualsAndHashCode(callSuper = true) @Data -public class RocketStatusQueryCmd { +public class RocketStatusQueryCmd extends AppExtCommand { /** * 房间ID @@ -18,8 +21,4 @@ public class RocketStatusQueryCmd { @NotNull(message = "房间ID不能为空") private Long roomId; - /** - * 当前用户ID (可选,用于判断是否可领取) - */ - private Long currentUserId; } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketConfigMapper.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketConfigDAO.java similarity index 83% rename from rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketConfigMapper.java rename to rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketConfigDAO.java index 6078e388..55b66c6c 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketConfigMapper.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketConfigDAO.java @@ -1,7 +1,6 @@ -package com.red.circle.other.infra.database.rds.dao; +package com.red.circle.other.infra.database.rds.dao.rocket; import com.red.circle.other.infra.database.rds.entity.RocketConfigEntity; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,8 +11,7 @@ import java.util.List; * @author system * @date 2025-01-15 */ -@Mapper -public interface RocketConfigMapper { +public interface RocketConfigDAO { /** * 根据等级查询 diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketRewardClaimLogMapper.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketRewardClaimLogDAO.java similarity index 87% rename from rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketRewardClaimLogMapper.java rename to rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketRewardClaimLogDAO.java index d4658f36..fcdcb55f 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/RocketRewardClaimLogMapper.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/dao/rocket/RocketRewardClaimLogDAO.java @@ -1,7 +1,6 @@ -package com.red.circle.other.infra.database.rds.dao; +package com.red.circle.other.infra.database.rds.dao.rocket; import com.red.circle.other.infra.database.rds.entity.RocketRewardClaimLogEntity; -import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,8 +11,7 @@ import java.util.List; * @author system * @date 2025-01-15 */ -@Mapper -public interface RocketRewardClaimLogMapper { +public interface RocketRewardClaimLogDAO { /** * 插入 diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java index 831923be..8b217058 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketConfigGatewayImpl.java @@ -3,7 +3,7 @@ package com.red.circle.other.infra.gateway; import com.red.circle.other.domain.gateway.RocketConfigGateway; import com.red.circle.other.domain.rocket.RocketConfig; import com.red.circle.other.infra.convertor.RocketConfigConvertor; -import com.red.circle.other.infra.database.rds.dao.RocketConfigMapper; +import com.red.circle.other.infra.database.rds.dao.rocket.RocketConfigDAO; import com.red.circle.other.infra.database.rds.entity.RocketConfigEntity; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -23,18 +23,18 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class RocketConfigGatewayImpl implements RocketConfigGateway { - private final RocketConfigMapper rocketConfigMapper; + private final RocketConfigDAO rocketConfigDAO; private final RocketConfigConvertor rocketConfigConvertor; @Override public RocketConfig findByLevel(Integer level) { - RocketConfigEntity entity = rocketConfigMapper.selectByLevel(level); + RocketConfigEntity entity = rocketConfigDAO.selectByLevel(level); return rocketConfigConvertor.toRocketConfig(entity); } @Override public List findAll() { - List entities = rocketConfigMapper.selectAll(); + List entities = rocketConfigDAO.selectAll(); return entities.stream() .map(rocketConfigConvertor::toRocketConfig) .collect(Collectors.toList()); @@ -42,7 +42,7 @@ public class RocketConfigGatewayImpl implements RocketConfigGateway { @Override public List findAllEnabled() { - List entities = rocketConfigMapper.selectAllEnabled(); + List entities = rocketConfigDAO.selectAllEnabled(); return entities.stream() .map(rocketConfigConvertor::toRocketConfig) .collect(Collectors.toList()); @@ -51,13 +51,13 @@ public class RocketConfigGatewayImpl implements RocketConfigGateway { @Override public void save(RocketConfig config) { RocketConfigEntity entity = rocketConfigConvertor.toEntity(config); - rocketConfigMapper.insert(entity); + rocketConfigDAO.insert(entity); config.setId(entity.getId()); } @Override public void update(RocketConfig config) { RocketConfigEntity entity = rocketConfigConvertor.toEntity(config); - rocketConfigMapper.update(entity); + rocketConfigDAO.update(entity); } } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketRewardLogGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketRewardLogGatewayImpl.java index 7d2fed0e..871579b3 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketRewardLogGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/RocketRewardLogGatewayImpl.java @@ -3,7 +3,7 @@ package com.red.circle.other.infra.gateway; import com.red.circle.other.domain.gateway.RocketRewardLogGateway; import com.red.circle.other.domain.rocket.RocketRewardLog; import com.red.circle.other.infra.convertor.RocketRewardLogConvertor; -import com.red.circle.other.infra.database.rds.dao.RocketRewardClaimLogMapper; +import com.red.circle.other.infra.database.rds.dao.rocket.RocketRewardClaimLogDAO; import com.red.circle.other.infra.database.rds.entity.RocketRewardClaimLogEntity; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -23,26 +23,26 @@ import java.util.stream.Collectors; @RequiredArgsConstructor public class RocketRewardLogGatewayImpl implements RocketRewardLogGateway { - private final RocketRewardClaimLogMapper rocketRewardClaimLogMapper; + private final RocketRewardClaimLogDAO rocketRewardClaimLogDAO; private final RocketRewardLogConvertor rocketRewardLogConvertor; @Override public void save(RocketRewardLog log) { RocketRewardClaimLogEntity entity = rocketRewardLogConvertor.toEntity(log); - rocketRewardClaimLogMapper.insert(entity); + rocketRewardClaimLogDAO.insert(entity); log.setId(entity.getId()); } @Override public boolean existsByRocketAndUser(String rocketHistoryId, Long userId) { - int count = rocketRewardClaimLogMapper.countByRocketAndUser(rocketHistoryId, userId); + int count = rocketRewardClaimLogDAO.countByRocketAndUser(rocketHistoryId, userId); return count > 0; } @Override public List findByRocketHistoryId(String rocketHistoryId) { List entities = - rocketRewardClaimLogMapper.selectByRocketHistoryId(rocketHistoryId); + rocketRewardClaimLogDAO.selectByRocketHistoryId(rocketHistoryId); return entities.stream() .map(rocketRewardLogConvertor::toDomain) .collect(Collectors.toList()); @@ -51,7 +51,7 @@ public class RocketRewardLogGatewayImpl implements RocketRewardLogGateway { @Override public List findByRoomIdAndUserId(Long roomId, Long userId) { List entities = - rocketRewardClaimLogMapper.selectByRoomIdAndUserId(roomId, userId); + rocketRewardClaimLogDAO.selectByRoomIdAndUserId(roomId, userId); return entities.stream() .map(rocketRewardLogConvertor::toDomain) .collect(Collectors.toList()); @@ -59,6 +59,6 @@ public class RocketRewardLogGatewayImpl implements RocketRewardLogGateway { @Override public int countByRocketHistoryId(String rocketHistoryId) { - return rocketRewardClaimLogMapper.countByRocketHistoryId(rocketHistoryId); + return rocketRewardClaimLogDAO.countByRocketHistoryId(rocketHistoryId); } } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigMapper.xml b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigDAO.xml similarity index 97% rename from rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigMapper.xml rename to rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigDAO.xml index b74e7ec5..3deaa508 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigMapper.xml +++ b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketConfigDAO.xml @@ -1,6 +1,6 @@ - + diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogMapper.xml b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogDAO.xml similarity index 97% rename from rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogMapper.xml rename to rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogDAO.xml index 93c4db5d..7066126e 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogMapper.xml +++ b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/RocketRewardClaimLogDAO.xml @@ -1,6 +1,6 @@ - + diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/rocket/RocketConfigEndpoint.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/rocket/RocketConfigEndpoint.java index d5349b9a..0bffdf73 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/rocket/RocketConfigEndpoint.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/rocket/RocketConfigEndpoint.java @@ -1,5 +1,6 @@ package com.red.circle.other.app.inner.endpoint.rocket; +import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.framework.dto.ResultResponse; import com.red.circle.other.app.inner.convertor.RocketInnerConvertor; import com.red.circle.other.domain.gateway.RocketConfigGateway; @@ -54,7 +55,7 @@ public class RocketConfigEndpoint implements RocketConfigClientApi { // 通过等级查询(id就是等级) RocketConfig config = rocketConfigGateway.findByLevel(id.intValue()); if (config == null) { - return ResultResponse.failure("配置不存在"); + return ResultResponse.failure(CommonErrorCode.CONFIGURATION_ERROR); } return ResultResponse.success(rocketInnerConvertor.toDTO(config)); } @@ -63,7 +64,7 @@ public class RocketConfigEndpoint implements RocketConfigClientApi { public ResultResponse queryByLevel(Integer level) { RocketConfig config = rocketConfigGateway.findByLevel(level); if (config == null) { - return ResultResponse.failure("配置不存在"); + return ResultResponse.failure(CommonErrorCode.CONFIGURATION_ERROR); } return ResultResponse.success(rocketInnerConvertor.toDTO(config)); } @@ -79,7 +80,7 @@ public class RocketConfigEndpoint implements RocketConfigClientApi { public ResultResponse updateStatus(Long id, Integer status) { RocketConfig config = rocketConfigGateway.findByLevel(id.intValue()); if (config == null) { - return ResultResponse.failure("配置不存在"); + return ResultResponse.failure(CommonErrorCode.CONFIGURATION_ERROR); } config.setStatus(status); rocketConfigGateway.update(config);