From 4de0fb2dee4eee7eae8955a1d473c75aacc69efd Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Mon, 22 Sep 2025 11:57:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=91=A8=E6=98=9F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/room/WeekStarRestController.java | 36 ++++++++++++++++--- .../command/activity/WeekStarExchangeExe.java | 11 ++++++ .../service/activity/WeekStarServiceImpl.java | 15 ++++++++ .../app/service/activity/WeekStarService.java | 8 +++++ 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekStarRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekStarRestController.java index f8dd75d4..8ae72b48 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekStarRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/activity/room/WeekStarRestController.java @@ -1,6 +1,8 @@ package com.red.circle.other.adapter.app.activity.room; +import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; import com.red.circle.common.business.dto.cmd.AppExtCommand; +import com.red.circle.framework.dto.ResultResponse; import com.red.circle.framework.web.controller.BaseController; import com.red.circle.other.app.dto.clientobject.activity.LastWeekStarGiftUserRankCO; import com.red.circle.other.app.dto.clientobject.activity.UserRankCO; @@ -11,14 +13,15 @@ import com.red.circle.other.app.dto.cmd.activity.WeekStarGiftQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarRankingQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarExchangeCmd; import com.red.circle.other.app.service.activity.WeekStarService; +import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; import java.util.List; +import java.util.Set; + +import com.red.circle.other.inner.model.dto.material.FragmentsBackpackDTO; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 周星活动. @@ -50,7 +53,7 @@ public class WeekStarRestController extends BaseController { /** * 奖励列表. - * + * @eo.name 奖励列表 * @eo.url /reward * @eo.method get @@ -152,4 +155,27 @@ public class WeekStarRestController extends BaseController { return weekStarService.exchange(cmd); } + /** + * 周星兑换活动资源. + * @param sysOrigin 平台信息 + * @return 活动资源组信息 + */ + @GetMapping("/listActivityResource") + public List listActivityResource(@RequestParam("sysOrigin") SysOriginPlatformEnum sysOrigin) { + return weekStarService.listActivityResource(sysOrigin, PropsActivityTypeEnum.STAR_EXCHANGE); + } + + /** + * 用户碎片背包 数量大于0 + * @param userId 用户id + * @param fragmentsIds 碎片id + * @return 背包 + */ + @PostMapping("/list/by/user-id") + public List listByUserIdByFragmentsIds(@RequestParam("userId") Long userId, + @RequestParam("fragmentsIds") Set fragmentsIds) { + return weekStarService.listFragmentsByUserId(userId, fragmentsIds); + } + + } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/WeekStarExchangeExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/WeekStarExchangeExe.java index 913ca293..1ee4fb6d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/WeekStarExchangeExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/activity/WeekStarExchangeExe.java @@ -14,10 +14,13 @@ import com.red.circle.other.infra.common.activity.send.SendRewardParam; import com.red.circle.other.infra.database.mongo.entity.game.egg.GameEggStockConfig; import com.red.circle.other.infra.database.rds.entity.game.GameUserShardsBackpack; import com.red.circle.other.inner.endpoint.activity.PropsActivityClient; +import com.red.circle.other.inner.endpoint.material.props.FragmentsBackpackClient; import com.red.circle.other.inner.endpoint.material.props.api.FragmentsBackpackClientApi; +import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.material.PrizeDescribe; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; +import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; import com.red.circle.other.inner.model.dto.activity.props.ActivityRewardProps; import com.red.circle.other.inner.model.dto.material.FragmentsBackpackDTO; import lombok.RequiredArgsConstructor; @@ -39,6 +42,7 @@ public class WeekStarExchangeExe { private final FragmentsBackpackClientApi fragmentsBackpackClientApi; private final PropsActivitySendCommon sendPropsManager; private final PropsActivityClient propsActivityClient; + private final FragmentsBackpackClient fragmentsBackpackClient; public Long execute(WeekStarExchangeCmd cmd) { @@ -111,4 +115,11 @@ public class WeekStarExchangeExe { return List.of(prize); } + public List listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum) { + return propsActivityClient.listActivityResource(sysOrigin, propsActivityTypeEnum).getBody(); + } + + public List listFragmentsByUserId(Long userId, Set fragmentsIds) { + return fragmentsBackpackClient.listByUserIdByFragmentsIds(userId, fragmentsIds).getBody(); + } } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekStarServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekStarServiceImpl.java index 38eee108..20058c4f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekStarServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/activity/WeekStarServiceImpl.java @@ -1,5 +1,6 @@ package com.red.circle.other.app.service.activity; +import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; import com.red.circle.common.business.dto.cmd.AppExtCommand; import com.red.circle.common.business.enums.WeekLeaderboardEnum; import com.red.circle.other.app.command.activity.query.LastWeekFirstPlaceQueryExe; @@ -18,11 +19,15 @@ import com.red.circle.other.app.dto.clientobject.gift.GiftConfigCO; import com.red.circle.other.app.dto.cmd.activity.WeekStarGiftQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarRankingQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarExchangeCmd; +import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.enums.activity.WeekStarGiftTypeEnum; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; +import com.red.circle.other.inner.model.dto.material.FragmentsBackpackDTO; import com.red.circle.tool.core.collection.CollectionUtils; import java.util.List; import java.util.Objects; +import java.util.Set; + import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -100,4 +105,14 @@ public class WeekStarServiceImpl implements WeekStarService { public Long exchange(WeekStarExchangeCmd cmd) { return weekStarExchangeExe.execute(cmd); } + + @Override + public List listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum) { + return weekStarExchangeExe.listActivityResource(sysOrigin, propsActivityTypeEnum); + } + + @Override + public List listFragmentsByUserId(Long userId, Set fragmentsIds) { + return weekStarExchangeExe.listFragmentsByUserId(userId, fragmentsIds); + } } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekStarService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekStarService.java index 4ed9dc2d..998723f4 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekStarService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/activity/WeekStarService.java @@ -1,6 +1,7 @@ package com.red.circle.other.app.service.activity; +import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; import com.red.circle.common.business.dto.cmd.AppExtCommand; import com.red.circle.other.app.dto.clientobject.activity.LastWeekStarGiftUserRankCO; import com.red.circle.other.app.dto.clientobject.activity.UserRankCO; @@ -10,8 +11,12 @@ import com.red.circle.other.app.dto.clientobject.gift.GiftConfigCO; import com.red.circle.other.app.dto.cmd.activity.WeekStarGiftQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarRankingQueryCmd; import com.red.circle.other.app.dto.cmd.activity.WeekStarExchangeCmd; +import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; +import com.red.circle.other.inner.model.dto.material.FragmentsBackpackDTO; + import java.util.List; +import java.util.Set; /** * 周星相关接口. @@ -47,4 +52,7 @@ public interface WeekStarService { */ Long exchange(WeekStarExchangeCmd cmd); + List listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum); + + List listFragmentsByUserId(Long userId, Set fragmentsIds); }