新增周星接口

This commit is contained in:
tianfeng 2025-09-22 11:57:49 +08:00
parent d6200afa61
commit 4de0fb2dee
4 changed files with 65 additions and 5 deletions

View File

@ -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<ActivityResource> 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<FragmentsBackpackDTO> listByUserIdByFragmentsIds(@RequestParam("userId") Long userId,
@RequestParam("fragmentsIds") Set<Long> fragmentsIds) {
return weekStarService.listFragmentsByUserId(userId, fragmentsIds);
}
}

View File

@ -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<ActivityResource> listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum) {
return propsActivityClient.listActivityResource(sysOrigin, propsActivityTypeEnum).getBody();
}
public List<FragmentsBackpackDTO> listFragmentsByUserId(Long userId, Set<Long> fragmentsIds) {
return fragmentsBackpackClient.listByUserIdByFragmentsIds(userId, fragmentsIds).getBody();
}
}

View File

@ -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<ActivityResource> listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum) {
return weekStarExchangeExe.listActivityResource(sysOrigin, propsActivityTypeEnum);
}
@Override
public List<FragmentsBackpackDTO> listFragmentsByUserId(Long userId, Set<Long> fragmentsIds) {
return weekStarExchangeExe.listFragmentsByUserId(userId, fragmentsIds);
}
}

View File

@ -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<ActivityResource> listActivityResource(SysOriginPlatformEnum sysOrigin, PropsActivityTypeEnum propsActivityTypeEnum);
List<FragmentsBackpackDTO> listFragmentsByUserId(Long userId, Set<Long> fragmentsIds);
}