swagger 推广后台 优化对战百佳历史接口
This commit is contained in:
-7
@@ -32,8 +32,6 @@ import com.ruoyi.game.mahjong.mapper.MahjongRoundMapper;
|
||||
import com.ruoyi.game.mahjong.repository.MahjongCycleRepository;
|
||||
import com.ruoyi.game.mahjong.repository.MahjongRewardPoolCacheRepository;
|
||||
import com.ruoyi.game.mahjong.service.MahjongDistributionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -49,7 +47,6 @@ import java.util.stream.Collectors;
|
||||
* 与玫瑰女郎逐行同构,差异:只有 normal 一个模式、桶 16 档、封顶 500x、game_type = MAHJONG。
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "麻将胡了后台")
|
||||
@RestController
|
||||
@RequestMapping("/admin/mahjong")
|
||||
public class MahjongAdminController extends BaseController {
|
||||
@@ -71,7 +68,6 @@ public class MahjongAdminController extends BaseController {
|
||||
|
||||
// ==================== 箱子配置 ====================
|
||||
|
||||
@ApiOperation("箱子列表(含各身份目标/实时 RTP 与一轮总回合)")
|
||||
@GetMapping("/box/list")
|
||||
public R boxList(@RequestParam(defaultValue = "1") int pageNum,
|
||||
@RequestParam(defaultValue = "10") int pageSize,
|
||||
@@ -154,7 +150,6 @@ public class MahjongAdminController extends BaseController {
|
||||
}
|
||||
|
||||
/** 某箱某身份的桶分布:含 convergeCount(收敛账本) + fixedRounds/convergeRounds(按该身份分布反推) */
|
||||
@ApiOperation("某箱某身份的倍率桶分布")
|
||||
@GetMapping("/box/buckets/{boxId}")
|
||||
public R boxBuckets(@PathVariable Long boxId,
|
||||
@RequestParam(required = false, defaultValue = "common") String audience) {
|
||||
@@ -174,7 +169,6 @@ public class MahjongAdminController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "箱子配置", action = "保存", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("保存某箱某身份的倍率桶分布(items 为固定池回合,反推回写总回合)")
|
||||
@PostMapping("/box/buckets/save")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R boxBucketsSave(@RequestBody Map<String, Object> params) {
|
||||
@@ -189,7 +183,6 @@ public class MahjongAdminController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "箱子配置", action = "重算分布", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("按目标 RTP 重算某箱某身份分布")
|
||||
@PostMapping("/box/buckets/calc")
|
||||
public R calcDistribution(@RequestBody Map<String, Object> params) {
|
||||
Long boxId = asLong(params.get("boxId"));
|
||||
|
||||
-7
@@ -19,8 +19,6 @@ import com.ruoyi.game.mahjong.mapper.MahjongPrizeOrnamentMapper;
|
||||
import com.ruoyi.game.mahjong.mapper.MahjongRecordMapper;
|
||||
import com.ruoyi.game.mahjong.service.MahjongGameService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,7 +28,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/** 客户端接口:Base = {host}/api/mahjong,全部 POST + JSON + token 鉴权(对齐设计方案 §7) */
|
||||
@Slf4j
|
||||
@Api(tags = "麻将胡了游戏")
|
||||
@RestController
|
||||
@RequestMapping("/api/mahjong")
|
||||
public class MahjongClientController extends BaseController {
|
||||
@@ -44,7 +41,6 @@ public class MahjongClientController extends BaseController {
|
||||
/** 进行中的局不展示:结算时 settle_source=start,播完末帧才改 finish;超过单局缓存 TTL(30分钟) 视为已结束兜底 */
|
||||
private static final long IN_PROGRESS_MS = 30 * 60 * 1000L;
|
||||
|
||||
@ApiOperation("获取箱子列表")
|
||||
@PostMapping("/boxes")
|
||||
public R boxes() {
|
||||
List<MahjongBox> list = boxMapper.selectList(new LambdaQueryWrapper<MahjongBox>()
|
||||
@@ -65,7 +61,6 @@ public class MahjongClientController extends BaseController {
|
||||
return R.ok(Map.of("list", boxes));
|
||||
}
|
||||
|
||||
@ApiOperation("执行旋转(新游戏或继续游戏)")
|
||||
@PostMapping("/dospin")
|
||||
public R dospin(@RequestBody SpinRequest req) {
|
||||
Long userId = getUserId();
|
||||
@@ -91,7 +86,6 @@ public class MahjongClientController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询游戏记录(分页;scope: 0全服/1我的,默认1我的;只含已播完的局)")
|
||||
@PostMapping("/records")
|
||||
public R records(@RequestBody(required = false) RecordPageRequest req) {
|
||||
Long userId = getUserId();
|
||||
@@ -169,7 +163,6 @@ public class MahjongClientController extends BaseController {
|
||||
return exterior == null || exterior.isEmpty() ? name : name + " (" + exterior + ")";
|
||||
}
|
||||
|
||||
@ApiOperation("查询是否有进行中的游戏(断线重连)")
|
||||
@PostMapping("/hasActive")
|
||||
public R hasActive() {
|
||||
Long userId = getUserId();
|
||||
|
||||
-15
@@ -15,8 +15,6 @@ import com.ruoyi.game.wheel.constants.WheelPoolType;
|
||||
import com.ruoyi.game.wheel.service.AdminWheelService;
|
||||
import com.ruoyi.game.wheel.vo.WheelBetRecordVO;
|
||||
import com.ruoyi.game.wheel.vo.WheelPoolAdjustmentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -27,7 +25,6 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "疯狂转盘")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/wheel")
|
||||
@@ -57,20 +54,17 @@ public class AdminWheelController extends BaseController {
|
||||
@Autowired
|
||||
private GameWheelPoolAdjustmentMapper poolAdjustmentMapper;
|
||||
|
||||
@ApiOperation("获取疯狂转盘游戏配置")
|
||||
@GetMapping("/gameconfig")
|
||||
public AjaxResult getGameConfig() {
|
||||
return adminWheelService.getGameConfig();
|
||||
}
|
||||
|
||||
@Log(title = "游戏配置", action = "保存", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("更新疯狂转盘游戏配置")
|
||||
@PostMapping("/gameconfig")
|
||||
public AjaxResult updateGameConfig(@RequestBody String body) {
|
||||
return adminWheelService.updateGameConfig(body);
|
||||
}
|
||||
|
||||
@ApiOperation("回合记录列表")
|
||||
@GetMapping("/round/list")
|
||||
public TableDataInfo roundList(
|
||||
@RequestParam(required = false) String date,
|
||||
@@ -88,7 +82,6 @@ public class AdminWheelController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("投注记录列表")
|
||||
@GetMapping("/bet/list")
|
||||
public TableDataInfo betList(
|
||||
@RequestParam(required = false) Long roundId,
|
||||
@@ -101,7 +94,6 @@ public class AdminWheelController extends BaseController {
|
||||
|
||||
// ======================== 奖励矩阵 CRUD ========================
|
||||
|
||||
@ApiOperation("奖励矩阵列表")
|
||||
@GetMapping("/matrix/list")
|
||||
public AjaxResult matrixList(
|
||||
@RequestParam(required = false) Integer betAmount,
|
||||
@@ -120,7 +112,6 @@ public class AdminWheelController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "奖励矩阵", action = "保存", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("保存奖励矩阵行")
|
||||
@PostMapping("/matrix/save")
|
||||
public AjaxResult matrixSave(@RequestBody GameWheelRewardMatrix matrix) {
|
||||
GameWheelRewardMatrix exist = matrix.getId() == null ? null : rewardMatrixMapper.selectById(matrix.getId());
|
||||
@@ -145,7 +136,6 @@ public class AdminWheelController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "奖励矩阵", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除奖励矩阵行(软删:置 status=0)")
|
||||
@DeleteMapping("/matrix/delete/{id}")
|
||||
public AjaxResult matrixDelete(@PathVariable Long id) {
|
||||
rewardMatrixMapper.update(null, new LambdaUpdateWrapper<GameWheelRewardMatrix>()
|
||||
@@ -156,7 +146,6 @@ public class AdminWheelController extends BaseController {
|
||||
|
||||
// ======================== 奖池统计 ========================
|
||||
|
||||
@ApiOperation("奖池统计")
|
||||
@GetMapping("/pool/stats")
|
||||
public AjaxResult poolStats() {
|
||||
return AjaxResult.success(adminWheelService.buildPoolStats());
|
||||
@@ -165,7 +154,6 @@ public class AdminWheelController extends BaseController {
|
||||
// ======================== 奖池调节 ========================
|
||||
|
||||
@Log(title = "游戏配置", action = "调整奖池", businessType = BusinessType.GRANT)
|
||||
@ApiOperation("奖池调整(注水/抽水)")
|
||||
@PostMapping("/pool/adjust")
|
||||
@RepeatSubmit(interval = 3000)
|
||||
public AjaxResult adjustPool(@RequestBody Map<String, Object> params) {
|
||||
@@ -173,7 +161,6 @@ public class AdminWheelController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "游戏配置", action = "重置奖池", businessType = BusinessType.CLEAN)
|
||||
@ApiOperation("重置奖池(累计统计与余额一起归零)")
|
||||
@PostMapping("/pool/reset")
|
||||
public AjaxResult resetPool(@RequestBody(required = false) Map<String, Object> params) {
|
||||
Map<String, Object> p = params == null ? Collections.emptyMap() : params;
|
||||
@@ -182,7 +169,6 @@ public class AdminWheelController extends BaseController {
|
||||
return adminWheelService.resetPool(poolType, reason, getUsername());
|
||||
}
|
||||
|
||||
@ApiOperation("奖池调整记录")
|
||||
@GetMapping("/pool/adjustLog")
|
||||
public TableDataInfo adjustLog(@RequestParam(required = false) String poolType) {
|
||||
startPage();
|
||||
@@ -211,7 +197,6 @@ public class AdminWheelController extends BaseController {
|
||||
return target;
|
||||
}
|
||||
|
||||
@ApiOperation("获取奖池余额(含人工调整)")
|
||||
@GetMapping("/pool/balance")
|
||||
public AjaxResult getPoolBalance(@RequestParam(required = false) String poolType) {
|
||||
if (StringUtils.isEmpty(poolType)) {
|
||||
|
||||
-8
@@ -18,8 +18,6 @@ import com.ruoyi.game.wheel.contract.api.response.GetRoundResultsResponse;
|
||||
import com.ruoyi.game.wheel.service.ApiWheelService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.user.service.ApiUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -29,7 +27,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import java.util.Map;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "疯狂转盘")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/wheel")
|
||||
@@ -55,7 +52,6 @@ public class ApiWheelController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("投注")
|
||||
@PostMapping("/dobet")
|
||||
// 这里**不加** @RepeatSubmit:一局允许同一组合重复下注(最多 50 注),连点两次 5 元 = 两注,
|
||||
// 是正常玩法而不是重复提交;加了会把第二次合法下注挡成"不允许重复提交"。
|
||||
@@ -82,7 +78,6 @@ public class ApiWheelController extends BaseController {
|
||||
return apiWheelService.doBet(request, userId);
|
||||
}
|
||||
|
||||
@ApiOperation("获取最新一期游戏状态")
|
||||
@PostMapping("/last_round_info")
|
||||
public R<GetRoundInfoResponse> getLastRoundInfo(@RequestBody GetLastRoundInfoRequest request) {
|
||||
R loginCheck = checkLogin();
|
||||
@@ -91,7 +86,6 @@ public class ApiWheelController extends BaseController {
|
||||
return apiWheelService.getLastRoundInfo(userId);
|
||||
}
|
||||
|
||||
@ApiOperation("获取玩家的游戏历史记录")
|
||||
@PostMapping("/history_bet_info")
|
||||
public R<GetRoundHistoryResponse> getHistoryBetInfo(@RequestBody GetHistoryBetRequest request) {
|
||||
R loginCheck = checkLogin();
|
||||
@@ -100,7 +94,6 @@ public class ApiWheelController extends BaseController {
|
||||
return apiWheelService.getHistoryBetInfo(request, userId);
|
||||
}
|
||||
|
||||
@ApiOperation("获取疯狂转盘游戏历史记录")
|
||||
@PostMapping("/round_history_bet_info")
|
||||
public R<GetRoundHistoryResponse> getRoundHistoryBetInfo(@RequestBody GetRoundHistoryRequest request) {
|
||||
R loginCheck = checkLogin();
|
||||
@@ -109,7 +102,6 @@ public class ApiWheelController extends BaseController {
|
||||
return apiWheelService.getRoundHistoryInfo(request);
|
||||
}
|
||||
|
||||
@ApiOperation("获取历史开奖结果(每一轮的开奖符号)")
|
||||
@PostMapping("/round_results")
|
||||
public R<GetRoundResultsResponse> getRoundResults(@RequestBody GetRoundResultsRequest request) {
|
||||
R loginCheck = checkLogin();
|
||||
|
||||
@@ -41,19 +41,6 @@
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger3依赖 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>io.swagger</groupId>-->
|
||||
<!-- <artifactId>swagger-models</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
-7
@@ -5,15 +5,12 @@ import com.ruoyi.reward.contract.admin.request.AdjustRewardPoolRequest;
|
||||
import com.ruoyi.reward.contract.admin.response.QueryGlobalRewardConfig;
|
||||
import com.ruoyi.reward.model.GloalRewardConfig;
|
||||
import com.ruoyi.reward.service.GlobalRewardPoolService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Api(tags = "全局奖池配置")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/globalrewardpool")
|
||||
@@ -21,7 +18,6 @@ public class AdminGlobalRewardPoolController {
|
||||
@Autowired
|
||||
private GlobalRewardPoolService globalRewardPoolService;
|
||||
|
||||
@ApiOperation("获取奖池配置和状态")
|
||||
@GetMapping("/config")
|
||||
public R<QueryGlobalRewardConfig> getGameConfig() {
|
||||
var config = globalRewardPoolService.getGameConfig();
|
||||
@@ -37,7 +33,6 @@ public class AdminGlobalRewardPoolController {
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@ApiOperation("更新奖池配置")
|
||||
@PostMapping("/config")
|
||||
public R<Void> updateGameConfig(@RequestBody GloalRewardConfig params) {
|
||||
String msg = globalRewardPoolService.updateGameConfig(params);
|
||||
@@ -46,14 +41,12 @@ public class AdminGlobalRewardPoolController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("重置奖池缓存")
|
||||
@PostMapping("/reset")
|
||||
public R<?> resetRewardPool() {
|
||||
globalRewardPoolService.resetCache();
|
||||
return R.ok(null, "奖池缓存已清空");
|
||||
}
|
||||
|
||||
@ApiOperation("调整奖池(抽水/放水)")
|
||||
@PostMapping("/adjust")
|
||||
public R<?> adjustRewardPool(@RequestBody AdjustRewardPoolRequest req) {
|
||||
if (req.getAmount() == null || req.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
|
||||
-4
@@ -14,7 +14,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
import com.ruoyi.domain.entity.TtBlankCardKey;
|
||||
import com.ruoyi.domain.entity.TtRechargeProd;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -40,7 +39,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 获取充值产品列表(金额选项)
|
||||
*/
|
||||
@ApiOperation("获取充值产品列表")
|
||||
@GetMapping("/rechargeList")
|
||||
public R<List<TtRechargeProd>> getRechargeList() {
|
||||
List<TtRechargeProd> list = rechargeProdMapper.selectList(
|
||||
@@ -52,7 +50,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 生成空白卡密(管理后台,不扣余额)
|
||||
*/
|
||||
@ApiOperation("生成空白卡密")
|
||||
@PostMapping("/generate")
|
||||
public R<List<String>> generate(@RequestBody java.util.Map<String, Object> request) {
|
||||
Integer rechargeListId = (Integer) request.get("rechargeListId");
|
||||
@@ -99,7 +96,6 @@ public class AdminBlankCardKeyController extends BaseController {
|
||||
/**
|
||||
* 获取空白卡密列表
|
||||
*/
|
||||
@ApiOperation("获取空白卡密列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<TtBlankCardKey>> list(
|
||||
@RequestParam(required = false) String usedByName,
|
||||
|
||||
-7
@@ -9,8 +9,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.entity.TtLossRebate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -22,7 +20,6 @@ import java.util.List;
|
||||
* 数据由定时任务 lossRebateService.generateHalfMonthLossRebate() 每半月写入,
|
||||
* 本页只做「查看 + 对超过单期上限的用户人工发放CDK」。
|
||||
*/
|
||||
@Api(tags = "管理端 亏损返水")
|
||||
@RestController
|
||||
@RequestMapping("/admin/lossRebate")
|
||||
public class LossRebateController extends BaseController {
|
||||
@@ -33,7 +30,6 @@ public class LossRebateController extends BaseController {
|
||||
this.lossRebateService = lossRebateService;
|
||||
}
|
||||
|
||||
@ApiOperation("亏损返水结算明细列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtLossRebate> list(@RequestParam(required = false) String period,
|
||||
@RequestParam(required = false) Integer userId,
|
||||
@@ -45,21 +41,18 @@ public class LossRebateController extends BaseController {
|
||||
|
||||
@Log(title = "亏损返水", action = "发放CDK", businessType = BusinessType.GRANT,
|
||||
entityClass = TtLossRebate.class, mapperClass = TtLossRebateMapper.class, idField = "id")
|
||||
@ApiOperation("人工发放CDK(超过单期上限/自动发放失败的记录)")
|
||||
@PostMapping("/grant")
|
||||
public R<String> grant(@RequestBody GrantRequest request) {
|
||||
if (request == null || request.getId() == null) return R.fail("缺少明细ID");
|
||||
return lossRebateService.grantManually(request.getId(), request.getAmount(), getUsername());
|
||||
}
|
||||
|
||||
@ApiOperation("读取单期返水上限")
|
||||
@GetMapping("/config")
|
||||
public AjaxResult getConfig() {
|
||||
return AjaxResult.success(lossRebateService.getMaxAmount());
|
||||
}
|
||||
|
||||
@Log(title = "亏损返水", action = "保存上限", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("保存单期返水上限(返水超过该金额不自动发放,转人工;0=不设上限)")
|
||||
@PostMapping("/config")
|
||||
public AjaxResult saveConfig(@RequestParam(required = false) BigDecimal maxAmount) {
|
||||
lossRebateService.saveMaxAmount(maxAmount);
|
||||
|
||||
-6
@@ -12,15 +12,12 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "管理端 商城管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopping")
|
||||
public class ShoppingController extends BaseController {
|
||||
@@ -34,7 +31,6 @@ public class ShoppingController extends BaseController {
|
||||
this.ornamentsService = ornamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("商品列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<ShoppingDataVO> list(ShoppingBody shoppingBody) {
|
||||
startPage();
|
||||
@@ -65,7 +61,6 @@ public class ShoppingController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "商城列表", action = "一键上架", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("一键上架所有商品")
|
||||
@PostMapping("/putAwayAll")
|
||||
public R<Boolean> putAwayAll() {
|
||||
LambdaUpdateWrapper<TtOrnament> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
@@ -82,7 +77,6 @@ public class ShoppingController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "商城列表", action = "一键下架", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("一键下架所有商品")
|
||||
@PostMapping("/soldOutAll")
|
||||
public R<Boolean> soldOutAll() {
|
||||
LambdaUpdateWrapper<TtOrnament> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
-12
@@ -20,8 +20,6 @@ import com.ruoyi.domain.other.TtBoxBody;
|
||||
import com.ruoyi.domain.vo.BoxPoolStatisticsVO;
|
||||
import com.ruoyi.domain.vo.TtBoxDataVO;
|
||||
import com.ruoyi.domain.vo.box.TtBoxUserVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -38,7 +36,6 @@ import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 宝箱管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/box")
|
||||
public class TtBoxController extends BaseController {
|
||||
@@ -57,7 +54,6 @@ public class TtBoxController extends BaseController {
|
||||
return success();
|
||||
}
|
||||
|
||||
@ApiOperation("获取宝箱列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtBoxDataVO> list(TtBoxBody ttBoxBody) {
|
||||
startPage();
|
||||
@@ -80,14 +76,12 @@ public class TtBoxController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "宝箱列表", action = "修改", businessType = BusinessType.UPDATE)
|
||||
@ApiOperation("修改宝箱")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtBoxDataVO ttBoxDataVO) {
|
||||
String msg = boxService.updateTtBoxById(ttBoxDataVO);
|
||||
return StringUtils.isEmpty(msg) ? AjaxResult.success() : AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
@ApiOperation("清空当前奖池")
|
||||
@GetMapping("clearPrizePool/{boxId}")
|
||||
public R clearPrizePool(@PathVariable("boxId") Integer boxId) {
|
||||
|
||||
@@ -110,27 +104,23 @@ public class TtBoxController extends BaseController {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱统计(按奖池/开箱人类型拆分)")
|
||||
@GetMapping("/statisticsBoxData/{boxId}")
|
||||
public R<List<BoxPoolStatisticsVO>> statisticsBoxData(@PathVariable Integer boxId, @RequestParam(required = false) Date date) {
|
||||
List<BoxPoolStatisticsVO> poolStatistics = boxService.statisticsBoxData(boxId, date);
|
||||
return R.ok(poolStatistics);
|
||||
}
|
||||
|
||||
@ApiOperation("添加宝箱三级爆率玩家范围")
|
||||
@PostMapping("/createTtBoxThirdExplosiveUsers")
|
||||
public AjaxResult createTtBoxThirdExplosiveUsers(@RequestBody TtBoxUserVO ttBoxUserVO) {
|
||||
String msg = boxService.createTtBoxThirdExplosiveUsers(ttBoxUserVO);
|
||||
return StringUtils.isEmpty(msg) ? AjaxResult.success() : AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
@ApiOperation("查询宝箱三级爆率玩家范围")
|
||||
@GetMapping("/queryTtBoxThirdExplosiveUsers/{boxId}")
|
||||
public AjaxResult queryBoxUsers(@PathVariable Integer boxId) {
|
||||
return boxService.queryTtBoxThirdExplosiveUsers(boxId);
|
||||
}
|
||||
|
||||
@ApiOperation("删除宝箱三级爆率玩家范围")
|
||||
@PostMapping("/deleteTtBoxThirdExplosiveUsers")
|
||||
public AjaxResult deleteTtBoxThirdExplosiveUsers(@RequestBody TtBoxUserVO ttBoxUserVO) {
|
||||
return boxService.deleteTtBoxThirdExplosiveUsers(ttBoxUserVO);
|
||||
@@ -143,13 +133,11 @@ public class TtBoxController extends BaseController {
|
||||
util.exportExcel(response, list.getRows(), "宝箱列表");
|
||||
}
|
||||
|
||||
@ApiOperation("查询开箱临时爆率队列")
|
||||
@GetMapping("/mockresult/list")
|
||||
public R<List<BoxMockCache.MockItem>> getBoxMockResult(@RequestParam("uid") Integer uid) {
|
||||
return R.ok(boxMockService.getMockResultList(uid));
|
||||
}
|
||||
|
||||
@ApiOperation("设置开箱临时爆率队列")
|
||||
@PostMapping("/mockresult/list")
|
||||
public R<List<BoxMockCache.MockItem>> updateBoxMockResult(@RequestBody BoxMockRequest request) {
|
||||
return R.ok(boxMockService.updateMockResultList(request));
|
||||
|
||||
-6
@@ -12,8 +12,6 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -26,7 +24,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 宝箱物品")
|
||||
@RestController
|
||||
@RequestMapping("/admin/boxOrnaments")
|
||||
public class TtBoxOrnamentsController extends BaseController {
|
||||
@@ -37,7 +34,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
this.boxOrnamentsService = boxOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱物品详情")
|
||||
@GetMapping("/list/{boxId}")
|
||||
public PageDataInfo<TtBoxOrnamentsDataVO> list(@PathVariable("boxId") Integer boxId) {
|
||||
// 在分页之前算总数(避免PageHelper干扰百分比计算)
|
||||
@@ -48,7 +44,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("宝箱统计数据")
|
||||
@GetMapping("/globalData/{boxId}")
|
||||
public R globalData(@PathVariable("boxId") Integer boxId) {
|
||||
return boxOrnamentsService.globalData(boxId);
|
||||
@@ -123,7 +118,6 @@ public class TtBoxOrnamentsController extends BaseController {
|
||||
}
|
||||
@Log(title = "宝箱列表", action = "批量填货", businessType = BusinessType.INSERT)
|
||||
// 宝箱填货
|
||||
@ApiOperation("宝箱填货")
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody batchAddParam param) {
|
||||
return boxOrnamentsService.batchAdd(param);
|
||||
|
||||
-5
@@ -20,7 +20,6 @@ import com.ruoyi.domain.common.constant.UserType;
|
||||
import com.ruoyi.domain.entity.TtUserBlendErcash;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.vo.user.TtUserVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -48,7 +47,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@ApiOperation("获取卡商列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtUserVo> cardMerchantList(
|
||||
@RequestParam(required = false) Integer userId,
|
||||
@@ -86,7 +84,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
|
||||
@Log(title = "卡商充值", action = "确认充值", businessType = BusinessType.GRANT,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("卡商充值(管理员给卡商增加余额)")
|
||||
@PostMapping("/recharge")
|
||||
public AjaxResult cardMerchantRecharge(@RequestBody Map<String, Object> params) {
|
||||
Integer userId = (Integer) params.get("userId");
|
||||
@@ -154,7 +151,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
|
||||
@Log(title = "卡商充值", action = "确认修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("修改卡商余额(直接设为指定值,按差额写审计流水)")
|
||||
@PostMapping("/updateBalance")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult cardMerchantUpdateBalance(@RequestBody Map<String, Object> params) {
|
||||
@@ -234,7 +230,6 @@ public class TtCardMerchantController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("卡商充值记录")
|
||||
@GetMapping("/rechargeLog")
|
||||
public PageDataInfo<TtUserBlendErcash> cardMerchantRechargeLog(@RequestParam(required = false) Integer userId) {
|
||||
LambdaQueryChainWrapper<TtUserBlendErcash> wrapper = new LambdaQueryChainWrapper<>(blendErcashMapper);
|
||||
|
||||
-7
@@ -11,13 +11,10 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 发货管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/deliverGoods")
|
||||
public class TtDeliveryRecordController extends BaseController {
|
||||
@@ -28,7 +25,6 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
this.deliveryRecordService = deliveryRecordService;
|
||||
}
|
||||
|
||||
@ApiOperation("发货申请列表")
|
||||
@GetMapping("/getDeliveryApplyList")
|
||||
public PageDataInfo<DeliveryApplyVO> getDeliveryApplyList(TtDeliveryApplyBody deliveryApplyBody) {
|
||||
startPage();
|
||||
@@ -36,7 +32,6 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("退回发货申请")
|
||||
@PostMapping("/deliveryFail")
|
||||
public R<Boolean> deliveryFail(@RequestParam("deliveryRecordId") Integer deliveryRecordId, @RequestParam("message") String message) {
|
||||
String msg = deliveryRecordService.deliveryFail(deliveryRecordId, message);
|
||||
@@ -44,14 +39,12 @@ public class TtDeliveryRecordController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "发货记录", action = "确认发货", businessType = BusinessType.GRANT)
|
||||
@ApiOperation("审核通过发货申请")
|
||||
@PostMapping("/deliveryApprove")
|
||||
public R<Boolean> deliveryApprove(@RequestParam("deliveryRecordId") Integer deliveryRecordId) {
|
||||
String msg = deliveryRecordService.deliveryApprove(deliveryRecordId);
|
||||
return StringUtils.isEmpty(msg) ? R.ok(true, "操作成功!") : R.fail(false, msg);
|
||||
}
|
||||
|
||||
@ApiOperation("发货记录申请")
|
||||
@GetMapping("/getDeliveryRecordList")
|
||||
public PageDataInfo<TtDeliveryRecordDataVO> getDeliveryRecordList(TtDeliveryRecordBody deliveryRecordBody) {
|
||||
startPage();
|
||||
|
||||
-9
@@ -13,13 +13,10 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.roll.TtOfficialRollConfig;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 官方周期Roll配置")
|
||||
@RestController
|
||||
@RequestMapping("/admin/officialRollConfig")
|
||||
public class TtOfficialRollConfigController extends BaseController {
|
||||
@@ -30,7 +27,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
@ApiOperation("配置列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtOfficialRollConfig> list(
|
||||
@RequestParam(value = "configName", required = false) String configName,
|
||||
@@ -46,7 +42,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
return getPageData(configList);
|
||||
}
|
||||
|
||||
@ApiOperation("配置详情")
|
||||
@GetMapping("/{id}")
|
||||
public R<TtOfficialRollConfig> getInfo(@PathVariable("id") Integer id) {
|
||||
return R.ok(configService.getById(id));
|
||||
@@ -54,7 +49,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtOfficialRollConfig.class, mapperClass = TtOfficialRollConfigMapper.class)
|
||||
@ApiOperation("新增配置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtOfficialRollConfig config) {
|
||||
config.setCreateBy(getUsername());
|
||||
@@ -64,7 +58,6 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtOfficialRollConfig.class, mapperClass = TtOfficialRollConfigMapper.class)
|
||||
@ApiOperation("编辑配置")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtOfficialRollConfig config) {
|
||||
config.setUpdateBy(getUsername());
|
||||
@@ -73,13 +66,11 @@ public class TtOfficialRollConfigController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "官方周期Roll配置", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除配置")
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable("id") Integer id) {
|
||||
return configService.removeById(id) ? AjaxResult.success() : AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("启用/停用配置")
|
||||
@PutMapping("/changeStatus")
|
||||
public AjaxResult changeStatus(@RequestBody TtOfficialRollConfig config) {
|
||||
if (config.getId() == null) return AjaxResult.error("配置ID不能为空");
|
||||
|
||||
-4
@@ -6,14 +6,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.dto.sys.OrderQueryCondition;
|
||||
import com.ruoyi.domain.entity.TtOrder;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 订单管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/order")
|
||||
public class TtOrderController extends BaseController {
|
||||
@@ -24,7 +21,6 @@ public class TtOrderController extends BaseController {
|
||||
this.ttOrderService = ttOrderService;
|
||||
}
|
||||
|
||||
@ApiOperation("网站支付订单查询")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated OrderQueryCondition condition) {
|
||||
return ttOrderService.adminList(condition);
|
||||
|
||||
-8
@@ -15,8 +15,6 @@ import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.domain.other.TtOrnamentsPrice;
|
||||
import com.ruoyi.domain.vo.TtOrnamentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 饰品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/ornaments")
|
||||
public class TtOrnamentsController extends BaseController {
|
||||
@@ -36,7 +33,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
private TtOrnamentService ttOrnamentService;
|
||||
|
||||
// 饰品列表多条件筛选
|
||||
@ApiOperation("饰品列表多条件筛选")
|
||||
@GetMapping("/list")
|
||||
public R list(TtOrnamentsBody param) {
|
||||
Page<TtOrnamentVO> ttOrnamentVOPage = ttOrnamentService.listByParam(param);
|
||||
@@ -59,7 +55,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "发放饰品", businessType = BusinessType.GRANT)
|
||||
@ApiOperation("饰品发放")
|
||||
@PostMapping("/grantOrnaments/{userId}/{ornamentsId}/{num}")
|
||||
public AjaxResult grantOrnaments(@PathVariable("userId") Integer userId,
|
||||
@PathVariable("ornamentsId") Long ornamentsId,
|
||||
@@ -75,7 +70,6 @@ public class TtOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "饰品列表", action = "新增饰品", businessType = BusinessType.INSERT,
|
||||
entityClass = TtOrnament.class, mapperClass = TtOrnamentMapper.class)
|
||||
@ApiOperation("新增饰品")
|
||||
@PostMapping("/addTtOrnament")
|
||||
public AjaxResult add(@RequestBody TtOrnament ttOrnament) {
|
||||
if (ttOrnament.getId() == null) {
|
||||
@@ -86,14 +80,12 @@ public class TtOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "饰品列表", action = "编辑", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtOrnament.class, mapperClass = TtOrnamentMapper.class)
|
||||
@ApiOperation("修改饰品")
|
||||
@PostMapping("/editTtOrnament")
|
||||
public AjaxResult edit(@RequestBody TtOrnament ttOrnament) {
|
||||
return toAjax(ornamentsService.updateById(ttOrnament));
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除饰品(支持批量)")
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult delete(@PathVariable("ids") List<Long> ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
|
||||
-4
@@ -10,13 +10,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 饰品等级信息")
|
||||
@RestController
|
||||
@RequestMapping("/admin/ornamentsLevel")
|
||||
public class TtOrnamentsLevelController extends BaseController {
|
||||
@@ -27,7 +24,6 @@ public class TtOrnamentsLevelController extends BaseController {
|
||||
this.ornamentsLevelService = ornamentsLevelService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有饰品等级背景")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtOrnamentsLevel> list() {
|
||||
startPage();
|
||||
|
||||
-3
@@ -8,7 +8,6 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.param.promotion.AnchorDailyTurnoverParam;
|
||||
import com.ruoyi.domain.param.promotion.AnchorRechargeParam;
|
||||
import com.ruoyi.domain.vo.promotion.AnchorDailyTurnoverVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -22,7 +21,6 @@ public class TtPromoTurnoverController extends BaseController {
|
||||
@Autowired
|
||||
private TtPromoTurnoverService ttPromoTurnoverService;
|
||||
|
||||
@ApiOperation("获取主播推广数据")
|
||||
@GetMapping("/getAnchorPromotionData")
|
||||
public PageDataInfo<AnchorDailyTurnoverVo> getAnchorPromotionData(AnchorDailyTurnoverParam param) {
|
||||
List<AnchorDailyTurnoverVo> list = ttPromoTurnoverService.getAnchorDailyTurnover(param);
|
||||
@@ -38,7 +36,6 @@ public class TtPromoTurnoverController extends BaseController {
|
||||
return pageDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("主播充值")
|
||||
@PostMapping("/recharge")
|
||||
public AjaxResult recharge(@RequestBody AnchorRechargeParam param) {
|
||||
return ttPromoTurnoverService.recharge(param);
|
||||
|
||||
-4
@@ -13,14 +13,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 红包")
|
||||
@RestController
|
||||
@RequestMapping("/admin/redPacket")
|
||||
public class TtRedPacketController extends BaseController {
|
||||
@@ -45,7 +42,6 @@ public class TtRedPacketController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "CDK口令", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成红包")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRedPacketDataVO ttRedPacketDataVO) {
|
||||
List<String> passwordList = redPacketService.insertRedPacket(ttRedPacketDataVO);
|
||||
|
||||
-18
@@ -24,8 +24,6 @@ import com.ruoyi.domain.entity.roll.TtRollUser;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.vo.TtRollPrizeDataVO;
|
||||
import com.ruoyi.domain.vo.roll.RollJackpotOrnamentsByPageVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -35,7 +33,6 @@ import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 roll房")
|
||||
@RestController
|
||||
@RequestMapping("/admin/roll")
|
||||
public class TtRollController extends BaseController {
|
||||
@@ -77,7 +74,6 @@ public class TtRollController extends BaseController {
|
||||
@Log(title = "Roll房列表", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtRoll.class, mapperClass = TtRollMapper.class)
|
||||
// 创建roll房
|
||||
@ApiOperation("创建roll房")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRoll ttRoll) {
|
||||
|
||||
@@ -88,7 +84,6 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
// roll房拉人
|
||||
@ApiOperation("roll房拉人")
|
||||
@PostMapping("/inviteRollUser")
|
||||
public R inviteRollUser(@RequestBody InviteRollUser InviteRollUser) {
|
||||
|
||||
@@ -97,7 +92,6 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
// 获取roll房成员信息
|
||||
@ApiOperation("获取roll房成员信息")
|
||||
@GetMapping("getRollUsers/{rollId}")
|
||||
public AjaxResult getRollUsers(@PathVariable("rollId") Integer rollId) {
|
||||
return rollService.getRollUsers(rollId);
|
||||
@@ -106,7 +100,6 @@ public class TtRollController extends BaseController {
|
||||
|
||||
@Log(title = "Roll房列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtRoll.class, mapperClass = TtRollMapper.class)
|
||||
@ApiOperation("编辑roll房")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtRoll ttRoll) {
|
||||
|
||||
@@ -117,14 +110,12 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "Roll房列表", action = "删除", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("删除roll房")
|
||||
@DeleteMapping("/remove/{rollId}")
|
||||
public AjaxResult remove(@PathVariable Long rollId) {
|
||||
return rollService.removeRollById(rollId, getUsername());
|
||||
}
|
||||
|
||||
|
||||
// @ApiOperation("roll房奖品列表")
|
||||
// @PostMapping("/getRollPrizeList")
|
||||
// public R<List<TtRollPrizeDataVO>> getRollPrizeList(@RequestBody RollPrizesCondition condition) {
|
||||
//
|
||||
@@ -133,7 +124,6 @@ public class TtRollController extends BaseController {
|
||||
// return R.ok(list);
|
||||
//
|
||||
// }
|
||||
@ApiOperation("roll房奖品列表")
|
||||
@GetMapping("/getRollPrizeList/{rollId}")
|
||||
public R<List<TtRollPrizeDataVO>> getRollPrizeList(@PathVariable("rollId") Integer rollId) {
|
||||
|
||||
@@ -143,40 +133,34 @@ public class TtRollController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("获取 roll房奖池详情")
|
||||
@PostMapping("/getRollPrizePool")
|
||||
public R<RollJackpotOrnamentsByPageVO> getRollPrizePool(@RequestBody @Validated GetRollPrizePool param) {
|
||||
return rollService.getRollPrizePool(param);
|
||||
}
|
||||
|
||||
@ApiOperation("roll房的指定获奖人名单")
|
||||
@GetMapping("/rollWinners/{rollId}")
|
||||
public R rollWinners(@PathVariable Integer rollId) {
|
||||
return rollUserService.rollWinners(rollId);
|
||||
}
|
||||
|
||||
@ApiOperation("roll房实际中奖记录(开奖后参与用户中了什么饰品)")
|
||||
@GetMapping("/winningRecords/{rollId}")
|
||||
public R<List<Map<String, Object>>> winningRecords(@PathVariable("rollId") Integer rollId) {
|
||||
return rollService.winningRecords(rollId);
|
||||
}
|
||||
|
||||
@Log(title = "装备列表", action = "指定获奖者", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("指定roll房winner")
|
||||
@PostMapping("/namedWinner")
|
||||
public AjaxResult namedWinner(@RequestBody @Validated TtRollPrizeDataVO param) {
|
||||
return rollService.namedWinner(param);
|
||||
}
|
||||
|
||||
@Log(title = "装备列表", action = "取消奖品", businessType = BusinessType.DELETE)
|
||||
@ApiOperation("取消指定roll房奖品")
|
||||
@DeleteMapping("/cancelNamedWinner")
|
||||
public R cancelNamedWinner(@RequestBody List<Integer> rollUserPrizeIds) {
|
||||
return rollService.cancelNamedWinner(rollUserPrizeIds);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取ROLL房用户")
|
||||
@GetMapping("/getRollUser/{rollId}")
|
||||
public AjaxResult getRollUser(@PathVariable("rollId") Integer rollId) {
|
||||
List<TtUser> rollUserList = rollService.getRollUser(rollId);
|
||||
@@ -184,13 +168,11 @@ public class TtRollController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "房间用户", action = "加入机器人", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("加入机器人")
|
||||
@PostMapping("/addRobot")
|
||||
public AjaxResult addRobot(@RequestBody AddRobotBody addRobotBody) {
|
||||
return rollService.addRobot(addRobotBody);
|
||||
}
|
||||
@Log(title = "房间用户", action = "加入用户", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("强制加入普通用户")
|
||||
@PostMapping("/addUser")
|
||||
public AjaxResult addUser(@RequestBody AddUserBody addUserBody) {
|
||||
return rollService.addUser(addUserBody);
|
||||
|
||||
-5
@@ -13,14 +13,11 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 roll奖池")
|
||||
@RestController
|
||||
@RequestMapping("/admin/rollJackpot")
|
||||
public class TtRollJackpotController extends BaseController {
|
||||
@@ -31,7 +28,6 @@ public class TtRollJackpotController extends BaseController {
|
||||
this.rollJackpotService = rollJackpotService;
|
||||
}
|
||||
|
||||
@ApiOperation("奖池列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtRollJackpot> list(@RequestParam(value = "jackpotName", required = false) String jackpotName) {
|
||||
startPage();
|
||||
@@ -51,7 +47,6 @@ public class TtRollJackpotController extends BaseController {
|
||||
|
||||
@Log(title = "奖池列表", action = "新增", businessType = BusinessType.INSERT,
|
||||
entityClass = TtRollJackpot.class, mapperClass = TtRollJackpotMapper.class)
|
||||
@ApiOperation("添加奖池")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtRollJackpot ttRollJackpot) {
|
||||
ttRollJackpot.setCreateBy(getUsername());
|
||||
|
||||
-6
@@ -16,14 +16,11 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 roll奖池物品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/rollJackpotOrnaments")
|
||||
public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
@@ -37,7 +34,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
this.rollJackpotOrnamentsService = rollJackpotOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("物品列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtRollJackpotOrnamentsDataVO> list(TtRollJackpotOrnamentsBody rollJackpotOrnamentsBody) {
|
||||
startPage();
|
||||
@@ -61,7 +57,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
|
||||
@Log(title = "奖池列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtRollJackpotOrnaments.class, mapperClass = TtRollJackpotOrnamentsMapper.class)
|
||||
@ApiOperation("修改奖池道具")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtRollJackpotOrnaments rollJOEdit) {
|
||||
String msg = rollJackpotOrnamentsService.updateRollJackpotOrnamentsById(rollJOEdit);
|
||||
@@ -82,7 +77,6 @@ public class TtRollJackpotOrnamentsController extends BaseController {
|
||||
return toAjax(ok);
|
||||
}
|
||||
|
||||
@ApiOperation("奖池批量填货")
|
||||
@PostMapping("/batchAdd/{rollJackpotId}/{OrnamentsIds}")
|
||||
public AjaxResult batchAdd(@PathVariable Integer rollJackpotId, @PathVariable Long[] OrnamentsIds) {
|
||||
String msg = rollJackpotOrnamentsService.batchAdd(rollJackpotId, Arrays.asList(OrnamentsIds));
|
||||
|
||||
-9
@@ -11,14 +11,11 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.other.TransferApplyBody;
|
||||
import com.ruoyi.domain.vo.transfer.TransferApplyBatchVO;
|
||||
import com.ruoyi.domain.vo.transfer.TransferApplyVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Api(tags = "管理端 转赠申请管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/transferApply")
|
||||
public class TtTransferApplyController extends BaseController {
|
||||
@@ -32,7 +29,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
this.redisLock = redisLock;
|
||||
}
|
||||
|
||||
@ApiOperation("转赠申请列表(按饰品逐条)")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TransferApplyVO> list(TransferApplyBody body) {
|
||||
startPage();
|
||||
@@ -40,7 +36,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("转赠申请批次列表(按批次聚合,含饰品明细)")
|
||||
@GetMapping("/batchList")
|
||||
public PageDataInfo<TransferApplyBatchVO> batchList(TransferApplyBody body) {
|
||||
startPage();
|
||||
@@ -48,7 +43,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("审核通过(单条,兼容旧接口)")
|
||||
@Log(title = "转赠申请", action = "同意", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/approve")
|
||||
public R<Boolean> approve(@RequestParam("id") Integer id) {
|
||||
@@ -64,7 +58,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("审核驳回(单条,兼容旧接口)")
|
||||
@Log(title = "转赠申请", action = "驳回", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/reject")
|
||||
public R<Boolean> reject(@RequestParam("id") Integer id,
|
||||
@@ -81,7 +74,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批次审核通过(整个批次一起通过)")
|
||||
@Log(title = "转赠申请", action = "确定同意", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/approveBatch")
|
||||
public R<Boolean> approveBatch(@RequestParam("batchId") String batchId) {
|
||||
@@ -97,7 +89,6 @@ public class TtTransferApplyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批次审核驳回(整个批次一起驳回)")
|
||||
@Log(title = "转赠申请", action = "驳回", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/rejectBatch")
|
||||
public R<Boolean> rejectBatch(@RequestParam("batchId") String batchId,
|
||||
|
||||
-6
@@ -9,9 +9,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -25,7 +22,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "管理端 失败物品奖励")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeFailOrnaments")
|
||||
public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
@@ -43,7 +39,6 @@ public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
@NotNull(message = "参与升级物品id不能为空")
|
||||
private Integer upgradeOrnamentId;
|
||||
}
|
||||
@ApiOperation("失败奖励列表")
|
||||
@PostMapping("/list")
|
||||
public PageDataInfo<TtUpgradeFailOrnamentsDataVO> list(@RequestBody listParam param) {
|
||||
startPage();
|
||||
@@ -67,7 +62,6 @@ public class TtUpgradeFailOrnamentsController extends BaseController {
|
||||
private Boolean useAllFlag;
|
||||
}
|
||||
@Log(title = "失败奖励", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("批量添加失败奖励")
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody @Validated BatchAddParam param) {
|
||||
return upgradeFailOrnamentsService.batchAdd(param);
|
||||
|
||||
-5
@@ -14,8 +14,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -24,7 +22,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "管理端 幸运升级")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeOrnaments")
|
||||
public class TtUpgradeOrnamentsController extends BaseController {
|
||||
@@ -38,7 +35,6 @@ public class TtUpgradeOrnamentsController extends BaseController {
|
||||
this.upgradeOrnamentsService = upgradeOrnamentsService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取参与幸运升级的物品")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtUpgradeOrnamentsDataVO> list(TtUpgradeOrnamentsBody ttUpgradeOrnamentsBody){
|
||||
startPage();
|
||||
@@ -53,7 +49,6 @@ public class TtUpgradeOrnamentsController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "饰品列表", action = "新增", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("批量填货")
|
||||
@PostMapping("/batchAdd/{ornamentsIds}")
|
||||
public AjaxResult batchAdd(@PathVariable Long[] ornamentsIds) {
|
||||
String msg = upgradeOrnamentsService.batchAdd(Arrays.asList(ornamentsIds));
|
||||
|
||||
-4
@@ -10,14 +10,11 @@ import com.ruoyi.domain.other.TtUpgradeRecordBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.domain.vo.upgrade.UpgradeRecordVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 幸运升级日志")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeRecord")
|
||||
public class TtUpgradeRecordController extends BaseController {
|
||||
@@ -28,7 +25,6 @@ public class TtUpgradeRecordController extends BaseController {
|
||||
this.upgradeRecordService = upgradeRecordService;
|
||||
}
|
||||
|
||||
@ApiOperation("幸运升级日志")
|
||||
@PostMapping("/list")
|
||||
public R<Page<UpgradeRecordVO>> list(@RequestBody @Validated UpgradeCondition param){
|
||||
return upgradeRecordService.adminGetLog(param);
|
||||
|
||||
-9
@@ -6,8 +6,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.domain.other.UpgradeWatermarkSettingBody;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -21,7 +19,6 @@ import java.util.Map;
|
||||
* 后台只配一个「目标水位(%)」:水位高于它 → 随机数中心下移(放水);低于它 → 上移(收紧),
|
||||
* 长期自动收敛回目标值。随机数的取值范围仍由每个饰品自己的区间限定。
|
||||
*/
|
||||
@Api(tags = "幸运升级·奖池水位")
|
||||
@RestController
|
||||
@RequestMapping("/admin/upgradeWatermark")
|
||||
public class TtUpgradeWatermarkController extends BaseController {
|
||||
@@ -29,13 +26,11 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
@Autowired
|
||||
private UpgradeWatermarkService watermarkService;
|
||||
|
||||
@ApiOperation("当前水位快照 + 目标水位策略 + 按目标水位推算的随机数中心")
|
||||
@GetMapping("/info")
|
||||
public R<Map<String, Object>> info() {
|
||||
return R.ok(watermarkService.info());
|
||||
}
|
||||
|
||||
@ApiOperation("保存目标水位策略(目标水位 + 灵敏度)")
|
||||
@Log(title = "幸运升级水位策略", action = "保存", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/setting")
|
||||
public R<Map<String, Object>> saveSetting(@RequestBody UpgradeWatermarkSettingBody body) {
|
||||
@@ -46,7 +41,6 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
return R.ok(watermarkService.info());
|
||||
}
|
||||
|
||||
@ApiOperation("注水/抽水(type 1注水 2抽水;调整原因必填)")
|
||||
@Log(title = "幸运升级水位", action = "注水/抽水", businessType = BusinessType.GRANT)
|
||||
@PostMapping("/adjust")
|
||||
public R<Map<String, Object>> adjust(@RequestBody Map<String, Object> body) {
|
||||
@@ -60,7 +54,6 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("重置人工调整(插入抵消日志,SUM(delta) 归零,历史保留)")
|
||||
@Log(title = "幸运升级水位", action = "重置调整", businessType = BusinessType.CLEAN)
|
||||
@PostMapping("/adjustReset")
|
||||
public R<Map<String, Object>> adjustReset(@RequestBody(required = false) Map<String, Object> body) {
|
||||
@@ -72,14 +65,12 @@ public class TtUpgradeWatermarkController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("调整历史(分页)")
|
||||
@GetMapping("/adjustLog")
|
||||
public R<Map<String, Object>> adjustLog(@RequestParam(defaultValue = "1") int page,
|
||||
@RequestParam(defaultValue = "10") int size) {
|
||||
return R.ok(watermarkService.pageLog(page, size));
|
||||
}
|
||||
|
||||
@ApiOperation("按历史记录全量重算累计下注/返奖(纠正 Redis 计数漂移)")
|
||||
@Log(title = "幸运升级水位", action = "重算累计量", businessType = BusinessType.CLEAN)
|
||||
@PostMapping("/recalc")
|
||||
public R<Map<String, Object>> recalc() {
|
||||
|
||||
-5
@@ -9,8 +9,6 @@ import com.ruoyi.system.config.ArchiveDaysConfig;
|
||||
import com.ruoyi.domain.other.TtUserAmountRecordsBody;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -22,7 +20,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "管理端 金币账户")
|
||||
@RestController
|
||||
@RequestMapping("/admin/userAmountRecords")
|
||||
public class TtUserAmountRecordsController extends BaseController {
|
||||
@@ -38,7 +35,6 @@ public class TtUserAmountRecordsController extends BaseController {
|
||||
this.userAmountRecordsService = userAmountRecordsService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取列表")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated TtUserAmountRecordsBody ttUserAmountRecordsBody) {
|
||||
return userAmountRecordsService.queryList(ttUserAmountRecordsBody);
|
||||
@@ -55,7 +51,6 @@ public class TtUserAmountRecordsController extends BaseController {
|
||||
* - userId 排序 → 快速模式(先分页用户再聚合当页数据,Java内存排序)
|
||||
* - 聚合字段排序 → 全局排序模式(先聚合所有用户→SQL排序→分页),确保全局排序正确
|
||||
*/
|
||||
@ApiOperation("用户流水统计")
|
||||
@GetMapping("/userTurnover")
|
||||
public R userTurnover(
|
||||
@RequestParam(required = false) Integer userId,
|
||||
|
||||
-5
@@ -5,8 +5,6 @@ import com.ruoyi.admin.service.TtUserBlendErcashService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.domain.dto.userRecord.BlendErcashCondition;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -15,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "管理端 收支明细")
|
||||
@RestController
|
||||
@RequestMapping("/admin/blendErcash")
|
||||
@Slf4j
|
||||
@@ -24,13 +21,11 @@ public class TtUserBlendErcashController extends BaseController {
|
||||
@Autowired
|
||||
private TtUserBlendErcashService ttUserBlendErcashService;
|
||||
|
||||
@ApiOperation("收支明细")
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody @Validated BlendErcashCondition condition) {
|
||||
return ttUserBlendErcashService.byCondition(condition);
|
||||
}
|
||||
|
||||
@ApiOperation("收支明细-仅归档表")
|
||||
@PostMapping("/archive/list")
|
||||
public R archiveList(@RequestBody @Validated BlendErcashCondition condition) {
|
||||
return ttUserBlendErcashService.byConditionArchive(condition);
|
||||
|
||||
-10
@@ -27,7 +27,6 @@ import com.ruoyi.domain.other.TtUserBody;
|
||||
import com.ruoyi.domain.other.TtUserPackSackBody;
|
||||
import com.ruoyi.domain.vo.TtUserPackSackDataVO;
|
||||
import com.ruoyi.domain.vo.user.TtUserVo;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -89,14 +88,12 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成招商账号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成招商账号")
|
||||
@PostMapping("/generateAccount")
|
||||
public void generateAccount(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getAccountList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
userService.generateAccount(response, userList);
|
||||
}
|
||||
|
||||
@ApiOperation("生成账号")
|
||||
@GetMapping("/generateAccountByPhoneNum")
|
||||
public R generateAccountByPhoneNum(HttpServletResponse response, @RequestParam("phoneNum") String phoneNum,
|
||||
@RequestParam("password") String password) {
|
||||
@@ -105,7 +102,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成机器人", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成机器人")
|
||||
@PostMapping("/generateRobot/{num}")
|
||||
public void generateRobot(HttpServletResponse response, @PathVariable("num") Integer num) {
|
||||
List<TtUser> userList = userService.getRobotList(num);
|
||||
@@ -113,7 +109,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成白号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成白号")
|
||||
@PostMapping("/generateBlankAccount")
|
||||
public void generateBlankAccount(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getBlankAccountList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
@@ -121,7 +116,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "生成卡商账号", businessType = BusinessType.INSERT)
|
||||
@ApiOperation("生成卡商账号")
|
||||
@PostMapping("/generateCardMerchant")
|
||||
public void generateCardMerchant(HttpServletResponse response, @RequestBody GenerateAccountBody body) {
|
||||
List<TtUser> userList = userService.getCardMerchantList(body.getNum(), body.getCustomPhoneNumbers());
|
||||
@@ -130,7 +124,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "修改", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class)
|
||||
@ApiOperation("修改用户信息")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtUser ttUser) {
|
||||
ttUser.setUpdateBy(getUsername());
|
||||
@@ -146,7 +139,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "修改邀请码", businessType = BusinessType.UPDATE,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class)
|
||||
@ApiOperation("修改邀请码")
|
||||
@PostMapping("/editInvitationCode")
|
||||
public AjaxResult editInvitationCode(@RequestBody TtUser ttUser) {
|
||||
ttUser.setUpdateBy(getUsername());
|
||||
@@ -225,7 +217,6 @@ public class TtUserController extends BaseController {
|
||||
|
||||
@Log(title = "用户列表", action = "重置余额积分", businessType = BusinessType.CLEAN,
|
||||
entityClass = TtUser.class, mapperClass = TtUserMapper.class, idField = "userId")
|
||||
@ApiOperation("重置用户余额和积分")
|
||||
@PostMapping("/resetBalance/{userId}")
|
||||
public AjaxResult resetUserBalance(@PathVariable("userId") Integer userId){
|
||||
TtUser ttUser = new TtUser();
|
||||
@@ -239,7 +230,6 @@ public class TtUserController extends BaseController {
|
||||
}
|
||||
|
||||
@Log(title = "用户列表", action = "真删除", businessType = BusinessType.FORCE)
|
||||
@ApiOperation("真删除用户(数据库删除,不可恢复)")
|
||||
@DeleteMapping("/forceDelete/{userId}")
|
||||
public AjaxResult forceDelete(@PathVariable("userId") Integer userId) {
|
||||
// 0. 先清登录态:物理删除后 tt_user 查不到该用户,若不清 Redis Token,
|
||||
|
||||
-10
@@ -18,8 +18,6 @@ import com.ruoyi.domain.entity.TtOrnament;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryPrize;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryRecord;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -31,7 +29,6 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 后台管理 - 流水抽奖配置
|
||||
*/
|
||||
@Api(tags = "后台流水抽奖管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLottery")
|
||||
public class TurnoverLotteryAdminController extends BaseController {
|
||||
@@ -57,7 +54,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 获取抽奖活动列表
|
||||
*/
|
||||
@ApiOperation("获取抽奖活动列表")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtTurnoverLottery> list(
|
||||
@RequestParam(required = false) String lotteryName,
|
||||
@@ -92,7 +88,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 保存抽奖奖品配置
|
||||
*/
|
||||
@ApiOperation("保存抽奖奖品")
|
||||
@PostMapping("/save/{lotteryId}")
|
||||
public R<String> savePrizes(
|
||||
@PathVariable("lotteryId") Long lotteryId,
|
||||
@@ -112,7 +107,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 更新抽奖活动状态
|
||||
*/
|
||||
@ApiOperation("更新抽奖状态")
|
||||
@PostMapping("/toggleStatus")
|
||||
public R<String> toggleStatus(@RequestBody Map<String, Object> body) {
|
||||
Long lotteryId = body.get("lotteryId") != null ? ((Number) body.get("lotteryId")).longValue() : null;
|
||||
@@ -139,7 +133,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 创建新的抽奖活动
|
||||
*/
|
||||
@ApiOperation("创建抽奖活动")
|
||||
@PostMapping("/create")
|
||||
public R<TtTurnoverLottery> create(@RequestBody Map<String, Object> body) {
|
||||
String lotteryName = body.get("lotteryName") != null ? body.get("lotteryName").toString() : null;
|
||||
@@ -170,7 +163,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 删除抽奖活动
|
||||
*/
|
||||
@ApiOperation("删除抽奖活动")
|
||||
@DeleteMapping("/delete/{lotteryId}")
|
||||
public R<String> delete(@PathVariable("lotteryId") Long lotteryId) {
|
||||
lotteryMapper.deleteById(lotteryId);
|
||||
@@ -180,7 +172,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 搜索饰品 (用于奖品配置时调用)
|
||||
*/
|
||||
@ApiOperation("搜索饰品")
|
||||
@GetMapping("/searchOrnaments")
|
||||
public R<List<TtOrnament>> searchOrnaments(
|
||||
@RequestParam(value = "name", required = false) String name,
|
||||
@@ -205,7 +196,6 @@ public class TurnoverLotteryAdminController extends BaseController {
|
||||
/**
|
||||
* 更新抽奖活动基础信息
|
||||
*/
|
||||
@ApiOperation("更新抽奖活动")
|
||||
@PostMapping("/update")
|
||||
public R<String> update(@RequestBody Map<String, Object> body) {
|
||||
Long lotteryId = body.get("lotteryId") != null ? ((Number) body.get("lotteryId")).longValue() : null;
|
||||
|
||||
-8
@@ -18,8 +18,6 @@ import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryPrize;
|
||||
import com.ruoyi.domain.other.TtOrnamentsLevel;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -33,7 +31,6 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 流水抽奖奖品管理 (仿宝箱饰品管理 boxOrnaments)
|
||||
*/
|
||||
@Api(tags = "流水抽奖奖品管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLotteryPrize")
|
||||
public class TurnoverLotteryPrizeController extends BaseController {
|
||||
@@ -56,7 +53,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 获取奖品列表 (分页,含爆率百分比计算)
|
||||
*/
|
||||
@ApiOperation("奖品列表")
|
||||
@GetMapping("/list/{lotteryId}")
|
||||
public PageDataInfo<TtTurnoverLotteryPrize> list(@PathVariable("lotteryId") Long lotteryId) {
|
||||
// 先算总数(避免 PageHelper 干扰百分比计算)
|
||||
@@ -108,7 +104,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 获取单个奖品详情
|
||||
*/
|
||||
@ApiOperation("奖品详情")
|
||||
@GetMapping("/{id}")
|
||||
public R<TtTurnoverLotteryPrize> getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok(prizeMapper.selectById(id));
|
||||
@@ -118,7 +113,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 新增奖品
|
||||
*/
|
||||
@ApiOperation("新增奖品")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody TtTurnoverLotteryPrize prize) {
|
||||
if (prize == null || prize.getLotteryId() == null) {
|
||||
@@ -165,7 +159,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 修改奖品
|
||||
*/
|
||||
@ApiOperation("修改奖品")
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody TtTurnoverLotteryPrize prize) {
|
||||
Long lotteryId = prize.getLotteryId();
|
||||
@@ -211,7 +204,6 @@ public class TurnoverLotteryPrizeController extends BaseController {
|
||||
/**
|
||||
* 删除奖品
|
||||
*/
|
||||
@ApiOperation("删除奖品")
|
||||
@DeleteMapping("/{lotteryId}/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long lotteryId, @PathVariable Long[] ids) {
|
||||
String lockKey = RedisConstants.TURNOVER_LOTTERY_DRAW_BOX_LOCK + lotteryId;
|
||||
|
||||
-5
@@ -9,8 +9,6 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLotteryRecord;
|
||||
import com.ruoyi.domain.entity.lottery.TtTurnoverLottery;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -19,7 +17,6 @@ import java.util.List;
|
||||
/**
|
||||
* 后台管理 - 抽奖记录查询
|
||||
*/
|
||||
@Api(tags = "后台抽奖记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/turnoverLotteryRecord")
|
||||
public class TurnoverLotteryRecordController extends BaseController {
|
||||
@@ -33,7 +30,6 @@ public class TurnoverLotteryRecordController extends BaseController {
|
||||
/**
|
||||
* 查询抽奖记录列表
|
||||
*/
|
||||
@ApiOperation("查询抽奖记录")
|
||||
@GetMapping("/list")
|
||||
public PageDataInfo<TtTurnoverLotteryRecord> list(
|
||||
@RequestParam(value = "userId", required = false) Long userId,
|
||||
@@ -58,7 +54,6 @@ public class TurnoverLotteryRecordController extends BaseController {
|
||||
/**
|
||||
* 获取所有抽奖活动(用于下拉选择)
|
||||
*/
|
||||
@ApiOperation("获取抽奖活动选项")
|
||||
@GetMapping("/lotteryOptions")
|
||||
public R<List<TtTurnoverLottery>> lotteryOptions() {
|
||||
LambdaQueryWrapper<TtTurnoverLottery> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
-7
@@ -6,8 +6,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.redis.config.RedisLock;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -18,7 +16,6 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 用户端 - 流水抽奖
|
||||
*/
|
||||
@Api(tags = "用户流水抽奖")
|
||||
@RestController
|
||||
@RequestMapping("/api/turnoverLottery")
|
||||
public class TurnoverLotteryUserController extends BaseController {
|
||||
@@ -32,7 +29,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 获取用户今日流水统计和可参与的抽奖宝箱
|
||||
*/
|
||||
@ApiOperation("获取抽奖信息")
|
||||
@PostMapping("/myStats")
|
||||
public R<Map<String, Object>> getMyStats() {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -42,7 +38,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 执行抽奖
|
||||
*/
|
||||
@ApiOperation("执行抽奖")
|
||||
@PostMapping("/draw")
|
||||
public R<Map<String, Object>> draw(@RequestBody Map<String, Object> params) {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -82,7 +77,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 查询我的抽奖记录(分页)
|
||||
*/
|
||||
@ApiOperation("我的抽奖记录")
|
||||
@PostMapping("/myRecords")
|
||||
public R<Map<String, Object>> myRecords(@RequestBody(required = false) Map<String, Object> params) {
|
||||
Integer userId = getUserId().intValue();
|
||||
@@ -109,7 +103,6 @@ public class TurnoverLotteryUserController extends BaseController {
|
||||
/**
|
||||
* 查询全服中奖记录(分页,已排除白号/机器人/封禁/已删除用户)
|
||||
*/
|
||||
@ApiOperation("全服中奖记录")
|
||||
@PostMapping("/globalRecords")
|
||||
public R<Map<String, Object>> globalRecords(@RequestBody(required = false) Map<String, Object> params) {
|
||||
Long lotteryId = null;
|
||||
|
||||
-5
@@ -13,15 +13,12 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.vo.upgrade.SimpleOrnamentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端 道具管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/websiteProperty")
|
||||
@Slf4j
|
||||
@@ -36,7 +33,6 @@ public class WebsitePropertyController extends BaseController {
|
||||
this.ornamentsService = ornamentsService;
|
||||
}
|
||||
|
||||
// @ApiOperation("获取道具列表")
|
||||
// @GetMapping("/list")
|
||||
// public PageDataInfo<WebsitePropertyDataVO> list() {
|
||||
// startPage();
|
||||
@@ -44,7 +40,6 @@ public class WebsitePropertyController extends BaseController {
|
||||
// return getPageData(Arrays.asList());
|
||||
// }
|
||||
|
||||
@ApiOperation("获取道具列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OrnamentCondition condition) {
|
||||
startPage();
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.ruoyi.domain.entity.TtOrnament;
|
||||
import com.ruoyi.domain.entity.TtOrnamentsYY;
|
||||
import com.ruoyi.domain.vo.WebsitePropertyDataVO;
|
||||
import com.ruoyi.domain.vo.upgrade.SimpleOrnamentVO;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
+15
-7
@@ -78,7 +78,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
} else {
|
||||
userData.setParentInvitationCode(ParentUser.getInvitationCode());
|
||||
}
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PLAYER);
|
||||
} else if (username.startsWith("promo_user_")) {
|
||||
String phoneNumber = username.substring(11);
|
||||
TtUser user = new LambdaQueryChainWrapper<>(ttUserService.getBaseMapper())
|
||||
@@ -93,7 +93,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
if (hasPromoRole) {
|
||||
UserData userData = UserData.builder().build();
|
||||
BeanUtils.copyBeanProp(userData, user);
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
}
|
||||
// 超级管理员账号(promo_admin.username / phone_number)也可以是手机号
|
||||
PromoAdmin promoAdmin = promoAdminMapper.findByAccount(phoneNumber);
|
||||
@@ -105,7 +105,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
.userType(UserType.SUPER_ADMIN.getCode())
|
||||
.password(promoAdmin.getPassword())
|
||||
.build();
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
}
|
||||
// 以下报错语义与原逻辑保持一致
|
||||
if (StringUtils.isNull(user)) {
|
||||
@@ -137,7 +137,7 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
.userType(UserType.SUPER_ADMIN.getCode())
|
||||
.password(promoAdmin.getPassword())
|
||||
.build();
|
||||
return createLoginUser(userData);
|
||||
return createLoginUser(userData, LoginUser.SCOPE_PROMO);
|
||||
} else {
|
||||
SysUser user = userService.selectUserByUserName(username);
|
||||
if (StringUtils.isNull(user)) {
|
||||
@@ -157,11 +157,19 @@ public class ApiUserDetailsServiceImpl implements UserDetailsService {
|
||||
}
|
||||
}
|
||||
|
||||
private UserDetails createLoginUser(UserData userData) {
|
||||
return new LoginUser(userData.getUserId().longValue(), userData);
|
||||
/**
|
||||
* 玩家 / 推广端登录:账号前缀决定登录端标记,token 只能用于对应端的接口
|
||||
*/
|
||||
private UserDetails createLoginUser(UserData userData, String loginScope) {
|
||||
LoginUser loginUser = new LoginUser(userData.getUserId().longValue(), userData);
|
||||
loginUser.setLoginScope(loginScope);
|
||||
return loginUser;
|
||||
}
|
||||
|
||||
/** 后台账号登录(sys_user) */
|
||||
private UserDetails createLoginUser(SysUser user) {
|
||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
loginUser.setLoginScope(LoginUser.SCOPE_ADMIN);
|
||||
return loginUser;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@ public interface TtFightResultService extends IService<TtFightResult> {
|
||||
FightResultVO getFightResult(Integer fightId);
|
||||
|
||||
/**
|
||||
* 批量获取多个对战的详细结果(替代循环调用 getFightResult 的 N+1 问题)
|
||||
* 批量获取多个对战的结果(替代循环调用 getFightResult 的 N+1 问题)。
|
||||
* 只算卡片要展示的金额,开箱明细(fightResult/winnerPrize/endGamePrize)不组装,
|
||||
* 客户端点卡片进观战/回顾时自己请求 getFightResult 取权威明细。
|
||||
*
|
||||
* @param fightIds 对战ID列表
|
||||
* @return 按入参顺序返回的 FightResultVO 列表(跳过不存在的 fightId)
|
||||
|
||||
+2
-6
@@ -38,9 +38,7 @@ public interface TtUserService extends IService<TtUser> {
|
||||
|
||||
void generateAccount(HttpServletResponse response, List<TtUser> accountList);
|
||||
|
||||
List<TtUser> getAccountList(Integer num);
|
||||
|
||||
// 生成招商账号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
// 生成招商账号:手机号必填(推广后台靠手机号收短信验证码登录,随机号收不到码)
|
||||
List<TtUser> getAccountList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
TtUser getAccountList(String phoneNumber, String password);
|
||||
@@ -52,9 +50,7 @@ public interface TtUserService extends IService<TtUser> {
|
||||
// 生成白号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
List<TtUser> getBlankAccountList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
List<TtUser> getCardMerchantList(Integer num);
|
||||
|
||||
// 生成卡商账号:支持按位置传入自定义手机号(为空的位置随机生成)
|
||||
// 生成卡商账号:手机号必填(推广后台靠手机号收短信验证码登录,随机号收不到码)
|
||||
List<TtUser> getCardMerchantList(Integer num, List<String> customPhoneNumbers);
|
||||
|
||||
boolean checkUserNameUnique(TtUser user);
|
||||
|
||||
+78
-113
@@ -306,7 +306,7 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
Map<Integer, TtFight> fightMap = fights.stream()
|
||||
.collect(Collectors.toMap(TtFight::getId, f -> f, (a, b) -> a));
|
||||
|
||||
// 2. 批量查询所有座位玩家的 vipLevel
|
||||
// 2. 批量查询座位玩家 vipLevel + 房主实时昵称(一次查询覆盖两类用户)
|
||||
List<Integer> allPlayerIds = fights.stream()
|
||||
.filter(f -> f.getSeats() != null)
|
||||
.flatMap(f -> f.getSeats().stream())
|
||||
@@ -314,30 +314,42 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, Integer> vipMap = new HashMap<>();
|
||||
if (!allPlayerIds.isEmpty()) {
|
||||
List<Integer> allUserIds = new ArrayList<>(allPlayerIds);
|
||||
fights.stream().map(TtFight::getUserId).filter(Objects::nonNull).forEach(allUserIds::add);
|
||||
allUserIds = allUserIds.stream().distinct().collect(Collectors.toList());
|
||||
Map<Integer, TtUser> userMap = new HashMap<>();
|
||||
if (!allUserIds.isEmpty()) {
|
||||
List<TtUser> users = new LambdaQueryChainWrapper<>(ttUserMapper)
|
||||
.in(TtUser::getUserId, allPlayerIds)
|
||||
.select(TtUser::getUserId, TtUser::getVipLevel)
|
||||
.in(TtUser::getUserId, allUserIds)
|
||||
.select(TtUser::getUserId, TtUser::getVipLevel, TtUser::getNickName)
|
||||
.list();
|
||||
vipMap = users.stream()
|
||||
.collect(Collectors.toMap(TtUser::getUserId,
|
||||
u -> u.getVipLevel() != null && u.getVipLevel() > 0 ? u.getVipLevel() - 1 : 0, (a, b) -> a));
|
||||
userMap = users.stream().filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(TtUser::getUserId, u -> u, (a, b) -> a));
|
||||
}
|
||||
for (TtFight fight : fights) {
|
||||
if (fight.getSeats() != null) {
|
||||
for (FightSeat seat : fight.getSeats()) {
|
||||
if (seat.getPlayerId() != null) {
|
||||
seat.setVipLevel(vipMap.getOrDefault(seat.getPlayerId(), 0));
|
||||
TtUser user = userMap.get(seat.getPlayerId());
|
||||
Integer vipLevel = user != null ? user.getVipLevel() : null;
|
||||
seat.setVipLevel(vipLevel != null && vipLevel > 0 ? vipLevel - 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 用户存在时用实时昵称覆盖;用户被物理删除时保留入库的 ownerNickName
|
||||
TtUser owner = userMap.get(fight.getUserId());
|
||||
if (owner != null && owner.getNickName() != null) {
|
||||
fight.setOwnerNickName(owner.getNickName());
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 批量查询所有 TtBoxRecords(按 fight_id 分组,只取本场玩家的记录)
|
||||
// 3. 批量查询所有 TtBoxRecords(按 fight_id 分组,只取本场玩家的记录;只查算金额需要的列)
|
||||
LambdaQueryWrapper<TtBoxRecords> boxRecordsQuery = new LambdaQueryWrapper<>();
|
||||
boxRecordsQuery.in(TtBoxRecords::getFightId, fightIds)
|
||||
.in(TtBoxRecords::getUserId, allPlayerIds);
|
||||
.in(TtBoxRecords::getUserId, allPlayerIds)
|
||||
.select(TtBoxRecords::getFightId, TtBoxRecords::getUserId, TtBoxRecords::getHolderUserId,
|
||||
TtBoxRecords::getOrnamentId, TtBoxRecords::getOrnamentsPrice,
|
||||
TtBoxRecords::getFightRoundNumber, TtBoxRecords::getCreateTime);
|
||||
List<TtBoxRecords> allBoxRecords = boxRecordsService.list(boxRecordsQuery);
|
||||
|
||||
// 过滤旧数据:回合数不超过对战实际总回合数 + 时间过滤
|
||||
@@ -377,25 +389,7 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
.collect(Collectors.toMap(TtBox::getBoxId, b -> b.getBoxName() != null ? b.getBoxName() : "", (a, b) -> a));
|
||||
}
|
||||
|
||||
// 5. 批量查询所有饰品 exteriorName
|
||||
List<Long> allOrnamentIds = allBoxRecords.stream()
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.map(TtBoxRecords::getOrnamentId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, String> exteriorNameMap = new HashMap<>();
|
||||
if (!allOrnamentIds.isEmpty()) {
|
||||
List<TtOrnament> ornaments = new LambdaQueryChainWrapper<>(ttOrnamentMapper)
|
||||
.in(TtOrnament::getId, allOrnamentIds)
|
||||
.select(TtOrnament::getId, TtOrnament::getExteriorName)
|
||||
.list();
|
||||
exteriorNameMap = ornaments.stream()
|
||||
.collect(Collectors.toMap(TtOrnament::getId,
|
||||
o -> normalizeExterior(o.getExteriorName()),
|
||||
(a, b) -> a));
|
||||
}
|
||||
|
||||
// 6. 逐个构建 FightResultVO
|
||||
// 5. 逐个构建结果(只算金额,不组装开箱明细列表)
|
||||
List<FightResultVO> result = new ArrayList<>();
|
||||
for (Integer fightId : fightIds) {
|
||||
TtFight fight = fightMap.get(fightId);
|
||||
@@ -420,46 +414,23 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
}
|
||||
}
|
||||
|
||||
// 构建 fightBoxVOList
|
||||
// 箱图只用 boxImg01(boxImg02 客户端零读取);价格/箱名回填到 boxData,客户端按 boxId 取用
|
||||
Map<String, FightBoxVO> boxData = fight.getBoxData();
|
||||
ArrayList<FightBoxVO> fightBoxVOList = new ArrayList<>();
|
||||
if (boxData != null) {
|
||||
final Map<Integer, BigDecimal> finalBoxPriceMap = boxPriceMap;
|
||||
final Map<Integer, String> finalBoxNameMap = batchBoxNameMap;
|
||||
boxData.keySet().stream()
|
||||
.sorted(Comparator.comparingInt(Integer::parseInt))
|
||||
.forEach(boxId -> {
|
||||
Object value = boxData.get(boxId);
|
||||
if (value instanceof LinkedHashMap) {
|
||||
Map<String, Object> map = (LinkedHashMap) value;
|
||||
FightBoxVO vo = new FightBoxVO(
|
||||
map.get("boxId") != null ? Integer.valueOf(map.get("boxId").toString()) : null,
|
||||
map.get("number") != null ? Integer.valueOf(map.get("number").toString()) : null,
|
||||
map.get("boxImg01") != null ? map.get("boxImg01").toString() : null,
|
||||
map.get("boxImg02") != null ? map.get("boxImg02").toString() : null);
|
||||
vo.setPrice(finalBoxPriceMap.getOrDefault(vo.getBoxId(), BigDecimal.ZERO));
|
||||
vo.setBoxName(finalBoxNameMap.getOrDefault(vo.getBoxId(), ""));
|
||||
fightBoxVOList.add(vo);
|
||||
} else {
|
||||
FightBoxVO vo = boxData.get(boxId);
|
||||
vo.setPrice(finalBoxPriceMap.getOrDefault(vo.getBoxId(), BigDecimal.ZERO));
|
||||
vo.setBoxName(finalBoxNameMap.getOrDefault(vo.getBoxId(), ""));
|
||||
fightBoxVOList.add(vo);
|
||||
}
|
||||
});
|
||||
for (Map.Entry<String, FightBoxVO> entry : boxData.entrySet()) {
|
||||
FightBoxVO box = resolveFightBoxVO(entry.getValue());
|
||||
if (box == null) {
|
||||
continue;
|
||||
}
|
||||
box.setPrice(boxPriceMap.getOrDefault(box.getBoxId(), BigDecimal.ZERO));
|
||||
box.setBoxName(batchBoxNameMap.getOrDefault(box.getBoxId(), ""));
|
||||
box.setBoxImg02(null);
|
||||
entry.setValue(box);
|
||||
}
|
||||
}
|
||||
|
||||
// 分离正常回合结果和赛后奖励
|
||||
List<TtBoxRecords> roundResults = fightBoxRecords.stream()
|
||||
.filter(r -> r.getFightRoundNumber() != null && r.getFightRoundNumber() > 0)
|
||||
.collect(Collectors.toList());
|
||||
List<TtBoxRecords> endGameRecords = fightBoxRecords.stream()
|
||||
.filter(r -> r.getFightRoundNumber() == null || r.getFightRoundNumber() <= 0)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 胜利方获得的回合饰品(排除赛后奖励)
|
||||
// 胜利方:DB winner_ids 为空时,从 Redis 对战状态快照兜底(单场处理,异常不影响批量流程)
|
||||
List<Integer> winnerIds = fight.getWinnerIds() != null ? fight.getWinnerIds() : new ArrayList<>();
|
||||
// 数据库 winner_ids 为空时,从 Redis 对战状态快照兜底(单个 fight 处理,异常不影响批量流程)
|
||||
if (winnerIds.isEmpty()) {
|
||||
try {
|
||||
FightState state = redisCache.getCacheObject("fight_state:" + fightId);
|
||||
@@ -471,63 +442,57 @@ public class TtFightResultServiceImpl extends ServiceImpl<TtFightResultMapper, T
|
||||
log.warn("对战{} 从Redis获取winnerIds兜底失败: {}", fightId, e.getMessage());
|
||||
}
|
||||
}
|
||||
final List<Integer> finalWinnerIds = winnerIds;
|
||||
List<TtBoxRecords> winnerPrize = roundResults.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.collect(Collectors.toList());
|
||||
// 平分奖:赛后奖励中持有人为赢家的记录,计入赢家所得
|
||||
winnerPrize.addAll(endGameRecords.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.filter(r -> r.getOrnamentId() != null)
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
// 失败方安慰奖
|
||||
List<TtBoxRecords> endGamePrize = endGameRecords.stream()
|
||||
.filter(r -> r.getHolderUserId() != null && !finalWinnerIds.contains(r.getHolderUserId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 填充 exteriorName
|
||||
List<TtBoxRecords> allPrizeRecords = new ArrayList<>();
|
||||
allPrizeRecords.addAll(winnerPrize);
|
||||
allPrizeRecords.addAll(endGamePrize);
|
||||
final Map<Long, String> finalExteriorNameMap = exteriorNameMap;
|
||||
allPrizeRecords.forEach(r -> {
|
||||
if (r.getOrnamentId() != null) {
|
||||
r.setExteriorName(finalExteriorNameMap.getOrDefault(r.getOrnamentId(), "崭新出厂"));
|
||||
// 明细列表(fightResult/winnerPrize/endGamePrize)不组装,直接把口径累加成金额:
|
||||
// 赢家所得 = 持有人为赢家的全部记录(回合饰品 + 赛后平分奖),只算真实饰品(ornamentId 非空);
|
||||
// 失败方安慰奖 = 赛后记录(回合数<=0)中持有人非赢家的部分。
|
||||
BigDecimal winnerTotalPrice = BigDecimal.ZERO;
|
||||
BigDecimal loserTotalPrice = BigDecimal.ZERO;
|
||||
BigDecimal totalOrnamentsPrice = BigDecimal.ZERO;
|
||||
for (TtBoxRecords record : fightBoxRecords) {
|
||||
BigDecimal price = record.getOrnamentsPrice();
|
||||
if (price == null) {
|
||||
continue;
|
||||
}
|
||||
});
|
||||
totalOrnamentsPrice = totalOrnamentsPrice.add(price);
|
||||
Integer holderUserId = record.getHolderUserId();
|
||||
if (holderUserId == null) {
|
||||
continue;
|
||||
}
|
||||
if (winnerIds.contains(holderUserId)) {
|
||||
if (record.getOrnamentId() != null) {
|
||||
winnerTotalPrice = winnerTotalPrice.add(price);
|
||||
}
|
||||
} else if (record.getFightRoundNumber() == null || record.getFightRoundNumber() <= 0) {
|
||||
loserTotalPrice = loserTotalPrice.add(price);
|
||||
}
|
||||
}
|
||||
|
||||
// 获得的饰品按价格降序,空价格放最后
|
||||
roundResults.sort(ORNAMENT_PRICE_DESC);
|
||||
winnerPrize.sort(ORNAMENT_PRICE_DESC);
|
||||
endGamePrize.sort(ORNAMENT_PRICE_DESC);
|
||||
|
||||
// 计算金额
|
||||
BigDecimal winnerTotalPrice = winnerPrize.stream()
|
||||
.map(r -> r.getOrnamentsPrice() != null ? r.getOrnamentsPrice() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal loserTotalPrice = endGamePrize.stream()
|
||||
.map(r -> r.getOrnamentsPrice() != null ? r.getOrnamentsPrice() : BigDecimal.ZERO)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal totalOrnamentsPrice = fightBoxRecords.stream()
|
||||
.filter(r -> r.getOrnamentsPrice() != null)
|
||||
.map(TtBoxRecords::getOrnamentsPrice)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
FightResultVO resultVO = FightResultVO.builder()
|
||||
result.add(FightResultVO.builder()
|
||||
.fight(fight)
|
||||
.winnerIds(winnerIds)
|
||||
.fightResult(roundResults)
|
||||
.winnerPrize(winnerPrize)
|
||||
.endGamePrize(endGamePrize)
|
||||
.winnerTotalPrice(winnerTotalPrice)
|
||||
.loserTotalPrice(loserTotalPrice)
|
||||
.totalOrnamentsPrice(totalOrnamentsPrice)
|
||||
.fightBoxVOList(fightBoxVOList)
|
||||
.build();
|
||||
result.add(resultVO);
|
||||
.build());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* boxData 反序列化后可能是 FightBoxVO,也可能是原始 Map(历史脏数据),统一取成 FightBoxVO。
|
||||
*/
|
||||
private FightBoxVO resolveFightBoxVO(Object value) {
|
||||
if (value == null) return null;
|
||||
if (value instanceof FightBoxVO) return (FightBoxVO) value;
|
||||
if (value instanceof LinkedHashMap) {
|
||||
Map<String, Object> map = (LinkedHashMap) value;
|
||||
return new FightBoxVO(
|
||||
map.get("boxId") != null ? Integer.valueOf(map.get("boxId").toString()) : null,
|
||||
map.get("number") != null ? Integer.valueOf(map.get("number").toString()) : null,
|
||||
map.get("boxImg01") != null ? map.get("boxImg01").toString() : null,
|
||||
map.get("boxImg02") != null ? map.get("boxImg02").toString() : null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-15
@@ -473,11 +473,6 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TtUser> getAccountList(Integer num) {
|
||||
return getAccountList(num, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<TtUser> getAccountList(Integer num, List<String> customPhoneNumbers) {
|
||||
@@ -490,8 +485,8 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
.list();
|
||||
List<TtUser> userList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// 优先使用第 i 个自定义手机号,为空则随机生成
|
||||
String phoneNumber = getCustomPhoneOrRandom(customPhoneNumbers, i);
|
||||
// 招商账号必须逐个指定手机号,不随机生成
|
||||
String phoneNumber = getRequiredPhone(customPhoneNumbers, i, "招商账号");
|
||||
String nickName = RandomUtils.getRandomName(new Random().nextInt(2));
|
||||
String password = generateMixedPassword(10);
|
||||
String invitationCode = getInvitationCode();
|
||||
@@ -523,7 +518,7 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
}
|
||||
|
||||
/**
|
||||
* 取第 index 个自定义手机号;为空或越界时返回随机生成的手机号
|
||||
* 取第 index 个自定义手机号;为空或越界时返回随机生成的手机号(仅白号使用)
|
||||
*/
|
||||
private String getCustomPhoneOrRandom(List<String> customPhoneNumbers, int index) {
|
||||
if (customPhoneNumbers != null && index < customPhoneNumbers.size()
|
||||
@@ -533,6 +528,22 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
return getRandomPhoneNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取第 index 个手机号(必填)。招商/卡商账号是推广后台的登录账号,
|
||||
* 登录只认「手机号 + 短信验证码」,随机号收不到码就等于发一个登不进去的号,所以不兜底随机生成。
|
||||
*/
|
||||
private String getRequiredPhone(List<String> customPhoneNumbers, int index, String label) {
|
||||
String phone = customPhoneNumbers != null && index < customPhoneNumbers.size()
|
||||
? StringUtils.trim(customPhoneNumbers.get(index)) : null;
|
||||
if (StringUtils.isBlank(phone)) {
|
||||
throw new ServiceException("请填写第 " + (index + 1) + " 个" + label + "的手机号");
|
||||
}
|
||||
if (!phone.matches("^1[3-9]\\d{9}$")) {
|
||||
throw new ServiceException("第 " + (index + 1) + " 个手机号格式不正确,请输入 11 位有效手机号");
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验自定义手机号:批次内不可重复,且不可与库中已存在(用户名/手机号)冲突。
|
||||
* 忽略 del_flag,连软删除记录也拦截,避免直接 insert 触发唯一键冲突。
|
||||
@@ -722,11 +733,6 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
return userList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TtUser> getCardMerchantList(Integer num) {
|
||||
return getCardMerchantList(num, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<TtUser> getCardMerchantList(Integer num, List<String> customPhoneNumbers) {
|
||||
@@ -739,8 +745,8 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
.list();
|
||||
List<TtUser> userList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// 优先使用第 i 个自定义手机号,为空则随机生成
|
||||
String phoneNumber = getCustomPhoneOrRandom(customPhoneNumbers, i);
|
||||
// 卡商账号必须逐个指定手机号,不随机生成
|
||||
String phoneNumber = getRequiredPhone(customPhoneNumbers, i, "卡商账号");
|
||||
String nickName = RandomUtils.getRandomName(new Random().nextInt(2));
|
||||
String password = generateMixedPassword(10);
|
||||
String invitationCode = getInvitationCode();
|
||||
|
||||
-7
@@ -1,7 +1,5 @@
|
||||
package com.ruoyi.playingmethod.contract.api.request;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -18,25 +16,20 @@ import jakarta.validation.constraints.Min;
|
||||
* - boxId 为空:查询全部箱子的记录
|
||||
* - boxId 不为空:仅查询当前选中箱子的记录
|
||||
*/
|
||||
@ApiModel("经典开箱记录查询参数")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public class ClassicBoxRecordPageRequest {
|
||||
|
||||
@ApiModelProperty("页码,默认 1")
|
||||
@Min(value = 1, message = "页码最小 1")
|
||||
private Integer page = 1;
|
||||
|
||||
@ApiModelProperty("每页条数,默认 20")
|
||||
@Range(min = 1, max = 50, message = "每页条数 1-50")
|
||||
private Integer size = 20;
|
||||
|
||||
@ApiModelProperty("选中箱子 ID:为空则查询全部箱子的记录,不为空则仅查询该箱子")
|
||||
private Integer boxId;
|
||||
|
||||
@ApiModelProperty("排序方式:0-时间降序,1-时间升序,2-价格降序,默认 0")
|
||||
@Builder.Default
|
||||
private Integer orderByFie = 0;
|
||||
}
|
||||
|
||||
-3
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.playingmethod.contract.api.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -15,11 +14,9 @@ public class GetRollListParamRequest {
|
||||
private Integer rollId;
|
||||
|
||||
// 0官方 1主播
|
||||
@ApiModelProperty("0官方 1主播")
|
||||
private Integer rollType;
|
||||
|
||||
// 0全部 1可参与 2我的 3已结束
|
||||
@ApiModelProperty("0全部 1可参与 2我的 3已结束")
|
||||
private Integer rollStatus;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
+6
-28
@@ -33,10 +33,6 @@ import com.ruoyi.playingmethod.contract.api.request.ClassicBoxRecordPageRequest;
|
||||
import com.ruoyi.playingmethod.service.ApiBindBoxService;
|
||||
import com.ruoyi.playingmethod.service.ApiBoxRecordsService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -46,7 +42,6 @@ import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Api(tags = "玩转盲盒模式")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/bindbox")
|
||||
@@ -79,7 +74,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@ApiOperation("获取宝箱信息")
|
||||
@Anonymous
|
||||
@PostMapping("/boxData")
|
||||
public R<TtBoxA> getBoxData(@RequestBody BoxIdRequest request) {
|
||||
@@ -95,17 +89,12 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(boxData);
|
||||
}
|
||||
|
||||
@ApiOperation("获取补偿箱信息")
|
||||
@PostMapping("/getCompBoxData")
|
||||
// [停用-前端零调用] @PostMapping("/getCompBoxData")
|
||||
public AjaxResult getCompBoxData(@RequestBody BoxIdRequest request) {
|
||||
List<TtOrnamentsA> compBoxData = bindBoxService.getCompBoxData(request.getBoxId());
|
||||
return success(compBoxData);
|
||||
}
|
||||
|
||||
@ApiOperation("获取宝箱列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "boxType", value = "宝箱类型(1普通箱 2对战箱 3补偿箱 4九宫格)", dataType = "String", dataTypeClass = String.class)
|
||||
})
|
||||
@Anonymous
|
||||
@PostMapping("/getBoxList")
|
||||
public R<List<TtBoxVO>> getBoxList(@RequestBody(required=false) GetBoxListRequest request) {
|
||||
@@ -123,7 +112,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
/**
|
||||
* 盲盒开箱模式开箱
|
||||
*/
|
||||
@ApiOperation("盲盒开箱")
|
||||
@UpdateUserCache
|
||||
@RateLimiter(time = 60, count = 30, limitType = LimitType.IP)
|
||||
@PostMapping("/openBox")
|
||||
@@ -182,8 +170,7 @@ public class ApiBindBoxController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取历史开箱信息")
|
||||
@PostMapping("/getBindBoxHistory")
|
||||
// [停用-前端零调用] @PostMapping("/getBindBoxHistory")
|
||||
public R getBindBoxHistory(@RequestBody @Validated queryCondition param) {
|
||||
if (param.getStatus().equals(1) || param.getStatus().equals(10)) {
|
||||
return R.fail("非法的状态参数。");
|
||||
@@ -193,7 +180,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(ttBoxRecordsVOS);
|
||||
}
|
||||
|
||||
@ApiOperation("获取个人历史开箱记录")
|
||||
@PostMapping("/myBoxHistory")
|
||||
public R<List<TtBoxRecordsVO>> myBoxHistory(@RequestBody queryCondition param) {
|
||||
Long userId = getUserId();
|
||||
@@ -217,8 +203,7 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取当前补偿值")
|
||||
@PostMapping("/getCompValue")
|
||||
// [停用-前端零调用] @PostMapping("/getCompValue")
|
||||
public AjaxResult getCompValue(@RequestBody BoxIdRequest request) {
|
||||
Long userId = getUserId();
|
||||
TtUser ttUser = userService.getById(userId);
|
||||
@@ -230,8 +215,7 @@ public class ApiBindBoxController extends BaseController {
|
||||
return success(bindBoxService.getCompValue(ttUser, ttBox));
|
||||
}
|
||||
|
||||
@ApiOperation("盲盒top")
|
||||
@PostMapping("/top")
|
||||
// [停用-前端零调用] @PostMapping("/top")
|
||||
public R<List<TtBoxRecordsVO>> topBlinkBox() {
|
||||
Long userId = getUserId();
|
||||
if (ObjectUtil.isNull(userId)) {
|
||||
@@ -253,8 +237,7 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(ttBoxRecordsVOS);
|
||||
}
|
||||
|
||||
@ApiOperation("十佳掉落")
|
||||
@PostMapping("/tenTop")
|
||||
// [停用-前端零调用] @PostMapping("/tenTop")
|
||||
public R<List<TtBoxRecordsVO>> tenTop() {
|
||||
TenTopQuery param = new TenTopQuery();
|
||||
param.setSource(Collections.singletonList(TtboxRecordSource.BLIND_BOX.getCode()));
|
||||
@@ -266,7 +249,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(ttBoxRecordsVOS);
|
||||
}
|
||||
|
||||
@ApiOperation("今日百佳")
|
||||
@PostMapping("/todayTopHundred")
|
||||
public R<List<TtBoxRecordsVO>> todayTopHundred() {
|
||||
List<Integer> status = Arrays.asList(
|
||||
@@ -283,8 +265,7 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("历史百佳")
|
||||
@PostMapping("/historyTopHundred")
|
||||
// [停用-前端零调用] @PostMapping("/historyTopHundred")
|
||||
public R<List<TtBoxRecordsVO>> historyTopHundred() {
|
||||
List<Integer> status = Arrays.asList(
|
||||
TtboxRecordStatus.IN_PACKSACK_ON.getCode(),
|
||||
@@ -300,7 +281,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("实时 - 所有人历史开箱按时间排序")
|
||||
@Anonymous
|
||||
@PostMapping("/realtime")
|
||||
public R<List<TtBoxRecordsVO>> realtime(@RequestBody @Validated BoxRecordPageRequest request) {
|
||||
@@ -324,7 +304,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("欧皇 - 所有人开箱按最高价格排序")
|
||||
@Anonymous
|
||||
@PostMapping("/luckyKing")
|
||||
public R<List<TtBoxRecordsVO>> luckyKing(@RequestBody @Validated BoxRecordPageRequest request) {
|
||||
@@ -357,7 +336,6 @@ public class ApiBindBoxController extends BaseController {
|
||||
* - 全服全部箱子:不传参数 / 不登录 → 查看所有用户的所有箱子的开箱记录
|
||||
* - 全服当前箱子:不传 userId + 传 boxId / 不登录 → 查看指定箱子的全服记录
|
||||
*/
|
||||
@ApiOperation("经典开箱记录")
|
||||
@Anonymous
|
||||
@PostMapping("/classicRecords")
|
||||
public R<List<TtBoxRecordsVO>> classicRecords(@RequestBody @Validated ClassicBoxRecordPageRequest request) {
|
||||
|
||||
+1
-5
@@ -6,8 +6,6 @@ import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.domain.dto.boxRecords.queryCondition;
|
||||
import com.ruoyi.domain.vo.boxRecords.TtBoxRecordsVO;
|
||||
import com.ruoyi.playingmethod.service.ApiBoxRecordsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "出货记录")
|
||||
@RestController
|
||||
@RequestMapping("/api/boxRecords")
|
||||
public class ApiBoxRecordsController {
|
||||
@@ -25,8 +22,7 @@ public class ApiBoxRecordsController {
|
||||
@Autowired
|
||||
private ApiBoxRecordsService apiBoxRecordsService;
|
||||
|
||||
@ApiOperation("获取历史出货记录")
|
||||
@PostMapping("/historyByCondition")
|
||||
// [停用-前端零调用] @PostMapping("/historyByCondition")
|
||||
public R getBindBoxHistory(@RequestBody @Validated queryCondition param) {
|
||||
if (param.getStatus().contains(1) || param.getStatus().contains(10)) {
|
||||
return R.fail("非法的状态参数。");
|
||||
|
||||
+2
-7
@@ -8,13 +8,10 @@ import com.ruoyi.common.core.page.PageDataInfo;
|
||||
import com.ruoyi.playingmethod.service.ApiCompoundService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.domain.vo.UserPackSackDataVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "合成")
|
||||
@RestController
|
||||
@RequestMapping("/api/compound")
|
||||
public class ApiCompoundController extends BaseController {
|
||||
@@ -31,8 +28,7 @@ public class ApiCompoundController extends BaseController {
|
||||
this.compoundService = compoundService;
|
||||
}
|
||||
|
||||
@ApiOperation("合成")
|
||||
@PostMapping("/compound")
|
||||
// [停用-前端零调用] @PostMapping("/compound")
|
||||
public R<UserPackSackDataVO> compound(@RequestBody List<Long> packSackIds) {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
if ("1".equals(websiteMaintenance)) {
|
||||
@@ -46,8 +42,7 @@ public class ApiCompoundController extends BaseController {
|
||||
return compoundService.compound(packSackIds, ttUser);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户合成记录")
|
||||
@PostMapping("/getUserCompoundRecord")
|
||||
// [停用-前端零调用] @PostMapping("/getUserCompoundRecord")
|
||||
public PageDataInfo<UserPackSackDataVO> getUserCompoundRecord() {
|
||||
startPage();
|
||||
List<UserPackSackDataVO> userCompoundRecord = compoundService.getUserCompoundRecord(getUserId().intValue());
|
||||
|
||||
+7
-22
@@ -19,10 +19,6 @@ import com.ruoyi.playingmethod.contract.api.request.BoxIdRequest;
|
||||
import com.ruoyi.playingmethod.contract.api.request.OpenBoxRequest;
|
||||
import com.ruoyi.playingmethod.mapper.ApiBindBoxMapper;
|
||||
import com.ruoyi.playingmethod.service.ApiExponentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -34,7 +30,6 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
@Api(tags = "指数盲盒")
|
||||
@RestController
|
||||
@RequestMapping("/api/exponent")
|
||||
public class ApiExponentController extends BaseController {
|
||||
@@ -57,10 +52,9 @@ public class ApiExponentController extends BaseController {
|
||||
@Autowired
|
||||
private RedisLock redisLock;
|
||||
|
||||
@ApiOperation("加入指数盲盒")
|
||||
@Anonymous
|
||||
@UpdateUserCache
|
||||
@PostMapping("/join")
|
||||
// [停用-前端零调用] @PostMapping("/join")
|
||||
public R join(@RequestBody @Validated ExponentJoinParam param) {
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
if ("0".equals(ttUser.getIsRealCheck())) {
|
||||
@@ -95,53 +89,44 @@ public class ApiExponentController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取宝箱列表")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "boxType", value = "宝箱类型(1普通箱 2对战箱 3补偿箱 4九宫格 5指数盲盒)", dataType = "String", dataTypeClass = String.class)
|
||||
})
|
||||
@Anonymous
|
||||
@PostMapping("/box")
|
||||
// [停用-前端零调用] @PostMapping("/box")
|
||||
public R box(@RequestBody BoxIdRequest request) {
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
return apiExponentService.box(ttUser, request.getBoxId());
|
||||
}
|
||||
|
||||
@ApiOperation("最近十期结果")
|
||||
@Anonymous
|
||||
@PostMapping("/recenttenperiod")
|
||||
// [停用-前端零调用] @PostMapping("/recenttenperiod")
|
||||
public R recenttenperiod() {
|
||||
PageUtils.clearPage();
|
||||
return apiExponentService.recenttenperiod();
|
||||
}
|
||||
|
||||
@ApiOperation("结果信息")
|
||||
@Anonymous
|
||||
@PostMapping("/info")
|
||||
// [停用-前端零调用] @PostMapping("/info")
|
||||
public R info() {
|
||||
PageUtils.clearPage();
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
return apiExponentService.info(ttUser);
|
||||
}
|
||||
|
||||
@ApiOperation("指数记录")
|
||||
@Anonymous
|
||||
@PostMapping("/records")
|
||||
// [停用-前端零调用] @PostMapping("/records")
|
||||
public R records() {
|
||||
startPage();
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
return apiExponentService.records(ttUser);
|
||||
}
|
||||
|
||||
@ApiOperation("我的箱子")
|
||||
@Anonymous
|
||||
@PostMapping("/mybox")
|
||||
// [停用-前端零调用] @PostMapping("/mybox")
|
||||
public R mybox() {
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
return apiExponentService.mybox(ttUser);
|
||||
}
|
||||
@ApiOperation("盲盒开箱")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/openBox")
|
||||
// [停用-前端零调用] @PostMapping("/openBox")
|
||||
public R openBox(@RequestBody OpenBoxRequest request) {
|
||||
TtUser ttUser = ttUserService.getById(getUserId());
|
||||
if ("0".equals(ttUser.getIsRealCheck())) {
|
||||
|
||||
+8
-39
@@ -34,16 +34,15 @@ import com.ruoyi.domain.other.TtBoxVO;
|
||||
import com.ruoyi.domain.vo.ApiFightListDataVO;
|
||||
import com.ruoyi.domain.vo.FightResultDataVO;
|
||||
import com.ruoyi.domain.vo.fight.FightBoxVO;
|
||||
import com.ruoyi.domain.vo.fight.FightResultVO;
|
||||
import com.ruoyi.domain.vo.upgrade.SimpleOrnamentVO;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightCardVo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightRankingVO;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightResultVo;
|
||||
import com.ruoyi.playingmethod.service.ApiBindBoxService;
|
||||
import com.ruoyi.playingmethod.service.ApiFightService;
|
||||
import com.ruoyi.playingmethod.contract.api.request.BoxIdRequest;
|
||||
import com.ruoyi.domain.other.TtBoxA;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
@@ -58,13 +57,11 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Api(tags = "对战模式")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/fight")
|
||||
public class ApiFightController extends BaseController {
|
||||
|
||||
private final TtFightResultService fightResultService;
|
||||
private final ISysConfigService sysConfigService;
|
||||
private final TtUserService userService;
|
||||
private final ApiFightService apiFightService;
|
||||
@@ -85,12 +82,10 @@ public class ApiFightController extends BaseController {
|
||||
@Autowired
|
||||
private TtUserMapper ttUserMapper;
|
||||
|
||||
public ApiFightController(TtFightResultService fightResultService,
|
||||
ISysConfigService sysConfigService,
|
||||
public ApiFightController(ISysConfigService sysConfigService,
|
||||
TtUserService userService,
|
||||
ApiFightService apiFightService,
|
||||
RedisCache redisCache) {
|
||||
this.fightResultService = fightResultService;
|
||||
this.sysConfigService = sysConfigService;
|
||||
this.userService = userService;
|
||||
this.apiFightService = apiFightService;
|
||||
@@ -117,7 +112,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* Step1 创建对战房间
|
||||
*/
|
||||
@ApiOperation("创建对战房间")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/createFight")
|
||||
public R createFight(@Validated @RequestBody CreateFightBody createFightParam) {
|
||||
@@ -157,7 +151,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* 复刻对战房间:复制目标房间的宝箱配置、人数、组队模式等,创建一个新房间,当前用户成为房主
|
||||
*/
|
||||
@ApiOperation("复刻对战房间")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/copyFight")
|
||||
public R copyFight(@RequestBody FightDetailParam param) {
|
||||
@@ -196,7 +189,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* Step2 加入房间(占座),先行HTTP
|
||||
*/
|
||||
@ApiOperation("加入对战房间")
|
||||
@PostMapping("/joinFightRoom")
|
||||
public R joinFightRoom(@RequestBody FightDetailParam param) {
|
||||
Integer fightId = param.getFightId();
|
||||
@@ -234,8 +226,7 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* 退出房间
|
||||
*/
|
||||
@ApiOperation("退出房间")
|
||||
@PostMapping("/fightRoomExit")
|
||||
// [停用-前端零调用] @PostMapping("/fightRoomExit")
|
||||
public R fightRoomExit(@RequestBody FightDetailParam param) {
|
||||
Integer fightId = param.getFightId();
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
@@ -255,7 +246,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* Step3 玩家准备游戏
|
||||
*/
|
||||
@ApiOperation("玩家准备游戏")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/seatrReady")
|
||||
public R seatrReady(@RequestBody FightDetailParam param) {
|
||||
@@ -281,7 +271,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* Step4 开始游戏(前端满人自动开始)
|
||||
*/
|
||||
@ApiOperation("开始游戏")
|
||||
@PostMapping("/fightBegin")
|
||||
public R fightBegin(@RequestBody FightDetailParam param) {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
@@ -305,7 +294,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* 游戏结束标记
|
||||
*/
|
||||
@ApiOperation("游戏结束标记")
|
||||
@PostMapping("/fightEnd")
|
||||
public R fightEnd(@RequestBody FightDetailParam param) {
|
||||
Integer fightId = param.getFightId();
|
||||
@@ -323,7 +311,6 @@ public class ApiFightController extends BaseController {
|
||||
/**
|
||||
* 抽奖机测试
|
||||
*/
|
||||
// @ApiOperation("抽奖机测试")
|
||||
// @GetMapping("LotteryMachineTest")
|
||||
public R LotteryMachineTest() {
|
||||
R checkLogin = checkLogin();
|
||||
@@ -337,7 +324,6 @@ public class ApiFightController extends BaseController {
|
||||
return R.ok(ornamentId);
|
||||
}
|
||||
|
||||
@ApiOperation("我参与的历史对战记录")
|
||||
@PostMapping("/fightOnMyOwn")
|
||||
public R fightOnMyOwn(@RequestBody FightOnMyOwnParam param) {
|
||||
Long userId = getUserId();
|
||||
@@ -345,7 +331,7 @@ public class ApiFightController extends BaseController {
|
||||
|
||||
param.setPlayerId(userId.intValue());
|
||||
|
||||
List<ApiFightListDataVO> list = apiFightService.getFightList(param);
|
||||
List<ApiFightCardVo> list = apiFightService.getFightList(param);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@@ -353,7 +339,6 @@ public class ApiFightController extends BaseController {
|
||||
* 快速加入对战房间 - 在本阵营(model 0=欧皇 1=非酋)内返回等待中且有空座位、
|
||||
* 总价不超过用户余额的最高价房间 id(不落座,需登录)
|
||||
*/
|
||||
@ApiOperation("快速加入对战房间")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/quickJoinFightRoom")
|
||||
public R<Long> quickJoinFightRoom(@RequestBody QuickJoinFightParam param) {
|
||||
@@ -365,26 +350,22 @@ public class ApiFightController extends BaseController {
|
||||
return apiFightService.quickJoinFightRoom(userId, param != null ? param.getModel() : null);
|
||||
}
|
||||
|
||||
@ApiOperation("全服历史对战记录")
|
||||
@PostMapping("/fightOnAll")
|
||||
public R fightOnAll(@RequestBody FightOnMyOwnParam param) {
|
||||
List<ApiFightListDataVO> list = apiFightService.getFightList(param);
|
||||
List<ApiFightCardVo> list = apiFightService.getFightList(param);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("历史对战详情")
|
||||
@PostMapping("/fightDetail")
|
||||
public R fightDetail(@RequestBody FightDetailParam param) {
|
||||
return apiFightService.fightDetail(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取指定记录更早的历史对战")
|
||||
@PostMapping("/earlierHistory")
|
||||
public R earlierHistory(@RequestBody FightDetailParam param) {
|
||||
return apiFightService.earlierHistory(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战宝箱详情")
|
||||
@PostMapping("/simpleBoxDetail")
|
||||
public PageDataInfo<SimpleOrnamentVO> simpleBoxDetail(@RequestBody Map<String, Integer> param) {
|
||||
startPage();
|
||||
@@ -393,7 +374,6 @@ public class ApiFightController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战宝箱")
|
||||
@PostMapping("/getFightBoxList")
|
||||
@Anonymous
|
||||
public R<List<TtBoxVO>> getFightBoxList(@RequestBody(required = false) Map<String, Integer> param) {
|
||||
@@ -403,7 +383,6 @@ public class ApiFightController extends BaseController {
|
||||
return R.ok(boxData);
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战列表")
|
||||
@Anonymous
|
||||
@PostMapping("/getFightList")
|
||||
public PageDataInfo<ApiFightListDataVO> getFightList(@RequestBody(required = false) Map<String, Object> param) {
|
||||
@@ -415,7 +394,6 @@ public class ApiFightController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战大厅房间列表(HTTP)")
|
||||
@Anonymous
|
||||
@PostMapping("/hall")
|
||||
public R<Map<String, Object>> fightHall(@RequestBody(required = false) Map<String, Object> param) {
|
||||
@@ -509,28 +487,24 @@ public class ApiFightController extends BaseController {
|
||||
return R.ok(result, "所有对战房间");
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战数据")
|
||||
@PostMapping("/getFightData")
|
||||
public R<ApiFightListDataVO> getFightData(@RequestBody FightDetailParam param) {
|
||||
ApiFightListDataVO apiFightListDataVO = apiFightService.getFightList(null, null, null, param.getFightId()).get(0);
|
||||
return R.ok(apiFightListDataVO);
|
||||
}
|
||||
|
||||
// @ApiOperation("获取对战结果")
|
||||
// @GetMapping("/getFightResult/{fightId}")
|
||||
// public R<FightResultDataVO> getFightResult(@PathVariable("fightId") Integer fightId) {
|
||||
// FightResultDataVO fightResultDataVO = fightResultService.getFightResult(fightId);
|
||||
// return R.ok(fightResultDataVO);
|
||||
// }
|
||||
|
||||
@ApiOperation("获取对战结果")
|
||||
@PostMapping("/getFightResult")
|
||||
public R<FightResultVO> getFightResult(@RequestBody FightDetailParam param) {
|
||||
FightResultVO fightResultVO = fightResultService.getFightResult(param.getFightId());
|
||||
public R<ApiFightResultVo> getFightResult(@RequestBody FightDetailParam param) {
|
||||
ApiFightResultVo fightResultVO = apiFightService.getFightResultForClient(param.getFightId());
|
||||
return R.ok(fightResultVO);
|
||||
}
|
||||
|
||||
@ApiOperation("存储对战回合数据")
|
||||
@PostMapping("/saveFightBoutData")
|
||||
public R<Boolean> saveFightBoutData(@RequestBody FightBoutData fightBoutData) {
|
||||
R checkLogin = checkLogin();
|
||||
@@ -540,7 +514,6 @@ public class ApiFightController extends BaseController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战回合数")
|
||||
@PostMapping("/getFightBoutNum")
|
||||
public R<Integer> getFightBoutNum(@RequestBody FightDetailParam param) {
|
||||
Integer fightId = param.getFightId();
|
||||
@@ -580,7 +553,6 @@ public class ApiFightController extends BaseController {
|
||||
return R.ok(fightResultDataVO);
|
||||
}
|
||||
|
||||
@ApiOperation("获取对战排行榜")
|
||||
@Anonymous
|
||||
@PostMapping("/fightRanking")
|
||||
public AjaxResult getFightRanking() {
|
||||
@@ -605,14 +577,12 @@ public class ApiFightController extends BaseController {
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
@ApiOperation("十佳对战, 1:最大金额,2:最大增长,3:最大倍数")
|
||||
@Anonymous
|
||||
@PostMapping("/tenTopFight")
|
||||
public AjaxResult tenTopFight(@RequestBody BaiJiaFightParam param) {
|
||||
return AjaxResult.success(apiFightService.tenTopFight(param.getMaxType(), param.getModel(), param.getMinPrice(), param.getMaxPrice(), param.getKeyword()));
|
||||
}
|
||||
|
||||
@ApiOperation("邀请机器人加入对战房间")
|
||||
@PostMapping({"/joinFightRoomForRobot"})
|
||||
public R joinFightRoomForRobot(@RequestBody FightDetailParam param) {
|
||||
R checkLogin = checkLogin();
|
||||
@@ -653,7 +623,6 @@ public class ApiFightController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("对战宝箱详情")
|
||||
@Anonymous
|
||||
@PostMapping("/boxData")
|
||||
public R<TtBoxA> getFightBoxData(@RequestBody BoxIdRequest request) {
|
||||
|
||||
+1
-5
@@ -18,8 +18,6 @@ import com.ruoyi.domain.vo.fight.FightBoxVO;
|
||||
import com.ruoyi.domain.vo.fight.FightResultVO;
|
||||
import com.ruoyi.playingmethod.contract.api.request.FightRoomInfoRequest;
|
||||
import com.ruoyi.playingmethod.service.ApiFightService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -39,7 +37,6 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 对战房间 HTTP 接口(原 WsFightRoom WebSocket 接口的 HTTP 替代)
|
||||
*/
|
||||
@Api(tags = "对战房间HTTP接口")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/fight/room")
|
||||
@@ -60,8 +57,7 @@ public class ApiFightRoomController extends BaseController {
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@ApiOperation("获取对战房间信息/结果")
|
||||
@PostMapping("/info")
|
||||
// [停用-前端零调用] @PostMapping("/info")
|
||||
public R<Object> info(@RequestBody FightRoomInfoRequest request) {
|
||||
Long userId = getUserId();
|
||||
Integer fightId = request.getFightId();
|
||||
|
||||
+3
-13
@@ -21,8 +21,6 @@ import com.ruoyi.playingmethod.service.ApiLuckyUpgradeService;
|
||||
import com.ruoyi.playingmethod.service.ApiUpgradeRecordService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.user.service.ApiUserPackSackService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -32,7 +30,6 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "幸运升级模式")
|
||||
@RestController
|
||||
@RequestMapping("/api/luckyUpgrade")
|
||||
public class ApiLuckyUpgradeController extends BaseController {
|
||||
@@ -66,7 +63,6 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取可升级的饰品列表")
|
||||
@Anonymous
|
||||
@PostMapping("/getOrnamentsList")
|
||||
public R<List<ApiLuckyOrnamentsDataVO>> getOrnamentsList(@RequestBody ApiLuckyUpgradeBody apiLuckyUpgradeBody){
|
||||
@@ -89,7 +85,6 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("幸运升级")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/upgrade")
|
||||
public R upgrade(@RequestBody @Validated UpgradeBodyA upgradeParam){
|
||||
@@ -109,14 +104,12 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
return apiLuckyUpgradeService.upgrade(ttUser, upgradeParam);
|
||||
}
|
||||
|
||||
@ApiOperation("获取幸运升级历史记录")
|
||||
@PostMapping("/getUpgradeRecord")
|
||||
// [停用-前端零调用] @PostMapping("/getUpgradeRecord")
|
||||
public R getUpgradeRecord(@RequestBody @Validated UpgradeCondition param){
|
||||
return upgradeRecordService.historyDetail(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取幸运升级十佳记录")
|
||||
@PostMapping("/tenTopUpgradeRecord")
|
||||
// [停用-前端零调用] @PostMapping("/tenTopUpgradeRecord")
|
||||
public R tenTopUpgradeRecord(@RequestBody(required = false) TenTopUpgradeRequest request){
|
||||
Boolean isVictory = (request == null) ? null : request.getIsVictory();
|
||||
R result = upgradeRecordService.tenTopDetail(isVictory);
|
||||
@@ -134,8 +127,7 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("获取个人幸运升级历史记录列表")
|
||||
@PostMapping("/myHistoryRecord")
|
||||
// [停用-前端零调用] @PostMapping("/myHistoryRecord")
|
||||
public R myHistoryRecord(@RequestBody(required = false) @Validated MyUpgradeRecordRequest request){
|
||||
R check = checkLogin();
|
||||
if (!check.getCode().equals(200)) {
|
||||
@@ -148,7 +140,6 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
return upgradeRecordService.myHistoryRecord(userId, request);
|
||||
}
|
||||
|
||||
@ApiOperation("获取当前饰品最近100条拉取记录(含用户头像、概率、饰品全名、磨损度、品质图、图片、价格)")
|
||||
@PostMapping("/recentPulls")
|
||||
public R<List<ApiLuckyUpgradeRecentPullVO>> recentPulls(@RequestBody @Validated UpgradeCondition param) {
|
||||
if (param.getUpgradeRecordId() == null) {
|
||||
@@ -158,7 +149,6 @@ public class ApiLuckyUpgradeController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("幸运升级记录分页(scope: 0全服/1我的;itemScope: 0全部饰品/1当前饰品;均需登录)")
|
||||
@PostMapping("/recordPage")
|
||||
public R recordPage(@RequestBody @Validated UpgradeRecordPageRequest req) {
|
||||
// 记录页无论全服/我的均需登录
|
||||
|
||||
-8
@@ -15,8 +15,6 @@ import com.ruoyi.playingmethod.contract.api.request.GetRedPackRequest;
|
||||
import com.ruoyi.playingmethod.service.ApiRedPackService;
|
||||
import com.ruoyi.thirdparty.wechat.domain.PtLoginUser;
|
||||
import com.ruoyi.thirdparty.wechat.service.ApiTokenService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,7 +27,6 @@ import java.util.List;
|
||||
@Deprecated
|
||||
@RestController
|
||||
@RequestMapping("/api/redPackData")
|
||||
@Api(tags = "红包")
|
||||
public class ApiRedPackContoller extends BaseController {
|
||||
|
||||
@Autowired
|
||||
@@ -42,7 +39,6 @@ public class ApiRedPackContoller extends BaseController {
|
||||
// @PostMapping("/getRedPackList")
|
||||
@UserPermission
|
||||
@NoRepeatSubmit
|
||||
@ApiOperation(value = "获取红包列表")
|
||||
public TableDataInfo getRedPackList(HttpServletRequest request, @RequestBody GetRedPackListRequest getRedPackListRequest) {
|
||||
PtLoginUser user = tokenService.getLoginUser(request);
|
||||
|
||||
@@ -57,7 +53,6 @@ public class ApiRedPackContoller extends BaseController {
|
||||
// @PostMapping("/getRedPack")
|
||||
@UserPermission
|
||||
@NoRepeatSubmit
|
||||
@ApiOperation(value = "领取红包")
|
||||
public AjaxResult getRedPack(@RequestBody GetRedPackRequest request) {
|
||||
Long userId = getUserId();
|
||||
return redPackService.getRedPack(userId, request.getRedPackId());
|
||||
@@ -67,7 +62,6 @@ public class ApiRedPackContoller extends BaseController {
|
||||
// @PostMapping("/getRedPackByKey")
|
||||
@UserPermission
|
||||
@NoRepeatSubmit
|
||||
@ApiOperation(value = "根据红包口令兑换红包")
|
||||
public AjaxResult getRedPackByKey(@RequestBody GetRedPackByKeyRequest request) {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if (request.getRedPackKey() == null || "".equals(request.getRedPackKey())) {
|
||||
@@ -80,7 +74,6 @@ public class ApiRedPackContoller extends BaseController {
|
||||
// @PostMapping("/getActivityDataHis")
|
||||
@UserPermission
|
||||
@NoRepeatSubmit
|
||||
@ApiOperation(value = "查询参与的红包活动记录")
|
||||
public TableDataInfo getBoxDataHis(HttpServletRequest request) {
|
||||
PtLoginUser user = tokenService.getLoginUser(request);
|
||||
startPage();
|
||||
@@ -93,7 +86,6 @@ public class ApiRedPackContoller extends BaseController {
|
||||
// @PostMapping("/getRedPackDataDetail")
|
||||
@UserPermission
|
||||
@NoRepeatSubmit
|
||||
@ApiOperation(value = "查询历史记录")
|
||||
public AjaxResult getRedPackDataDetail(HttpServletRequest request, @RequestBody GetRedPackDetailRequest getRedPackDetailRequest) {
|
||||
PtLoginUser user = tokenService.getLoginUser(request);
|
||||
return redPackService.getRedPackDataDetail(user, getRedPackDetailRequest.getRecordId());
|
||||
|
||||
+1
-5
@@ -7,8 +7,6 @@ import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.playingmethod.model.body.SynthesizeRequest;
|
||||
import com.ruoyi.playingmethod.service.IApiReplacementRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -26,15 +24,13 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/replacementRecord")
|
||||
@Api(tags = "汰换记录")
|
||||
public class ApiReplacementRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IApiReplacementRecordService ttReplacementRecordService;
|
||||
|
||||
@PostMapping("/synthesizeItems")
|
||||
// [停用-前端零调用] @PostMapping("/synthesizeItems")
|
||||
@UserPermission
|
||||
@ApiOperation("汰换饰品")
|
||||
public AjaxResult synthesizeItems(@RequestBody SynthesizeRequest synthesizeRequest) {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
return ttReplacementRecordService.synthesizeItems(loginUser, synthesizeRequest.getBoIds());
|
||||
|
||||
+2
-14
@@ -24,9 +24,6 @@ import com.ruoyi.playingmethod.service.ApiRollService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.domain.vo.RollDetailsDataVO;
|
||||
import com.ruoyi.domain.vo.RollListDataVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -42,7 +39,6 @@ import jakarta.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "ROLL房模式")
|
||||
@RestController
|
||||
@RequestMapping("/api/roll")
|
||||
public class ApiRollController extends BaseController {
|
||||
@@ -69,7 +65,6 @@ public class ApiRollController extends BaseController {
|
||||
private String rollPassword;
|
||||
}
|
||||
|
||||
@ApiOperation("加入 ROLL 房")
|
||||
@RepeatSubmit(message = "操作过于频繁,请稍后重试!")
|
||||
@PostMapping("/joinRoll")
|
||||
public R joinRoll(@RequestBody @Validated JoinRollParam param) {
|
||||
@@ -91,7 +86,6 @@ public class ApiRollController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取ROLL房列表")
|
||||
@Anonymous
|
||||
@PostMapping("/getRollList")
|
||||
public TableDataInfo getRollList(@RequestBody GetRollListParamRequest param) {
|
||||
@@ -119,33 +113,28 @@ public class ApiRollController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取ROLL房详情")
|
||||
@PostMapping("/getRollDetails")
|
||||
public R<RollDetailsDataVO> getRollDetails(@RequestBody RollIdRequest request) {
|
||||
Long userId = getUserId();
|
||||
return apiRollService.getRollDetails(request.getRollId(), userId);
|
||||
}
|
||||
|
||||
@ApiOperation("获取ROLL房参与人员详情")
|
||||
@PostMapping("/getRollPlayers")
|
||||
public R<List<RollUserVO>> getRollPlayers(@RequestBody @Validated GetRollPlayersParam param) {
|
||||
return apiRollService.getRollPlayers(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取ROLL房奖池详情")
|
||||
@PostMapping("/getRollPrizePool")
|
||||
public R<List<RollJackpotOrnamentsVO>> getRollPrizePool(@RequestBody @Validated GetRollPrizePool param) {
|
||||
return apiRollService.getRollPrizePool(param);
|
||||
}
|
||||
|
||||
@ApiOperation("获取ROLL开奖详情")
|
||||
@PostMapping("/getRollOpenPrize")
|
||||
public R<List<TtBoxRecordsVO>> getRollOpenPrize(@RequestBody @Validated GetRollOpenPrizeParam param) {
|
||||
return apiRollService.getRollOpenPrize(param);
|
||||
}
|
||||
|
||||
@ApiOperation("开奖测试,正式环境删除")
|
||||
@PostMapping("/endRoll")
|
||||
// [停用-前端零调用] @PostMapping("/endRoll")
|
||||
public R endRoll(@RequestBody RollIdRequest request){
|
||||
// TODO: 移除或添加管理员权限校验
|
||||
return apiRollService.endROLL(request.getRollId());
|
||||
@@ -176,8 +165,7 @@ public class ApiRollController extends BaseController {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@ApiOperation("roll房间号搜索")
|
||||
@PostMapping("/searchRollId")
|
||||
// [停用-前端零调用] @PostMapping("/searchRollId")
|
||||
public TableDataInfo searchRoll(@RequestBody RollIdRequest request){
|
||||
GetRollListParamRequest param = new GetRollListParamRequest();
|
||||
param.setRollId(request.getRollId());
|
||||
|
||||
-2
@@ -4,7 +4,6 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.playingmethod.entity.TtAttendanceRecord;
|
||||
import com.ruoyi.playingmethod.service.IApiAttendanceRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -12,7 +11,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "签到记录")
|
||||
@RestController
|
||||
@RequestMapping("/api/attendanceRecord")
|
||||
public class ApiTtAttendanceRecordController extends BaseController {
|
||||
|
||||
+1
-6
@@ -5,14 +5,11 @@ import com.ruoyi.admin.service.TtUserAvatarService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.domain.other.TtUserAvatar;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "用户头像")
|
||||
@RestController
|
||||
@RequestMapping("/api/userAvatar")
|
||||
public class ApiUserAvatarController extends BaseController {
|
||||
@@ -23,8 +20,7 @@ public class ApiUserAvatarController extends BaseController {
|
||||
this.userAvatarService = userAvatarService;
|
||||
}
|
||||
|
||||
@ApiOperation("用户头像列表")
|
||||
@PostMapping("/list")
|
||||
// [停用-前端零调用] @PostMapping("/list")
|
||||
public R<List<TtUserAvatar>> list() {
|
||||
LambdaQueryWrapper<TtUserAvatar> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TtUserAvatar::getStatus, "0")
|
||||
@@ -33,7 +29,6 @@ public class ApiUserAvatarController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取头像图片资源路径列表")
|
||||
@PostMapping("/images")
|
||||
public R<List<String>> getAvatarImages() {
|
||||
LambdaQueryWrapper<TtUserAvatar> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
+4
-14
@@ -15,16 +15,12 @@ import com.ruoyi.playingmethod.contract.api.request.OpenWelfareBoxRequest;
|
||||
import com.ruoyi.playingmethod.model.ApiWelfare;
|
||||
import com.ruoyi.playingmethod.service.ApiWelfareService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Api(tags = "福利")
|
||||
@RestController
|
||||
@RequestMapping("/api/welfare")
|
||||
public class ApiWelfareController extends BaseController {
|
||||
@@ -41,10 +37,7 @@ public class ApiWelfareController extends BaseController {
|
||||
@Autowired
|
||||
private TtUserService userService;
|
||||
|
||||
@ApiOperation("获取福利列表")
|
||||
@ApiResponse(code = 200, message = "eligible【是否具备领取条件(0否 1是)】" +
|
||||
"<br>claimStatus【领取状态(0未领取 1已领取)】")
|
||||
@PostMapping("/getWelfareList")
|
||||
// [停用-前端零调用] @PostMapping("/getWelfareList")
|
||||
public TableDataInfo getWelfareList() {
|
||||
startPage();
|
||||
Long userId = getUserId();
|
||||
@@ -52,8 +45,7 @@ public class ApiWelfareController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("领取福利")
|
||||
@PostMapping("/claimWelfare")
|
||||
// [停用-前端零调用] @PostMapping("/claimWelfare")
|
||||
public AjaxResult claimWelfare(@RequestBody ClaimWelfareRequest request) {
|
||||
Long userId = getUserId();
|
||||
// 检查福利是否存在
|
||||
@@ -82,8 +74,7 @@ public class ApiWelfareController extends BaseController {
|
||||
return AjaxResult.success(openBoxVO);
|
||||
}
|
||||
|
||||
@ApiOperation("每日领取福利箱子")
|
||||
@PostMapping("/claimDailyBox")
|
||||
// [停用-前端零调用] @PostMapping("/claimDailyBox")
|
||||
public R<?> claimDailyBox() {
|
||||
Long userId = getUserId();
|
||||
try {
|
||||
@@ -94,8 +85,7 @@ public class ApiWelfareController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("批量开启福利箱子(1-15个)")
|
||||
@PostMapping("/openBoxes")
|
||||
// [停用-前端零调用] @PostMapping("/openBoxes")
|
||||
public R<?> openBoxes(@RequestBody @Validated OpenWelfareBoxRequest request) {
|
||||
Long userId = getUserId();
|
||||
String bindBoxMaintenance = sysConfigService.selectConfigByKey("bindBoxMaintenance");
|
||||
|
||||
+2
-10
@@ -14,16 +14,12 @@ import com.ruoyi.playingmethod.model.ApiWelfare;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiWelfareMonthlyRechargesVO;
|
||||
import com.ruoyi.playingmethod.service.ApiWelfareMonthlyRechargesService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Api(tags = "每月充值福利")
|
||||
@RestController
|
||||
@RequestMapping("/api/welfare/monthlyRecharges")
|
||||
public class ApiWelfareMonthlyRechargesController extends BaseController {
|
||||
@@ -40,10 +36,7 @@ public class ApiWelfareMonthlyRechargesController extends BaseController {
|
||||
@Autowired
|
||||
private TtUserService userService;
|
||||
|
||||
@ApiOperation("获取每月充值福利列表")
|
||||
@ApiResponse(code = 200, message = "eligible【是否具备领取条件(0否 1是)】" +
|
||||
"<br>claimStatus【领取状态(0未领取 1已领取)】")
|
||||
@PostMapping("/list")
|
||||
// [停用-前端零调用] @PostMapping("/list")
|
||||
public TableDataInfo getWelfareList() {
|
||||
startPage();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
@@ -51,8 +44,7 @@ public class ApiWelfareMonthlyRechargesController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("领取福利")
|
||||
@PostMapping("/claimWelfare")
|
||||
// [停用-前端零调用] @PostMapping("/claimWelfare")
|
||||
public AjaxResult claimWelfare(@RequestBody ClaimWelfareRequest request) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
// 检查福利是否存在
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package com.ruoyi.playingmethod.model;
|
||||
|
||||
import com.ruoyi.domain.other.TtBox;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.playingmethod.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 对战卡片数据:天选战场/历史百佳(tenTopFight)与全服历史/我的对局(fightOnAll/fightOnMyOwn)共用。
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApiFightCardVo {
|
||||
|
||||
private ApiFightInfo fight;
|
||||
|
||||
/**
|
||||
* 赢家所得(卡片“结算”金额)
|
||||
*/
|
||||
private BigDecimal winnerTotalPrice;
|
||||
|
||||
/**
|
||||
* 开箱饰品总金额(点卡片进观战/回顾时房间页展示)
|
||||
*/
|
||||
private BigDecimal totalOrnamentsPrice;
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.ruoyi.playingmethod.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 客户端对战信息(卡片与对战结果接口共用),只含客户端读取的字段,null 字段不下发。
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApiFightInfo {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
// 1、欧皇 2、非酋(卡片皮肤)
|
||||
private String model;
|
||||
|
||||
// 0或null=个人对战(1v1、1v1v1) 1=2v2组队;2v2 时座位 code 0/1 为A队、2/3 为B队
|
||||
private Integer teamMode;
|
||||
|
||||
// 2=1v1 3=1v1v1 4=2v2,决定卡片槽位数与房间页滚轮列数
|
||||
private Integer playerNum;
|
||||
|
||||
private Integer roundNumber;
|
||||
|
||||
// 卡片赢家角标用;对战结果接口的赢家ID走外层 winnerIds,这里不下发
|
||||
private List<Integer> winnerIds;
|
||||
|
||||
// 2结束 3超时强制结束
|
||||
private Integer status;
|
||||
|
||||
// 仅对战开始过的房间有值(房间页实时进度用)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Timestamp beginTime;
|
||||
|
||||
private List<Seat> seats;
|
||||
|
||||
private Map<String, Box> boxData;
|
||||
|
||||
/**
|
||||
* 入场金额(宝箱总价)
|
||||
*/
|
||||
private BigDecimal boxPriceTotal;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class Seat {
|
||||
|
||||
// 座位号:1v1 为 0/1,1v1v1 为 0/1/2,2v2 按 0/1、2/3 分队;卡片槽位与房间页均以此定位
|
||||
private Integer code;
|
||||
|
||||
// 是否入座只判 playerId(空位占位 seat 的 playerId 为空),与 seat.status 无关
|
||||
private Integer playerId;
|
||||
|
||||
private String avatar;
|
||||
|
||||
private String nickName;
|
||||
|
||||
private Integer vipLevel;
|
||||
|
||||
// 该玩家本场所得(房间页席位金额)
|
||||
private BigDecimal awardTotalPrices;
|
||||
}
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class Box {
|
||||
|
||||
private Integer boxId;
|
||||
|
||||
private Integer number;
|
||||
|
||||
private String boxImg01;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private String boxName;
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.ruoyi.playingmethod.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 开箱记录(回合掉落 / 赢家所得 / 安慰奖共用),只含客户端展示读取的字段:
|
||||
* 饰品图、名称、磨损、品质、价格、持有者与所属回合。
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApiFightRecordVo {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
private Integer boxId;
|
||||
|
||||
// 价格兜底按 ornamentId 从宝箱饰品池反查
|
||||
private Long ornamentId;
|
||||
|
||||
private String ornamentName;
|
||||
|
||||
private BigDecimal ornamentsPrice;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private Integer ornamentsLevelId;
|
||||
|
||||
private String ornamentLevelImg;
|
||||
|
||||
private String exteriorName;
|
||||
|
||||
// 该饰品归谁(结算/席位金额按持有者归属)
|
||||
private Integer holderUserId;
|
||||
|
||||
// 所属回合(0或负=赛后安慰奖/平分奖)
|
||||
private Integer fightRoundNumber;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.ruoyi.playingmethod.model.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对战结果(观战/回顾/结算):客户端用 fight 拿对战基础信息、三个记录列表渲染逐轮掉落与结算,
|
||||
* 另有 totalOrnamentsPrice 与宝箱清单。currentRound/loserTotalPrice/winnerTotalPrice 客户端不读,不下发。
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ApiFightResultVo {
|
||||
|
||||
private ApiFightInfo fight;
|
||||
|
||||
private List<Integer> winnerIds;
|
||||
|
||||
// 各回合开箱记录(fightRoundNumber > 0)
|
||||
private List<ApiFightRecordVo> fightResult;
|
||||
|
||||
// 赢家所得(含平分奖)
|
||||
private List<ApiFightRecordVo> winnerPrize;
|
||||
|
||||
// 失败方安慰奖(fightRoundNumber <= 0 且持有人非赢家)
|
||||
private List<ApiFightRecordVo> endGamePrize;
|
||||
|
||||
/**
|
||||
* 开箱饰品总金额
|
||||
*/
|
||||
private BigDecimal totalOrnamentsPrice;
|
||||
|
||||
// 宝箱清单:客户端读 boxId/number/boxImg01/price/boxName
|
||||
private List<ApiFightInfo.Box> fightBoxVOList;
|
||||
}
|
||||
+9
-3
@@ -10,9 +10,10 @@ import com.ruoyi.domain.entity.fight.TtFight;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.vo.ApiFightListDataVO;
|
||||
import com.ruoyi.domain.vo.FightResultDataVO;
|
||||
import com.ruoyi.domain.vo.fight.FightResultVO;
|
||||
import com.ruoyi.domain.vo.fight.TtFightVO;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightCardVo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightRankingVO;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightResultVo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -46,7 +47,7 @@ public interface ApiFightService extends IService<TtFight> {
|
||||
|
||||
R fightRoomExit(Integer fightId, TtUser player);
|
||||
|
||||
List<ApiFightListDataVO> getFightList(FightOnMyOwnParam param);
|
||||
List<ApiFightCardVo> getFightList(FightOnMyOwnParam param);
|
||||
|
||||
R fightDetail(FightDetailParam param);
|
||||
|
||||
@@ -56,7 +57,12 @@ public interface ApiFightService extends IService<TtFight> {
|
||||
|
||||
List<ApiFightRankingVO> getFightRankingByDate(String date);
|
||||
|
||||
Map<String, List<FightResultVO>> tenTopFight(Integer maxType, String model, Integer minPrice, Integer maxPrice, String keyword);
|
||||
Map<String, List<ApiFightCardVo>> tenTopFight(Integer maxType, String model, Integer minPrice, Integer maxPrice, String keyword);
|
||||
|
||||
/**
|
||||
* 对战结果(观战/回顾/结算):只下发客户端读取的字段,完整明细见 TtFightResultService#getFightResult
|
||||
*/
|
||||
ApiFightResultVo getFightResultForClient(Integer fightId);
|
||||
|
||||
/**
|
||||
* 批量填充房主昵称(供 controller 中直接操作 TtFight 列表的场景使用)
|
||||
|
||||
+166
-67
@@ -69,7 +69,11 @@ import com.ruoyi.framework.websocket.connector.WsResult;
|
||||
import com.ruoyi.playingmethod.mapper.ApiBindBoxMapper;
|
||||
import com.ruoyi.playingmethod.mapper.ApiFightMapper;
|
||||
import com.ruoyi.playingmethod.mapper.ApiTtUserBlendErcashMapper;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightCardVo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightInfo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightRankingVO;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightRecordVo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightResultVo;
|
||||
import com.ruoyi.playingmethod.model.vo.ApiFightTenTopVo;
|
||||
import com.ruoyi.playingmethod.service.ApiBindBoxService;
|
||||
import com.ruoyi.playingmethod.service.ApiFightService;
|
||||
@@ -1410,7 +1414,7 @@ public class ApiFightServiceImpl extends ServiceImpl<TtFightMapper, TtFight> imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ApiFightListDataVO> getFightList(FightOnMyOwnParam param) {
|
||||
public List<ApiFightCardVo> getFightList(FightOnMyOwnParam param) {
|
||||
|
||||
LambdaQueryWrapper<TtFight> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper
|
||||
@@ -1507,85 +1511,59 @@ public class ApiFightServiceImpl extends ServiceImpl<TtFightMapper, TtFight> imp
|
||||
}
|
||||
}
|
||||
|
||||
var result = page.stream().map(fight -> {
|
||||
ApiFightListDataVO build = ApiFightListDataVO.builder().build();
|
||||
BeanUtil.copyProperties(fight, build);
|
||||
build.setBoxData(JSONUtil.toJsonStr(fight.getBoxData()));
|
||||
build.setSeats(fight.getSeats());
|
||||
build.setRoundNumber(fight.getRoundNumber());
|
||||
// 设置 winnerIdList 以便 getWinnerIds() getter 正确返回
|
||||
if (fight.getWinnerIds() != null && !fight.getWinnerIds().isEmpty()) {
|
||||
build.setWinnerIdList(JSONUtil.toJsonStr(fight.getWinnerIds()));
|
||||
}
|
||||
return build;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
List<Integer> fightIds = result.stream().filter(Objects::nonNull).map(ApiFightListDataVO::getId).collect(Collectors.toList());
|
||||
List<ApiFightTenTopVo> voList = apiFightMapper.fightOrnamentsPrice(fightIds);
|
||||
Map<Integer, BigDecimal> fightIdToPrice = voList.stream()
|
||||
List<Integer> fightIds = page.stream().filter(Objects::nonNull).map(TtFight::getId).collect(Collectors.toList());
|
||||
Map<Integer, BigDecimal> fightIdToPrice = apiFightMapper.fightOrnamentsPrice(fightIds).stream()
|
||||
.filter(Objects::nonNull) // 过滤掉空值
|
||||
.collect(Collectors.toMap(
|
||||
ApiFightTenTopVo::getId,
|
||||
ApiFightTenTopVo::getTotalOrnamentsPrice
|
||||
));
|
||||
for (ApiFightListDataVO vo : result) {
|
||||
vo.setTotalOrnamentsPrice(fightIdToPrice.getOrDefault(vo.getId(), BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
// 批量填充每个玩家开出的饰品总和(seats[].awardTotalPrices)
|
||||
List<ApiFightTenTopVo> holderPriceList = apiFightMapper.holderOrnamentsPrice(fightIds);
|
||||
// 构建 fightId:holderUserId -> totalOrnamentsPrice 映射
|
||||
// 构建 fightId:holderUserId -> 该玩家开出的饰品总额(seats[].awardTotalPrices)
|
||||
Map<String, BigDecimal> holderPriceMap = new HashMap<>();
|
||||
for (ApiFightTenTopVo hp : holderPriceList) {
|
||||
for (ApiFightTenTopVo hp : apiFightMapper.holderOrnamentsPrice(fightIds)) {
|
||||
if (hp != null && hp.getId() != null && hp.getUserId() != null) {
|
||||
holderPriceMap.put(hp.getId() + ":" + hp.getUserId(), hp.getTotalOrnamentsPrice());
|
||||
}
|
||||
}
|
||||
for (ApiFightListDataVO vo : result) {
|
||||
if (vo.getSeats() == null) continue;
|
||||
List<Integer> winIds = vo.getWinnerIds() != null ? vo.getWinnerIds() : Collections.emptyList();
|
||||
BigDecimal winTotal = BigDecimal.ZERO;
|
||||
BigDecimal loseTotal = BigDecimal.ZERO;
|
||||
for (FightSeat seat : vo.getSeats()) {
|
||||
if (seat.getPlayerId() != null) {
|
||||
BigDecimal playerPrice = holderPriceMap.getOrDefault(vo.getId() + ":" + seat.getPlayerId(), BigDecimal.ZERO);
|
||||
seat.setAwardTotalPrices(playerPrice);
|
||||
if (winIds.contains(seat.getPlayerId())) {
|
||||
winTotal = winTotal.add(playerPrice);
|
||||
} else {
|
||||
loseTotal = loseTotal.add(playerPrice);
|
||||
}
|
||||
}
|
||||
}
|
||||
vo.setWinnerTotalPrice(winTotal);
|
||||
vo.setLoserTotalPrice(loseTotal);
|
||||
}
|
||||
|
||||
enrichOwnerNickNamesForVO(result);
|
||||
|
||||
// 批量填充 seats 中的 vipLevel
|
||||
List<Integer> allPlayerIds = result.stream()
|
||||
.filter(v -> v.getSeats() != null)
|
||||
.flatMap(v -> v.getSeats().stream())
|
||||
List<Integer> allPlayerIds = page.stream()
|
||||
.filter(f -> f.getSeats() != null)
|
||||
.flatMap(f -> f.getSeats().stream())
|
||||
.map(FightSeat::getPlayerId)
|
||||
.filter(Objects::nonNull)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
Map<Integer, Integer> vipMap = new HashMap<>();
|
||||
if (!allPlayerIds.isEmpty()) {
|
||||
List<TtUser> users = new LambdaQueryChainWrapper<>(ttUserMapper)
|
||||
.in(TtUser::getUserId, allPlayerIds)
|
||||
.select(TtUser::getUserId, TtUser::getVipLevel)
|
||||
.list();
|
||||
Map<Integer, Integer> vipMap = users.stream().filter(Objects::nonNull)
|
||||
vipMap = users.stream().filter(Objects::nonNull)
|
||||
.collect(Collectors.toMap(TtUser::getUserId, u -> u.getVipLevel() != null && u.getVipLevel() > 0 ? u.getVipLevel() - 1 : 0, (a, b) -> a));
|
||||
for (ApiFightListDataVO vo : result) {
|
||||
if (vo.getSeats() == null) continue;
|
||||
for (FightSeat seat : vo.getSeats()) {
|
||||
if (seat.getPlayerId() != null) {
|
||||
}
|
||||
|
||||
List<ApiFightCardVo> result = new ArrayList<>(page.size());
|
||||
for (TtFight fight : page) {
|
||||
if (fight == null) continue;
|
||||
List<Integer> winnerIds = fight.getWinnerIds() != null ? fight.getWinnerIds() : Collections.emptyList();
|
||||
BigDecimal winnerTotalPrice = BigDecimal.ZERO;
|
||||
if (fight.getSeats() != null) {
|
||||
for (FightSeat seat : fight.getSeats()) {
|
||||
if (seat.getPlayerId() == null) continue;
|
||||
BigDecimal playerPrice = holderPriceMap.getOrDefault(fight.getId() + ":" + seat.getPlayerId(), BigDecimal.ZERO);
|
||||
seat.setAwardTotalPrices(playerPrice);
|
||||
if (!vipMap.isEmpty()) {
|
||||
seat.setVipLevel(vipMap.getOrDefault(seat.getPlayerId(), 0));
|
||||
}
|
||||
if (winnerIds.contains(seat.getPlayerId())) {
|
||||
winnerTotalPrice = winnerTotalPrice.add(playerPrice);
|
||||
}
|
||||
}
|
||||
}
|
||||
result.add(buildCard(fight, winnerIds, fightIdToPrice.getOrDefault(fight.getId(), BigDecimal.ZERO), winnerTotalPrice));
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -2282,7 +2260,7 @@ public class ApiFightServiceImpl extends ServiceImpl<TtFightMapper, TtFight> imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<FightResultVO>> tenTopFight(Integer maxType, String model, Integer minPrice, Integer maxPrice, String keyword) {
|
||||
public Map<String, List<ApiFightCardVo>> tenTopFight(Integer maxType, String model, Integer minPrice, Integer maxPrice, String keyword) {
|
||||
if (maxType == null || maxType < 0 || maxType > 3) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
@@ -2316,7 +2294,7 @@ public class ApiFightServiceImpl extends ServiceImpl<TtFightMapper, TtFight> imp
|
||||
// 获取昨天凌晨时间
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -2); // 从今天凌晨减去2天
|
||||
|
||||
List<FightResultVO> todayFightResult = new ArrayList<>();
|
||||
List<ApiFightCardVo> todayFightResult = new ArrayList<>();
|
||||
|
||||
// 超神模式(maxType=0)不传日期,查全历史
|
||||
String startDate = (maxType == 0) ? null : formattedTodayMidnight;
|
||||
@@ -2337,26 +2315,147 @@ public class ApiFightServiceImpl extends ServiceImpl<TtFightMapper, TtFight> imp
|
||||
ApiFightTenTopVo::getTotalOrnamentsPrice, (a, b) -> a));
|
||||
List<FightResultVO> batchResults = ttFightResultService.getFightResultBatch(fightIds);
|
||||
for (FightResultVO vo : batchResults) {
|
||||
if (vo != null && vo.getFight() != null) {
|
||||
vo.setTotalOrnamentsPrice(priceMap.getOrDefault(vo.getFight().getId(), vo.getTotalOrnamentsPrice()));
|
||||
todayFightResult.add(vo);
|
||||
}
|
||||
if (vo == null || vo.getFight() == null) continue;
|
||||
TtFight fight = vo.getFight();
|
||||
// 榜单金额以 SQL 统计值为准,与排序口径一致
|
||||
BigDecimal totalOrnamentsPrice = priceMap.getOrDefault(fight.getId(), vo.getTotalOrnamentsPrice());
|
||||
todayFightResult.add(buildCard(fight, vo.getWinnerIds(), totalOrnamentsPrice, vo.getWinnerTotalPrice()));
|
||||
}
|
||||
}
|
||||
log.info("today for time is {}", System.currentTimeMillis() - beginTime);
|
||||
|
||||
// 填充房主昵称
|
||||
List<TtFight> fightList = todayFightResult.stream()
|
||||
.map(FightResultVO::getFight)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
enrichOwnerNickNames(fightList);
|
||||
|
||||
Map<String, List<FightResultVO>> map = new HashMap<>();
|
||||
Map<String, List<ApiFightCardVo>> map = new HashMap<>();
|
||||
map.put("todayFightResult", todayFightResult);
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiFightResultVo getFightResultForClient(Integer fightId) {
|
||||
FightResultVO source = ttFightResultService.getFightResult(fightId);
|
||||
if (source == null || source.getFight() == null) return null;
|
||||
return buildFightResult(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡片只下发客户端读取的字段:fight{id/userId/model/teamMode/playerNum/roundNumber/winnerIds/status/
|
||||
* beginTime/seats/boxData/boxPriceTotal} + winnerTotalPrice(结算)/totalOrnamentsPrice。
|
||||
* createTime/endTime/updateTime/remark/spectatorNum/ownerNickName、座位 fightId/status、
|
||||
* 宝箱 boxImg02/ornaments 与开箱明细客户端均不读,不下发。
|
||||
*
|
||||
* @param winnerIds 赢家ID,百佳传 FightResultVO 的值(DB 为空时已从 Redis 状态快照兜底)
|
||||
*/
|
||||
private ApiFightCardVo buildCard(TtFight fight, List<Integer> winnerIds, BigDecimal totalOrnamentsPrice, BigDecimal winnerTotalPrice) {
|
||||
ApiFightCardVo card = new ApiFightCardVo();
|
||||
card.setFight(buildFightInfo(fight, winnerIds));
|
||||
card.setWinnerTotalPrice(winnerTotalPrice);
|
||||
card.setTotalOrnamentsPrice(totalOrnamentsPrice);
|
||||
return card;
|
||||
}
|
||||
|
||||
private ApiFightInfo buildFightInfo(TtFight fight, List<Integer> winnerIds) {
|
||||
ApiFightInfo info = new ApiFightInfo();
|
||||
info.setId(fight.getId());
|
||||
info.setUserId(fight.getUserId());
|
||||
info.setModel(fight.getModel());
|
||||
info.setTeamMode(fight.getTeamMode());
|
||||
info.setPlayerNum(fight.getPlayerNum());
|
||||
info.setRoundNumber(fight.getRoundNumber());
|
||||
info.setWinnerIds(winnerIds);
|
||||
info.setStatus(fight.getStatus());
|
||||
info.setBeginTime(fight.getBeginTime());
|
||||
info.setBoxPriceTotal(fight.getBoxPriceTotal());
|
||||
info.setSeats(toSeats(fight.getSeats()));
|
||||
info.setBoxData(toBoxMap(fight.getBoxData()));
|
||||
return info;
|
||||
}
|
||||
|
||||
private List<ApiFightInfo.Seat> toSeats(List<FightSeat> seats) {
|
||||
if (CollectionUtils.isEmpty(seats)) return Collections.emptyList();
|
||||
List<ApiFightInfo.Seat> list = new ArrayList<>(seats.size());
|
||||
for (FightSeat seat : seats) {
|
||||
if (seat == null) continue;
|
||||
ApiFightInfo.Seat vo = new ApiFightInfo.Seat();
|
||||
vo.setCode(seat.getCode());
|
||||
vo.setPlayerId(seat.getPlayerId());
|
||||
vo.setAvatar(seat.getAvatar());
|
||||
vo.setNickName(seat.getNickName());
|
||||
vo.setVipLevel(seat.getVipLevel());
|
||||
vo.setAwardTotalPrices(seat.getAwardTotalPrices());
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private Map<String, ApiFightInfo.Box> toBoxMap(Map<String, FightBoxVO> boxData) {
|
||||
if (MapUtils.isEmpty(boxData)) return Collections.emptyMap();
|
||||
// 保持库中顺序,客户端按 boxData 顺序渲染宝箱行
|
||||
Map<String, ApiFightInfo.Box> map = new LinkedHashMap<>(boxData.size());
|
||||
for (Map.Entry<String, FightBoxVO> entry : boxData.entrySet()) {
|
||||
ApiFightInfo.Box vo = toBox(entry.getValue());
|
||||
if (vo != null) map.put(entry.getKey(), vo);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private ApiFightInfo.Box toBox(FightBoxVO source) {
|
||||
FightBoxVO box = resolveFightBoxVO(source);
|
||||
if (box == null) return null;
|
||||
ApiFightInfo.Box vo = new ApiFightInfo.Box();
|
||||
vo.setBoxId(box.getBoxId());
|
||||
vo.setNumber(box.getNumber());
|
||||
vo.setBoxImg01(box.getBoxImg01());
|
||||
vo.setPrice(box.getPrice());
|
||||
vo.setBoxName(box.getBoxName());
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对战结果只下发客户端读取的内容:fight 基础信息 + winnerIds + 三个记录列表 + totalOrnamentsPrice + 宝箱清单。
|
||||
* 记录里的 boxName/boxPrice/periodNo/marketHashName/status/source/fightId/rollId/isShow/时间等客户端不读;
|
||||
* 外层 currentRound/loserTotalPrice/winnerTotalPrice 也不读(结算金额由客户端按 winnerPrize 汇总)。
|
||||
*/
|
||||
private ApiFightResultVo buildFightResult(FightResultVO source) {
|
||||
ApiFightResultVo vo = new ApiFightResultVo();
|
||||
vo.setFight(buildFightInfo(source.getFight(), null));
|
||||
vo.setWinnerIds(source.getWinnerIds());
|
||||
vo.setFightResult(toRecords(source.getFightResult()));
|
||||
vo.setWinnerPrize(toRecords(source.getWinnerPrize()));
|
||||
vo.setEndGamePrize(toRecords(source.getEndGamePrize()));
|
||||
vo.setTotalOrnamentsPrice(source.getTotalOrnamentsPrice());
|
||||
List<ApiFightInfo.Box> boxList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(source.getFightBoxVOList())) {
|
||||
for (FightBoxVO box : source.getFightBoxVOList()) {
|
||||
ApiFightInfo.Box item = toBox(box);
|
||||
if (item != null) boxList.add(item);
|
||||
}
|
||||
}
|
||||
vo.setFightBoxVOList(boxList);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private List<ApiFightRecordVo> toRecords(List<TtBoxRecords> records) {
|
||||
if (CollectionUtils.isEmpty(records)) return Collections.emptyList();
|
||||
List<ApiFightRecordVo> list = new ArrayList<>(records.size());
|
||||
for (TtBoxRecords record : records) {
|
||||
if (record == null) continue;
|
||||
ApiFightRecordVo vo = new ApiFightRecordVo();
|
||||
vo.setId(record.getId());
|
||||
vo.setUserId(record.getUserId());
|
||||
vo.setBoxId(record.getBoxId());
|
||||
vo.setOrnamentId(record.getOrnamentId());
|
||||
vo.setOrnamentName(record.getOrnamentName());
|
||||
vo.setOrnamentsPrice(record.getOrnamentsPrice());
|
||||
vo.setImageUrl(record.getImageUrl());
|
||||
vo.setOrnamentsLevelId(record.getOrnamentsLevelId());
|
||||
vo.setOrnamentLevelImg(record.getOrnamentLevelImg());
|
||||
vo.setExteriorName(record.getExteriorName());
|
||||
vo.setHolderUserId(record.getHolderUserId());
|
||||
vo.setFightRoundNumber(record.getFightRoundNumber());
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void enrichBoxPrices(List<TtFight> fights) {
|
||||
List<Integer> boxIds = new ArrayList<>();
|
||||
for (TtFight fight : fights) {
|
||||
|
||||
-4
@@ -8,15 +8,12 @@ import com.ruoyi.task.contract.request.GetAwardRequest;
|
||||
import com.ruoyi.task.contract.request.TaskTestRequest;
|
||||
import com.ruoyi.task.scheduled.TaskUpdate;
|
||||
import com.ruoyi.task.service.TtTaskService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "任务模块")
|
||||
@RestController
|
||||
@RequestMapping("/api/ttTask")
|
||||
public class TtTaskController extends BaseController {
|
||||
@@ -27,7 +24,6 @@ public class TtTaskController extends BaseController {
|
||||
@Autowired
|
||||
private TaskUpdate taskUpdate;
|
||||
|
||||
@ApiOperation("关于我的任务")
|
||||
@PostMapping("/taskOfme")
|
||||
@Anonymous
|
||||
// public List<TtTaskDoing> taskOfme(@PathVariable("page") Integer page,@PathVariable("size") Integer size) {
|
||||
|
||||
-5
@@ -12,8 +12,6 @@ import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.MaYi.config.MYConfig;
|
||||
import com.ruoyi.thirdparty.MaYi.service.MYService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -28,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "聚合支付")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/mayi")
|
||||
@@ -41,7 +38,6 @@ public class MYController extends BaseController {
|
||||
private TtUserService userService;
|
||||
|
||||
// 下单
|
||||
@ApiOperation("预下单")
|
||||
@PostMapping("/ApiAddTrans")
|
||||
@UpdateUserCache
|
||||
public R ApiAddTrans(HttpServletRequest request, @RequestBody @Validated CreateOrderParam param) {
|
||||
@@ -58,7 +54,6 @@ public class MYController extends BaseController {
|
||||
}
|
||||
|
||||
// 支付回调
|
||||
@ApiOperation("支付回调")
|
||||
// @PostMapping("/notify")
|
||||
public String addTransNotify(@RequestBody PayNotifyRequest data) {
|
||||
log.info("聚合支付支付回调 {}", JSONUtil.toJsonStr(data));
|
||||
|
||||
-7
@@ -12,8 +12,6 @@ import com.ruoyi.thirdparty.abkpay.service.AbkPayPaymentService;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.OrderStatusRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -36,7 +34,6 @@ import java.util.Map;
|
||||
* orderStatus —— 查询本地订单支付状态(供前端轮询)
|
||||
* queryPay —— 主动查询平台订单
|
||||
*/
|
||||
@Api(tags = "abkpay充值")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/abkpay")
|
||||
@@ -51,7 +48,6 @@ public class AbkPayController {
|
||||
/**
|
||||
* 创建充值订单(默认由统一充值路由调用,独立入口默认关闭)
|
||||
*/
|
||||
@ApiOperation("创建充值订单")
|
||||
@UserPermission
|
||||
@PostMapping("/pay")
|
||||
public R<PayResponse> pay(@RequestBody @Validated PayRequest param) {
|
||||
@@ -71,7 +67,6 @@ public class AbkPayController {
|
||||
* 平台订单成功或失败都会回调,商户须返回字符串 "SUCCESS"(大小写均可)。
|
||||
* 处理失败(验签失败/订单不存在等)返回非 SUCCESS,促使平台重推。
|
||||
*/
|
||||
@ApiOperation("充值回调通知")
|
||||
@Anonymous
|
||||
@PostMapping("/notify")
|
||||
@ResponseBody
|
||||
@@ -88,7 +83,6 @@ public class AbkPayController {
|
||||
/**
|
||||
* 查询本地订单支付状态(供前端轮询)
|
||||
*/
|
||||
@ApiOperation("查询本地订单支付状态")
|
||||
@UserPermission
|
||||
@PostMapping("/orderStatus")
|
||||
public R<Map<String, Object>> orderStatus(@RequestBody @Validated OrderStatusRequest param) {
|
||||
@@ -99,7 +93,6 @@ public class AbkPayController {
|
||||
/**
|
||||
* 主动查询平台订单(仅允许查询本人订单)
|
||||
*/
|
||||
@ApiOperation("查询充值订单")
|
||||
@UserPermission
|
||||
@GetMapping("/queryPay")
|
||||
public R<AbkPayResult> queryPay(@RequestParam String outTradeNo) {
|
||||
|
||||
-4
@@ -10,14 +10,11 @@ import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.alipay.service.AliPayService;
|
||||
import com.ruoyi.thirdparty.wechat.service.ApiTokenService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "支付宝")
|
||||
@RestController
|
||||
@RequestMapping("/api/alipay")
|
||||
public class AliPayController {
|
||||
@@ -34,7 +31,6 @@ public class AliPayController {
|
||||
this.ttUserService = ttUserService;
|
||||
}
|
||||
|
||||
@ApiOperation("支付")
|
||||
@UserPermission
|
||||
@PostMapping(value = "/trade/page/pay")
|
||||
public R pay(@RequestBody @Validated CreateOrderParam param) {
|
||||
|
||||
-4
@@ -8,8 +8,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.baiweipay.service.BaiweiPayService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "百威支付")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/baiweipay")
|
||||
@@ -29,7 +26,6 @@ public class BaiweiPayController {
|
||||
@Autowired
|
||||
private BaiweiPayService baiweiPayService;
|
||||
|
||||
@ApiOperation("支付")
|
||||
@UserPermission
|
||||
@PostMapping(value = "/pay")
|
||||
public R pay(@RequestBody @Validated CreateOrderParam param) {
|
||||
|
||||
-8
@@ -10,8 +10,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.thirdparty.chengduhipay.model.PaymentData;
|
||||
import com.ruoyi.thirdparty.chengduhipay.service.ChengduHipayPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -28,7 +26,6 @@ import java.util.Map;
|
||||
* GET /api/chengduhipay/queryPay —— 查询充值订单
|
||||
* GET /api/chengduhipay/balance —— 查询商户余额
|
||||
*/
|
||||
@Api(tags = "成都Hipay充值")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/chengduhipay")
|
||||
@@ -44,7 +41,6 @@ public class ChengduHipayController {
|
||||
* 创建充值订单
|
||||
* 对应API文档2.1节:POST /pay/pay/createpay
|
||||
*/
|
||||
@ApiOperation("创建充值订单")
|
||||
@UserPermission
|
||||
// @PostMapping("/pay")
|
||||
public R pay(@RequestBody @Validated PayRequest param) {
|
||||
@@ -63,7 +59,6 @@ public class ChengduHipayController {
|
||||
* 通用返回格式: {"code":1, "msg":"success", "data":"{...}"}
|
||||
* data字段为JSON字符串,需要反序列化
|
||||
*/
|
||||
@ApiOperation("充值回调通知")
|
||||
@Anonymous
|
||||
// @PostMapping("/notify")
|
||||
public String notify(@RequestBody Map<String, String> params) {
|
||||
@@ -77,7 +72,6 @@ public class ChengduHipayController {
|
||||
* 前端轮询逻辑建议:每 2~3 秒调一次,最多 60 秒,遇到 success=true 即弹出“充值成功”并刷新余额。
|
||||
* @param param 请求体,包含创建充值接口返回的本地订单号 orderId
|
||||
*/
|
||||
@ApiOperation("查询本地订单支付状态")
|
||||
@UserPermission
|
||||
@PostMapping("/orderStatus")
|
||||
public R<Map<String, Object>> orderStatus(@RequestBody @Validated OrderStatusRequest param) {
|
||||
@@ -90,7 +84,6 @@ public class ChengduHipayController {
|
||||
* 对应API文档2.3节:GET /pay/pay/getpay
|
||||
* @param Id Hipay平台返回的订单唯一编号
|
||||
*/
|
||||
@ApiOperation("查询充值订单")
|
||||
@GetMapping("/queryPay")
|
||||
public R<PaymentData> queryPay(@RequestParam String Id) {
|
||||
return chengduHipayPaymentService.getPay(Id);
|
||||
@@ -100,7 +93,6 @@ public class ChengduHipayController {
|
||||
* 查询商户余额
|
||||
* 对应API文档4节:GET /pay/pay/getbalance
|
||||
*/
|
||||
@ApiOperation("查询商户余额")
|
||||
@GetMapping("/balance")
|
||||
public R<String> balance() {
|
||||
return chengduHipayPaymentService.getBalance();
|
||||
|
||||
-4
@@ -2,8 +2,6 @@ package com.ruoyi.thirdparty.common.controller;
|
||||
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.thirdparty.common.service.ApiCommonService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -12,7 +10,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@Api(tags = "第三方公共接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/thirdparty/common")
|
||||
public class ApiCommonController {
|
||||
@@ -23,7 +20,6 @@ public class ApiCommonController {
|
||||
this.commonService = commonService;
|
||||
}
|
||||
|
||||
@ApiOperation("生成二维码")
|
||||
@PostMapping("/skipLinkToQRCode")
|
||||
public R<Object> skipLinkToQRCode(HttpServletResponse response, @RequestParam("contents") String contents) throws IOException {
|
||||
return commonService.writerPayImage(response, contents);
|
||||
|
||||
-5
@@ -11,8 +11,6 @@ import com.ruoyi.domain.common.constant.PayOrderStatus;
|
||||
import com.ruoyi.domain.dto.recharge.RechargeConfigOrderVo;
|
||||
import com.ruoyi.domain.entity.TtOrder;
|
||||
import com.ruoyi.domain.entity.TtRechargeConfig;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,7 +24,6 @@ import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Api(tags = "充值配置接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/recharge/config")
|
||||
public class ApiRechargeConfigController extends BaseController {
|
||||
@@ -37,7 +34,6 @@ public class ApiRechargeConfigController extends BaseController {
|
||||
@Autowired
|
||||
private TtOrderService ttOrderService;
|
||||
|
||||
@ApiOperation("充值结果列表")
|
||||
@PostMapping("/order")
|
||||
public R<List<RechargeConfigOrderVo>> order() {
|
||||
startPage();
|
||||
@@ -72,7 +68,6 @@ public class ApiRechargeConfigController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("充值列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<TtRechargeConfig>> list() {
|
||||
startPage();
|
||||
|
||||
-6
@@ -29,8 +29,6 @@ import com.ruoyi.thirdparty.common.service.PayFrequencyGuard;
|
||||
import com.ruoyi.thirdparty.abkpay.service.AbkPayPaymentService;
|
||||
import com.ruoyi.thirdparty.itpay.service.ItPayPaymentService;
|
||||
import com.ruoyi.thirdparty.snappay.service.SnapPayPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -42,7 +40,6 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "充值")
|
||||
@RestController
|
||||
@RequestMapping("/api/recharge")
|
||||
public class ApiRechargeController extends BaseController {
|
||||
@@ -86,7 +83,6 @@ public class ApiRechargeController extends BaseController {
|
||||
this.payFrequencyGuard = payFrequencyGuard;
|
||||
}
|
||||
|
||||
@ApiOperation("卡支付")
|
||||
@UpdateUserCache
|
||||
@RateLimiter(time = 60, count = 30, limitType = LimitType.IP)
|
||||
@PostMapping("/cardPay")
|
||||
@@ -124,7 +120,6 @@ public class ApiRechargeController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("充值列表")
|
||||
// @UpdateUserCache
|
||||
@Anonymous
|
||||
@PostMapping("/list")
|
||||
@@ -159,7 +154,6 @@ public class ApiRechargeController extends BaseController {
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@ApiOperation("统一充值下单(按权重分配支付公司)")
|
||||
@UserPermission
|
||||
@PostMapping("/unifiedPay")
|
||||
public R unifiedPay(@RequestBody UnifiedPayRequest request) {
|
||||
|
||||
+2
-28
@@ -8,17 +8,13 @@ import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.thirdparty.common.model.ApiSmsBody;
|
||||
import com.ruoyi.thirdparty.common.model.ApiSmsNoSliderBody;
|
||||
import com.ruoyi.thirdparty.common.service.ApiSmsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "短信")
|
||||
@RestController
|
||||
@RequestMapping("/api/sms")
|
||||
public class ApiSmsController extends BaseController {
|
||||
@@ -35,7 +31,6 @@ public class ApiSmsController extends BaseController {
|
||||
this.apiSmsService = apiSmsService;
|
||||
}
|
||||
|
||||
@ApiOperation("获取短信验证码")
|
||||
@Anonymous
|
||||
@PostMapping("/getVerifyCode")
|
||||
public R<Object> getVerifyCode(@RequestBody ApiSmsBody smsBody) {
|
||||
@@ -56,6 +51,8 @@ public class ApiSmsController extends BaseController {
|
||||
if (StringUtils.isEmpty(storedCaptchaId) || !storedCaptchaId.equals(captchaId)) {
|
||||
return R.fail("滑块验证已过期或无效,请重新验证");
|
||||
}
|
||||
// 一次性消费:同一个 captchaId 在 5 分钟有效期内只能换一条短信,否则可重放刷短信
|
||||
redisCache.deleteObject(verifiedKey);
|
||||
|
||||
String msg = apiSmsService.getVerifyCode(smsBody);
|
||||
if (StringUtils.isNotEmpty(msg)) {
|
||||
@@ -67,27 +64,4 @@ public class ApiSmsController extends BaseController {
|
||||
}
|
||||
return R.ok("获取验证码成功,请注意短信通知!");
|
||||
}
|
||||
|
||||
@ApiOperation("获取短信验证码(免滑块)")
|
||||
@Anonymous
|
||||
@PostMapping("/getVerifyCodeNoSlider")
|
||||
public R<Object> getVerifyCodeNoSlider(@RequestBody ApiSmsNoSliderBody body) {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
if ("1".equals(websiteMaintenance)) {
|
||||
return R.fail("网站维护中......");
|
||||
}
|
||||
|
||||
// 不校验滑块,直接发送验证码;适配 service 层入参不含 captchaId
|
||||
ApiSmsBody smsBody = new ApiSmsBody();
|
||||
smsBody.setPhoneNumber(body.getPhoneNumber());
|
||||
smsBody.setType(body.getType());
|
||||
String msg = apiSmsService.getVerifyCode(smsBody);
|
||||
if (StringUtils.isNotEmpty(msg)) {
|
||||
if (msg.contains("次数") || msg.contains("余额") || msg.contains("不足")) {
|
||||
return R.fail(999, "短信发送次数不足");
|
||||
}
|
||||
return R.fail(msg);
|
||||
}
|
||||
return R.ok("获取验证码成功,请注意短信通知!");
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -8,8 +8,6 @@ import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.thirdparty.common.service.DeliverGoodsService;
|
||||
import com.ruoyi.thirdparty.zbt.param.ProductListParams;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -17,7 +15,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "管理端发货管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/deliverGoods")
|
||||
public class DeliverGoodsController extends BaseController {
|
||||
@@ -38,14 +35,12 @@ public class DeliverGoodsController extends BaseController {
|
||||
}
|
||||
|
||||
// 获取饰品在各个平台的在售信息
|
||||
@ApiOperation("获取饰品在各个平台的在售信息")
|
||||
@PostMapping("/getAvailableMarketList")
|
||||
public R getAvailableMarketList(@RequestBody GetAvailableMarketListParam param) {
|
||||
return deliverGoodsService.getAvailableMarketList(param);
|
||||
}
|
||||
|
||||
// 根据饰品hashName获取所有平台的在售列表(弃用接口)
|
||||
@ApiOperation("根据饰品hashName获取所有平台的在售列表(弃用接口)")
|
||||
@GetMapping("/getAvailableMarketListByHashName/{marketHashName}")
|
||||
public R<List<AvailableMarketOrnamentVO>> getAvailableMarketListByHashName(@PathVariable("marketHashName") String marketHashName,
|
||||
ProductListParams productListParams) {
|
||||
@@ -54,26 +49,22 @@ public class DeliverGoodsController extends BaseController {
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@ApiOperation("购买发货")
|
||||
@PostMapping("/tradeBuy")
|
||||
public R tradeBuy(@RequestBody TradeBuyParam param) {
|
||||
return deliverGoodsService.tradeBuy(param);
|
||||
}
|
||||
|
||||
@ApiOperation("手动确认发货")
|
||||
@PostMapping("/tradeConfirm")
|
||||
public R tradeConfirm(@RequestBody TradeManualConfirmParam param) {
|
||||
return deliverGoodsService.tradeConfirm(param);
|
||||
}
|
||||
|
||||
@ApiOperation("同步状态")
|
||||
@GetMapping("/synchronousStatus")
|
||||
public R<Boolean> synchronousStatus(String outTradeNo) {
|
||||
String msg = deliverGoodsService.synchronousStatus(outTradeNo);
|
||||
return StringUtils.isEmpty(msg) ? R.ok(true, "同步成功!") : R.fail(false, msg);
|
||||
}
|
||||
|
||||
@ApiOperation("一键同步状态")
|
||||
@GetMapping("/syncAllStatus")
|
||||
public R syncAllStatus() {
|
||||
int row = deliverGoodsService.syncAllStatus();
|
||||
|
||||
Vendored
-4
@@ -1,15 +1,11 @@
|
||||
package com.ruoyi.thirdparty.common.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApiSmsBody {
|
||||
private String phoneNumber;
|
||||
@ApiModelProperty("1注册 2登录 3更换手机号 4找回密码 5实名认证")
|
||||
private String type;
|
||||
@ApiModelProperty("滑块验证码ID")
|
||||
private String captchaId;
|
||||
@ApiModelProperty("上级邀请码(推广后台登录:手机号未注册时用它校验是否可自动注册为主播)")
|
||||
private String parentInvitationCode;
|
||||
}
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
package com.ruoyi.thirdparty.common.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 免滑块短信验证码请求体(不含 captchaId)
|
||||
*/
|
||||
@Data
|
||||
public class ApiSmsNoSliderBody {
|
||||
@ApiModelProperty("手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@ApiModelProperty("1注册 2登录 3更换手机号 4找回密码 5实名认证")
|
||||
private String type;
|
||||
}
|
||||
-3
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.thirdparty.common.model;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -12,9 +11,7 @@ public class UnifiedPayRequest {
|
||||
@NotNull(message = "商品id不能为空")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty("支付方式:1=支付宝,2=银联")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty("1:原有支付,2:图片支付")
|
||||
private Integer payWay = 1;
|
||||
}
|
||||
|
||||
+33
-19
@@ -57,6 +57,9 @@ public class ApiSmsServiceImpl implements ApiSmsService {
|
||||
private static final int SMS_RATE_LIMIT_MAX_COUNT = 3;
|
||||
private static final int SMS_RATE_LIMIT_MINUTES = 10;
|
||||
|
||||
/** 单个验证码试错上限:4 位码不设上限可被穷举,超过即作废重发 */
|
||||
private static final int CAPTCHA_MAX_ATTEMPTS = 5;
|
||||
|
||||
@Override
|
||||
public String getVerifyCode(ApiSmsBody smsBody) {
|
||||
String phoneNumber = smsBody.getPhoneNumber();
|
||||
@@ -71,12 +74,7 @@ public class ApiSmsServiceImpl implements ApiSmsService {
|
||||
if (!Validator.isMobile(phoneNumber)) {
|
||||
return "手机号格式错误,请检查手机号是否输入正确!";
|
||||
}
|
||||
// 频率限制:同一手机号 10 分钟内最多发送 3 次(不限类型,防止跨类型刷短信)
|
||||
String rateLimitKey = "sms:rate_limit:" + phoneNumber;
|
||||
Integer sendCount = redisCache.getCacheObject(rateLimitKey);
|
||||
if (sendCount != null && sendCount >= SMS_RATE_LIMIT_MAX_COUNT) {
|
||||
return "操作过于频繁,请" + SMS_RATE_LIMIT_MINUTES + "分钟后再试";
|
||||
}
|
||||
// 手机号格式错误、无权限这类校验不占发送额度,额度只在真正要发短信时扣
|
||||
if ("1".equals(type) && !userService.checkPhoneUnique(TtUser.builder().phoneNumber(phoneNumber).build())) {
|
||||
return "手机号'" + phoneNumber + "'已被注册!";
|
||||
}
|
||||
@@ -100,6 +98,16 @@ public class ApiSmsServiceImpl implements ApiSmsService {
|
||||
if (StringUtils.isNotEmpty(cacheCode)) {
|
||||
return "验证码已发送,请注意手机短信信息!";
|
||||
}
|
||||
// 频率限制:同一手机号 10 分钟内最多发送 3 次(不限类型,防止跨类型刷短信)。
|
||||
// 用 Redis INCR 原子扣额度:读-改-写会被并发点两下绕过(两端都读到 2,各写 3,实发 4 条)
|
||||
String rateLimitKey = "sms:rate_limit:" + phoneNumber;
|
||||
Long sendCount = redisCache.redisTemplate.opsForValue().increment(rateLimitKey);
|
||||
if (sendCount != null && sendCount == 1L) {
|
||||
redisCache.expire(rateLimitKey, SMS_RATE_LIMIT_MINUTES, TimeUnit.MINUTES);
|
||||
}
|
||||
if (sendCount != null && sendCount > SMS_RATE_LIMIT_MAX_COUNT) {
|
||||
return "操作过于频繁,请" + SMS_RATE_LIMIT_MINUTES + "分钟后再试";
|
||||
}
|
||||
String randomCode = RandomUtil.randomNumbers(4);
|
||||
// 网易云信
|
||||
// String code = yunXinNoteService.sendNote(phoneNumber, randomCode);
|
||||
@@ -128,24 +136,30 @@ public class ApiSmsServiceImpl implements ApiSmsService {
|
||||
// if (!"000".equals(code)) {
|
||||
// return "发送短信验证码时出现异常!";
|
||||
// }
|
||||
// 更新发送频率计数(保留剩余 TTL,避免重置窗口)
|
||||
if (sendCount == null) {
|
||||
redisCache.setCacheObject(rateLimitKey, 1, SMS_RATE_LIMIT_MINUTES, TimeUnit.MINUTES);
|
||||
} else {
|
||||
long remainTtl = redisCache.getExpire(rateLimitKey);
|
||||
redisCache.setCacheObject(rateLimitKey, sendCount + 1,
|
||||
remainTtl > 0 ? (int) remainTtl : SMS_RATE_LIMIT_MINUTES * 60, TimeUnit.SECONDS);
|
||||
}
|
||||
// 发送额度已在上面原子扣减(撞额度上限时已提前 return),这里只写验证码
|
||||
redisCache.setCacheObject(verifyKey, randomCode, 5, TimeUnit.MINUTES);
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String validateCaptcha(String code, String verifyKey) {
|
||||
verifyKey = CacheConstants.CAPTCHA_CODE_KEY + verifyKey;
|
||||
String captcha = redisCache.getCacheObject(verifyKey);
|
||||
if (!code.equalsIgnoreCase(captcha)) return "验证码错误";
|
||||
redisCache.deleteObject(verifyKey);
|
||||
return "success";
|
||||
String codeKey = CacheConstants.CAPTCHA_CODE_KEY + verifyKey;
|
||||
String attemptKey = codeKey + ":fail";
|
||||
String captcha = redisCache.getCacheObject(codeKey);
|
||||
if (code != null && code.equalsIgnoreCase(captcha)) {
|
||||
redisCache.deleteObject(codeKey);
|
||||
redisCache.deleteObject(attemptKey);
|
||||
return "success";
|
||||
}
|
||||
Integer attempts = redisCache.getCacheObject(attemptKey);
|
||||
int fails = (attempts == null ? 0 : attempts) + 1;
|
||||
if (fails >= CAPTCHA_MAX_ATTEMPTS) {
|
||||
// 试错超限:作废验证码,必须重新获取
|
||||
redisCache.deleteObject(codeKey);
|
||||
redisCache.deleteObject(attemptKey);
|
||||
return "验证码错误次数过多,请重新获取验证码";
|
||||
}
|
||||
redisCache.setCacheObject(attemptKey, fails, 5, TimeUnit.MINUTES);
|
||||
return "验证码错误";
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ import com.ruoyi.thirdparty.zbt.param.SearchParams;
|
||||
import com.ruoyi.thirdparty.zbt.result.ResultZbt;
|
||||
import com.ruoyi.thirdparty.zbt.result.product.SearchData;
|
||||
import com.ruoyi.thirdparty.zbt.service.ZBTService;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
-4
@@ -9,8 +9,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.gfht.service.GfhtService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -18,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "国富汇通")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/gfht")
|
||||
@@ -30,7 +27,6 @@ public class GfhtController extends BaseController {
|
||||
@Autowired
|
||||
private GfhtService gfhtService;
|
||||
|
||||
@ApiOperation("支付")
|
||||
@UserPermission
|
||||
@PostMapping(value = "/pay")
|
||||
public R pay(@RequestBody @Validated CreateOrderParam param) {
|
||||
|
||||
-4
@@ -9,8 +9,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.hipay.service.HipayPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -18,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/hipay")
|
||||
@@ -30,7 +27,6 @@ public class HiPayController {
|
||||
@Autowired
|
||||
private HipayPaymentService hipayPaymentService;
|
||||
|
||||
@ApiOperation("支付")
|
||||
@UserPermission
|
||||
// @PostMapping(value = "/pay")
|
||||
public R pay(@RequestBody @Validated PayRequest param) {
|
||||
|
||||
skins-service/service-thirdparty/src/main/java/com/ruoyi/thirdparty/hipay/controller/PayRequest.java
Vendored
-3
@@ -1,6 +1,5 @@
|
||||
package com.ruoyi.thirdparty.hipay.controller;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
@@ -14,9 +13,7 @@ public class PayRequest {
|
||||
@Min(value = 1, message = "最小值1")
|
||||
private Integer goodsNum;
|
||||
|
||||
@ApiModelProperty("1:支付宝1 2:支付宝2")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty("1:原有支付,2:图片支付")
|
||||
private Integer payWay = 1;
|
||||
}
|
||||
|
||||
-7
@@ -12,8 +12,6 @@ import com.ruoyi.thirdparty.chengduhipay.controller.PayRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayResponse;
|
||||
import com.ruoyi.thirdparty.itpay.model.ItPayCreateResult;
|
||||
import com.ruoyi.thirdparty.itpay.service.ItPayPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -29,7 +27,6 @@ import java.util.Map;
|
||||
* orderStatus —— 查询本地订单支付状态(供前端轮询)
|
||||
* queryPay —— 主动查询平台订单
|
||||
*/
|
||||
@Api(tags = "itpay充值")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/itpay")
|
||||
@@ -44,7 +41,6 @@ public class ItPayController {
|
||||
/**
|
||||
* 创建充值订单
|
||||
*/
|
||||
@ApiOperation("创建充值订单")
|
||||
@UserPermission
|
||||
// @PostMapping("/pay")
|
||||
public R<PayResponse> pay(@RequestBody @Validated PayRequest param) {
|
||||
@@ -61,7 +57,6 @@ public class ItPayController {
|
||||
* 平台订单成功或失败都会回调,商户须返回字符串 "success"。
|
||||
* 处理失败(验签失败/订单不存在等)返回非 success,促使平台重推。
|
||||
*/
|
||||
@ApiOperation("充值回调通知")
|
||||
@Anonymous
|
||||
@PostMapping("/notify")
|
||||
@ResponseBody
|
||||
@@ -78,7 +73,6 @@ public class ItPayController {
|
||||
/**
|
||||
* 查询本地订单支付状态(供前端轮询)
|
||||
*/
|
||||
@ApiOperation("查询本地订单支付状态")
|
||||
@UserPermission
|
||||
@PostMapping("/orderStatus")
|
||||
public R<Map<String, Object>> orderStatus(@RequestBody @Validated OrderStatusRequest param) {
|
||||
@@ -89,7 +83,6 @@ public class ItPayController {
|
||||
/**
|
||||
* 主动查询平台订单
|
||||
*/
|
||||
@ApiOperation("查询充值订单")
|
||||
@GetMapping("/queryPay")
|
||||
public R<ItPayCreateResult> queryPay(@RequestParam String merOrderTid) {
|
||||
return itPayPaymentService.queryPay(merOrderTid);
|
||||
|
||||
-5
@@ -9,14 +9,11 @@ import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.thirdparty.jiujia.domain.CallbackBody;
|
||||
import com.ruoyi.thirdparty.jiujia.service.JiuJiaPayService;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "九嘉支付")
|
||||
@RestController
|
||||
@RequestMapping("/api/jiuJiaPay")
|
||||
public class JiuJiaPayController extends BaseController {
|
||||
@@ -34,14 +31,12 @@ public class JiuJiaPayController extends BaseController {
|
||||
}
|
||||
|
||||
// TODO: 2024/4/11 要修改!!!
|
||||
@ApiOperation("回滚")
|
||||
@Anonymous
|
||||
@PostMapping("/callback")
|
||||
public String callback(@RequestBody CallbackBody callbackBody) {
|
||||
return jiuJiaPayService.callback(callbackBody);
|
||||
}
|
||||
|
||||
@ApiOperation("九嘉预下单")
|
||||
@PostMapping("/createPay")
|
||||
public R<Object> createPay(@RequestBody CreateOrderParam createOrderBody) {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
|
||||
-8
@@ -12,8 +12,6 @@ import com.ruoyi.thirdparty.chengduhipay.controller.OrderStatusRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayResponse;
|
||||
import com.ruoyi.thirdparty.richku.service.RichKuPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -27,7 +25,6 @@ import java.util.Map;
|
||||
/**
|
||||
* RichKu 充值接口
|
||||
*/
|
||||
@Api(tags = "RichKu充值")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/richku")
|
||||
@@ -42,7 +39,6 @@ public class RichKuController {
|
||||
/**
|
||||
* 创建充值订单
|
||||
*/
|
||||
@ApiOperation("创建充值订单")
|
||||
@UserPermission
|
||||
// @PostMapping("/pay")
|
||||
public R<PayResponse> pay(@RequestBody @Validated PayRequest param, HttpServletRequest request) {
|
||||
@@ -60,7 +56,6 @@ public class RichKuController {
|
||||
* RichKu 平台在用户支付成功后通过 x-www-form-urlencoded 方式 POST 通知
|
||||
* 必须返回纯文本 "OK"
|
||||
*/
|
||||
@ApiOperation("充值回调通知")
|
||||
@Anonymous
|
||||
@PostMapping(value = "/notify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
||||
@ResponseBody
|
||||
@@ -76,7 +71,6 @@ public class RichKuController {
|
||||
/**
|
||||
* 查询本地订单支付状态(供前端轮询)
|
||||
*/
|
||||
@ApiOperation("查询本地订单支付状态")
|
||||
@UserPermission
|
||||
@PostMapping("/orderStatus")
|
||||
public R<Map<String, Object>> orderStatus(@RequestBody @Validated OrderStatusRequest param) {
|
||||
@@ -87,7 +81,6 @@ public class RichKuController {
|
||||
/**
|
||||
* 查询外部订单
|
||||
*/
|
||||
@ApiOperation("查询充值订单")
|
||||
@GetMapping("/queryPay")
|
||||
public R<Map<String, String>> queryPay(@RequestParam String orderId) {
|
||||
return richKuPaymentService.queryPay(orderId);
|
||||
@@ -96,7 +89,6 @@ public class RichKuController {
|
||||
/**
|
||||
* 查询商户余额
|
||||
*/
|
||||
@ApiOperation("查询商户余额")
|
||||
@GetMapping("/balance")
|
||||
public R<String> balance() {
|
||||
return richKuPaymentService.getBalance();
|
||||
|
||||
-7
@@ -12,8 +12,6 @@ import com.ruoyi.thirdparty.chengduhipay.controller.OrderStatusRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayRequest;
|
||||
import com.ruoyi.thirdparty.chengduhipay.controller.PayResponse;
|
||||
import com.ruoyi.thirdparty.snappay.service.SnapPayPaymentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -35,7 +33,6 @@ import java.util.Map;
|
||||
* orderStatus —— 查询本地订单支付状态(供前端轮询)
|
||||
* queryPay —— 主动查询平台交易
|
||||
*/
|
||||
@Api(tags = "snappay充值")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/snappay")
|
||||
@@ -50,7 +47,6 @@ public class SnapPayController {
|
||||
/**
|
||||
* 创建充值订单(默认由统一充值路由调用)
|
||||
*/
|
||||
@ApiOperation("创建充值订单")
|
||||
@UserPermission
|
||||
@PostMapping("/pay")
|
||||
public R<PayResponse> pay(@RequestBody @Validated PayRequest param) {
|
||||
@@ -70,7 +66,6 @@ public class SnapPayController {
|
||||
* 交易进入终态时平台会回调,商户须返回字符串 "success"。
|
||||
* 处理失败(验签失败/订单不存在等)返回非 success,促使平台重推。
|
||||
*/
|
||||
@ApiOperation("充值回调通知")
|
||||
@Anonymous
|
||||
@PostMapping("/notify")
|
||||
@ResponseBody
|
||||
@@ -87,7 +82,6 @@ public class SnapPayController {
|
||||
/**
|
||||
* 查询本地订单支付状态(供前端轮询)
|
||||
*/
|
||||
@ApiOperation("查询本地订单支付状态")
|
||||
@UserPermission
|
||||
@PostMapping("/orderStatus")
|
||||
public R<Map<String, Object>> orderStatus(@RequestBody @Validated OrderStatusRequest param) {
|
||||
@@ -98,7 +92,6 @@ public class SnapPayController {
|
||||
/**
|
||||
* 主动查询平台交易(仅允许查询本人订单)
|
||||
*/
|
||||
@ApiOperation("查询充值订单")
|
||||
@UserPermission
|
||||
@GetMapping("/queryPay")
|
||||
public R<JSONObject> queryPay(@RequestParam String merchantOrderId) {
|
||||
|
||||
+2
-8
@@ -8,8 +8,6 @@ import com.ruoyi.thirdparty.wechat.domain.PayOrderParam;
|
||||
import com.ruoyi.thirdparty.wechat.service.ApiTokenService;
|
||||
import com.ruoyi.thirdparty.wechat.service.TianXinService;
|
||||
import com.ruoyi.thirdparty.wechat.utils.GetIpUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -19,7 +17,6 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import static com.ruoyi.common.utils.SecurityUtils.getUserId;
|
||||
|
||||
@Api(tags = "田心支付")
|
||||
@RestController
|
||||
@RequestMapping("/api/tianxinOrder")
|
||||
public class TianXinController {
|
||||
@@ -36,9 +33,8 @@ public class TianXinController {
|
||||
this.ttUserService = ttUserService;
|
||||
}
|
||||
|
||||
@ApiOperation("预下单")
|
||||
@UserPermission
|
||||
@PostMapping("/createOrder")
|
||||
// [停用-前端零调用] @PostMapping("/createOrder")
|
||||
public AjaxResult createOrder(@RequestBody PayOrderParam param, HttpServletRequest request) {
|
||||
|
||||
// 判断是否开启田心支付
|
||||
@@ -58,14 +54,12 @@ public class TianXinController {
|
||||
// return tianXinService.createOrder(param, ttUser, ip);
|
||||
}
|
||||
|
||||
@ApiOperation("查询订单状态")
|
||||
@UserPermission
|
||||
@PostMapping(value = "/queryOrderStatus")
|
||||
// [停用-前端零调用] @PostMapping(value = "/queryOrderStatus")
|
||||
public AjaxResult queryOrderStatus(String sdorderno) {
|
||||
return tianXinService.queryOrderStatus(sdorderno);
|
||||
}
|
||||
|
||||
@ApiOperation("回调")
|
||||
// @RequestMapping(value = "/callBack")
|
||||
public String returnCallBack(HttpServletRequest request) {
|
||||
return tianXinService.callBack(request);
|
||||
|
||||
-4
@@ -9,8 +9,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.thirdparty.xinghuopay.service.XinghuoPayService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -18,7 +16,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "XinghuoPay")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/xinghuopay")
|
||||
@@ -30,7 +27,6 @@ public class XinghuoPayController extends BaseController {
|
||||
@Autowired
|
||||
private XinghuoPayService xinghuoService;
|
||||
|
||||
@ApiOperation("支付")
|
||||
@UserPermission
|
||||
@PostMapping(value = "/pay")
|
||||
public R pay(@RequestBody @Validated CreateOrderParam param) {
|
||||
|
||||
-9
@@ -10,8 +10,6 @@ import com.ruoyi.domain.entity.TtOrnamentsYY;
|
||||
import com.ruoyi.thirdparty.yyyouping.service.yyyoupingService;
|
||||
import com.ruoyi.thirdparty.yyyouping.utils.YYClient;
|
||||
import com.ruoyi.thirdparty.yyyouping.utils.common.YYResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -28,7 +26,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "YYYouPing")
|
||||
@RestController
|
||||
@RequestMapping("api/yyyouping")
|
||||
public class yyyoupingController {
|
||||
@@ -49,7 +46,6 @@ public class yyyoupingController {
|
||||
private TtOrnamentYYService ttOrnamentYYService;
|
||||
|
||||
// 加载平台的饰品数据
|
||||
@ApiOperation("加载平台的饰品数据")
|
||||
@GetMapping("loadData")
|
||||
public R loadData(){
|
||||
// 读json
|
||||
@@ -62,7 +58,6 @@ public class yyyoupingController {
|
||||
}
|
||||
|
||||
// 通过此接口可获取悠悠有品所有商品对应的模板ID的下载链接。
|
||||
@ApiOperation("查询模板ID下载链接")
|
||||
@GetMapping("yyApiTemplateQuery")
|
||||
public R yyApiTemplateQuery(){
|
||||
YYResult yyResult = yyyoupingService.yyApiTemplateQuery(new HashMap<>());
|
||||
@@ -70,14 +65,12 @@ public class yyyoupingController {
|
||||
return R.ok(yyResult);
|
||||
}
|
||||
|
||||
@ApiOperation("查询商品列表")
|
||||
@PostMapping("yyApiGoodsQuery")
|
||||
public R yyApiGoodsQuery(@RequestBody Map<String,Object> map){
|
||||
yyyoupingService.yyApiGoodsQuery(map);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("余额查询")
|
||||
@PostMapping("yyApiGetAssetsInfo")
|
||||
public R yyApiGetAssetsInfo(){
|
||||
YYResult yyResult = yyyoupingService.yyApiGetAssetsInfo();
|
||||
@@ -85,7 +78,6 @@ public class yyyoupingController {
|
||||
return R.ok(yyResult);
|
||||
}
|
||||
|
||||
@ApiOperation("批量查询模板饰品的在售列表")
|
||||
@PostMapping("/yyApiBatchGetOnSaleCommodityInfo")
|
||||
public R balance(@RequestBody List<String> ids) {
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
@@ -100,7 +92,6 @@ public class yyyoupingController {
|
||||
return R.ok(yyResult);
|
||||
}
|
||||
|
||||
@ApiOperation("按类别查询模板销售")
|
||||
@GetMapping("/yyApiQueryTemplateSaleByCategory")
|
||||
public R yyApiQueryTemplateSaleByCategory() throws Exception {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ import com.ruoyi.thirdparty.yyyouping.config.YYConfig;
|
||||
import com.ruoyi.thirdparty.yyyouping.service.yyyoupingService;
|
||||
import com.ruoyi.thirdparty.yyyouping.utils.common.RSAUtils;
|
||||
import com.ruoyi.thirdparty.yyyouping.utils.common.YYResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
-5
@@ -8,14 +8,11 @@ import com.ruoyi.thirdparty.zbt.result.user.BusinessData;
|
||||
import com.ruoyi.thirdparty.zbt.result.user.UserAccountModel;
|
||||
import com.ruoyi.thirdparty.zbt.service.ZBTService;
|
||||
import com.ruoyi.thirdparty.zbt.util.ZBTUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "扎比特")
|
||||
@RestController
|
||||
@RequestMapping
|
||||
public class ZBTController {
|
||||
@@ -26,7 +23,6 @@ public class ZBTController {
|
||||
this.zbtService = zbtService;
|
||||
}
|
||||
|
||||
@ApiOperation("管理端查询用户余额")
|
||||
@GetMapping("/admin/zbt/balance")
|
||||
public R<UserAccountModel> balance() {
|
||||
ResultZbt<UserAccountModel> balance = zbtService.balance();
|
||||
@@ -34,7 +30,6 @@ public class ZBTController {
|
||||
return R.fail("用户余额查询失败");
|
||||
}
|
||||
|
||||
@ApiOperation("管理端获取开发者信息")
|
||||
@GetMapping("/admin/zbt/developmentInfo")
|
||||
public R<BusinessData> developmentInfo() {
|
||||
ResultZbt<BusinessData> developmentInfo = zbtService.developmentInfo();
|
||||
|
||||
+3
-11
@@ -10,8 +10,6 @@ import com.ruoyi.domain.other.CreateOrderParam;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.thirdparty.zyZFB.config.ZYConfig;
|
||||
import com.ruoyi.thirdparty.zyZFB.service.zyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -24,7 +22,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "中云支付宝")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("api/zyZFB")
|
||||
@@ -40,7 +37,6 @@ public class ZyController extends BaseController {
|
||||
private TtUserService userService;
|
||||
|
||||
// 下单
|
||||
@ApiOperation("预下单接口")
|
||||
@PostMapping("/ApiAddTrans")
|
||||
@UpdateUserCache
|
||||
public R ApiAddTrans(HttpServletRequest request, CreateOrderParam param) {
|
||||
@@ -71,7 +67,6 @@ public class ZyController extends BaseController {
|
||||
}
|
||||
|
||||
// 支付回调
|
||||
@ApiOperation("支付回调")
|
||||
// @PostMapping("/addTransNotify")
|
||||
public String addTransNotify(PayNotifyData data) {
|
||||
log.info("支付回调 {}", JSONUtil.toJsonStr(data));
|
||||
@@ -79,22 +74,19 @@ public class ZyController extends BaseController {
|
||||
}
|
||||
|
||||
// 查询订单接口
|
||||
@ApiOperation("查询订单")
|
||||
@PostMapping("/ApiQueryTrans")
|
||||
// [停用-前端零调用] @PostMapping("/ApiQueryTrans")
|
||||
public String ApiQueryTrans(HttpServletRequest request, Map<String, String> param) {
|
||||
return "success";
|
||||
}
|
||||
|
||||
// 代付接口
|
||||
@ApiOperation("代付")
|
||||
@PostMapping("/ApiPropayTrans")
|
||||
// [停用-前端零调用] @PostMapping("/ApiPropayTrans")
|
||||
public String ApiPropayTrans(HttpServletRequest request, Map<String, String> param) {
|
||||
return "success";
|
||||
}
|
||||
|
||||
// 查询余额接口
|
||||
@ApiOperation("查询余额")
|
||||
@PostMapping("/ApiQueryBalancePHP")
|
||||
// [停用-前端零调用] @PostMapping("/ApiQueryBalancePHP")
|
||||
public String ApiQueryBalancePHP(HttpServletRequest request, Map<String, String> param) {
|
||||
return "success";
|
||||
}
|
||||
|
||||
+1
-3
@@ -4,10 +4,8 @@ import com.ruoyi.admin.service.TtAdvertisementService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.domain.other.TtAdvertisement;
|
||||
import com.ruoyi.user.contract.api.request.GetAdvertisementRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "广告查询")
|
||||
@RestController
|
||||
@RequestMapping("/api/advertisement")
|
||||
public class ApiAdvertisementController {
|
||||
@@ -18,7 +16,7 @@ public class ApiAdvertisementController {
|
||||
this.ttAdvertisementService = ttAdvertisementService;
|
||||
}
|
||||
|
||||
@PostMapping("/getInfo")
|
||||
// [停用-前端零调用] @PostMapping("/getInfo")
|
||||
public R<TtAdvertisement> getInfo(@RequestBody GetAdvertisementRequest getAdvertisementRequest) {
|
||||
TtAdvertisement ttAdvertisement = ttAdvertisementService.getById(getAdvertisementRequest.getId());
|
||||
// ttBanner.setPicture("");
|
||||
|
||||
+1
-11
@@ -14,9 +14,6 @@ import com.ruoyi.user.model.vo.ApiNoticeVO;
|
||||
import com.ruoyi.user.model.vo.MessageItemVO;
|
||||
import com.ruoyi.user.service.ApiAnnouncementService;
|
||||
import com.ruoyi.user.service.ApiNoticeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -24,7 +21,6 @@ import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "公告")
|
||||
@RestController
|
||||
@RequestMapping("/api/announcement")
|
||||
public class ApiAnnouncementController extends BaseController {
|
||||
@@ -35,8 +31,6 @@ public class ApiAnnouncementController extends BaseController {
|
||||
@Autowired
|
||||
private ApiNoticeService apiNoticeService;
|
||||
|
||||
@ApiOperation("获取公告列表(含用户通知,统一结构返回)")
|
||||
@ApiResponse(code = 200, message = "read【阅读状态(0未读 1已读)】")
|
||||
@PostMapping("/list")
|
||||
public AjaxResult list(@RequestBody(required = false) GetAnnouncementListRequest request) {
|
||||
Integer tabType = request == null ? null : request.getTabType();
|
||||
@@ -74,7 +68,6 @@ public class ApiAnnouncementController extends BaseController {
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("获取系统公告列表(免登录)")
|
||||
@PostMapping("/systemList")
|
||||
public TableDataInfo systemList() {
|
||||
startPage();
|
||||
@@ -82,7 +75,6 @@ public class ApiAnnouncementController extends BaseController {
|
||||
return getDataTable(announcementList);
|
||||
}
|
||||
|
||||
@ApiOperation("获取公告/通知详情(统一结构返回)")
|
||||
@PostMapping("/detail")
|
||||
public AjaxResult getAnnouncementByAnnouncementId(@RequestBody GetAnnouncementRequest request) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
@@ -153,7 +145,6 @@ public class ApiAnnouncementController extends BaseController {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ApiOperation("获取未读公告数量(含未读通知)")
|
||||
@PostMapping("/countUnreadAnnouncement")
|
||||
public AjaxResult countUnreadAnnouncement() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
@@ -162,8 +153,7 @@ public class ApiAnnouncementController extends BaseController {
|
||||
return AjaxResult.success(announcementUnread + noticeUnread);
|
||||
}
|
||||
|
||||
@ApiOperation("批量设置指定分类的通知为已读(游戏/系统)")
|
||||
@PostMapping("/markAsReadByCategory")
|
||||
// [停用-前端零调用] @PostMapping("/markAsReadByCategory")
|
||||
public AjaxResult markNoticesAsReadByCategory(@RequestBody MarkAsReadRequest request) {
|
||||
int result = apiNoticeService.markNoticesAsReadByCategory(request.getCategoryPrefix());
|
||||
return AjaxResult.success(result);
|
||||
|
||||
+1
-5
@@ -10,8 +10,6 @@ import com.ruoyi.domain.dto.ChildDetailByBoss;
|
||||
import com.ruoyi.domain.vo.ChildDetailByBossVO;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.user.service.ApiShoppingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -19,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Api(tags = "用户收支记录")
|
||||
@RestController
|
||||
@RequestMapping("/api/blendErcash")
|
||||
public class ApiBlendErcashController extends BaseController {
|
||||
@@ -37,8 +34,7 @@ public class ApiBlendErcashController extends BaseController {
|
||||
private TtUserService userService;
|
||||
|
||||
// 下级消费明细
|
||||
@ApiOperation("粉丝消费明细")
|
||||
@PostMapping("/childDetailByBoss")
|
||||
// [停用-前端零调用] @PostMapping("/childDetailByBoss")
|
||||
// @Anonymous
|
||||
public R<Page<ChildDetailByBossVO>> childDetailByBoss(@RequestBody @Validated ChildDetailByBoss param){
|
||||
|
||||
|
||||
+2
-8
@@ -10,11 +10,8 @@ import com.ruoyi.user.contract.api.request.ReceiveRedPacketRequest;
|
||||
import com.ruoyi.user.contract.api.response.QueryVipRewardResponse;
|
||||
import com.ruoyi.user.contract.api.response.VipFlowRewardResponse;
|
||||
import com.ruoyi.user.service.ApiBonusService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "福利补贴")
|
||||
@RestController
|
||||
@RequestMapping("/api/bonus")
|
||||
public class ApiBonusController extends BaseController {
|
||||
@@ -31,7 +28,6 @@ public class ApiBonusController extends BaseController {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@ApiOperation("领取红包")
|
||||
@UpdateUserCache
|
||||
@PostMapping("/receiveRedPacket")
|
||||
public R receiveRedPacket(@RequestBody ReceiveRedPacketRequest request) {
|
||||
@@ -43,8 +39,7 @@ public class ApiBonusController extends BaseController {
|
||||
return apiBonusService.receiveRedPacket(request.getCode(), ttUser);
|
||||
}
|
||||
|
||||
@ApiOperation("查询vip流水奖励")
|
||||
@PostMapping("/vipreward/list")
|
||||
// [停用-前端零调用] @PostMapping("/vipreward/list")
|
||||
public R<QueryVipRewardResponse> vipRewardList() {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
if ("1".equals(websiteMaintenance)) {
|
||||
@@ -54,8 +49,7 @@ public class ApiBonusController extends BaseController {
|
||||
return apiBonusService.vipRewardList(ttUser);
|
||||
}
|
||||
|
||||
@ApiOperation("VIP流水奖励(精简版)")
|
||||
@PostMapping("/vipFlowReward")
|
||||
// [停用-前端零调用] @PostMapping("/vipFlowReward")
|
||||
public R<VipFlowRewardResponse> vipFlowReward() {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
if ("1".equals(websiteMaintenance)) {
|
||||
|
||||
-5
@@ -10,8 +10,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.domain.other.ApiCaptchaCheckRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -26,7 +24,6 @@ import java.util.concurrent.TimeUnit;
|
||||
* POST /api/captcha/gen - 生成验证码
|
||||
* POST /api/captcha/check - 校验验证码,通过后在 Redis 写入标记供后续短信/密码登录使用
|
||||
*/
|
||||
@Api(tags = "滑块验证码")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
@@ -43,7 +40,6 @@ public class ApiCaptchaController extends BaseController {
|
||||
/**
|
||||
* 生成滑块验证码
|
||||
*/
|
||||
@ApiOperation("生成滑块验证码")
|
||||
@Anonymous
|
||||
@PostMapping("/captcha/gen")
|
||||
public AjaxResult genCaptcha() {
|
||||
@@ -73,7 +69,6 @@ public class ApiCaptchaController extends BaseController {
|
||||
* 校验滑块验证码
|
||||
* 通过后在 Redis 写入 captcha:verified:{phoneNumber} = captchaId,有效期 5 分钟
|
||||
*/
|
||||
@ApiOperation("校验滑块验证码")
|
||||
@Anonymous
|
||||
@PostMapping("/captcha/check")
|
||||
public AjaxResult checkCaptcha(@RequestBody ApiCaptchaCheckRequest request) {
|
||||
|
||||
+2
-12
@@ -23,8 +23,6 @@ import com.ruoyi.framework.web.service.TokenService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.user.service.ApiLoginService;
|
||||
import com.ruoyi.user.service.ApiUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -44,7 +42,6 @@ import java.util.Objects;
|
||||
/**
|
||||
* 登录Controller
|
||||
*/
|
||||
@Api(tags = "客户端用户认证")
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class ApiLoginController extends BaseController {
|
||||
@@ -71,7 +68,6 @@ public class ApiLoginController extends BaseController {
|
||||
@Autowired
|
||||
private TtPromotionUpdateMapper ttPromotionUpdateMapper;
|
||||
|
||||
@ApiOperation("客户端用户登录")
|
||||
@Anonymous
|
||||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody @Validated ApiLoginBody loginBody) {
|
||||
@@ -100,9 +96,8 @@ public class ApiLoginController extends BaseController {
|
||||
return ajax;
|
||||
}
|
||||
|
||||
@ApiOperation("客户端用户验证码登录")
|
||||
@Anonymous
|
||||
@PostMapping("/verificationCodeLogin")
|
||||
// [停用-前端零调用] @PostMapping("/verificationCodeLogin")
|
||||
public AjaxResult verificationCodeLogin(@RequestBody @Validated ApiVerificationCodeLoginBody apiVerificationCodeLoginBody) {
|
||||
String websiteMaintenance = sysConfigService.selectConfigByKey("websiteMaintenance");
|
||||
if ("1".equals(websiteMaintenance)) {
|
||||
@@ -111,7 +106,6 @@ public class ApiLoginController extends BaseController {
|
||||
return loginService.verificationCodeLogin(apiVerificationCodeLoginBody.getPhoneNumber(), apiVerificationCodeLoginBody.getCode());
|
||||
}
|
||||
|
||||
@ApiOperation("客户端用户验证码登录或注册")
|
||||
@Anonymous
|
||||
@PostMapping("/verificationCodeLoginOrRegister")
|
||||
public AjaxResult verificationCodeLoginOrRegister(@RequestBody @Validated ApiVerificationCodeLoginOrRegisterBody req) {
|
||||
@@ -123,9 +117,8 @@ public class ApiLoginController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("获取用户信息")
|
||||
@NewUserInfo
|
||||
@PostMapping("/getInfo")
|
||||
// [停用-前端零调用] @PostMapping("/getInfo")
|
||||
public R<UserData> getInfo() {
|
||||
UserData userData = getLoginUser().getUserData();
|
||||
TtUser ttUser = userService.getById(getUserId());
|
||||
@@ -143,7 +136,6 @@ public class ApiLoginController extends BaseController {
|
||||
return R.ok(userData);
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户余额信息")
|
||||
@NewUserInfo
|
||||
@PostMapping("/getAccountAmount")
|
||||
public R<UserData> getAccountAmount() {
|
||||
@@ -162,7 +154,6 @@ public class ApiLoginController extends BaseController {
|
||||
return dbVipLevel != null && dbVipLevel > 0 ? dbVipLevel - 1 : 0;
|
||||
}
|
||||
|
||||
@ApiOperation("获取用户信息")
|
||||
@NewUserInfo
|
||||
@PostMapping("/getParentInfo")
|
||||
public R<Map<String, Object>> getParentInfo() {
|
||||
@@ -202,7 +193,6 @@ public class ApiLoginController extends BaseController {
|
||||
return R.ok(r);
|
||||
}
|
||||
|
||||
@ApiOperation("客户端用户退出")
|
||||
@PostMapping("/logout")
|
||||
public R<Object> logout() {
|
||||
if (StringUtils.isNotNull(getLoginUser())) {
|
||||
|
||||
+4
-10
@@ -11,15 +11,12 @@ import com.ruoyi.user.contract.api.request.BatchOperationMessageRequest;
|
||||
import com.ruoyi.user.contract.api.request.MessageRequest;
|
||||
import com.ruoyi.user.service.ApiMessageService;
|
||||
import com.ruoyi.domain.vo.ApiMessageDataVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "消息")
|
||||
@RestController
|
||||
@RequestMapping("/api/message")
|
||||
public class ApiMessageController extends BaseController {
|
||||
@@ -33,7 +30,7 @@ public class ApiMessageController extends BaseController {
|
||||
@Autowired
|
||||
private TtMessageService ttMessageService;
|
||||
|
||||
@PostMapping("/list")
|
||||
// [停用-前端零调用] @PostMapping("/list")
|
||||
public PageDataInfo<TtMessage> list() {
|
||||
startPage();
|
||||
QueryWrapper<TtMessage> queryWrapper = new QueryWrapper<>();
|
||||
@@ -42,23 +39,20 @@ public class ApiMessageController extends BaseController {
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("获取消息列表")
|
||||
@PostMapping("/getMessageList")
|
||||
// [停用-前端零调用] @PostMapping("/getMessageList")
|
||||
public PageDataInfo<ApiMessageDataVO> getMessageList(@RequestBody(required = false) MessageRequest request){
|
||||
startPage();
|
||||
List<ApiMessageDataVO> list = apiMessageService.getMessageList(getUserId(), request.getId());
|
||||
return getPageData(list);
|
||||
}
|
||||
|
||||
@ApiOperation("已读Message")
|
||||
@PostMapping("/view")
|
||||
// [停用-前端零调用] @PostMapping("/view")
|
||||
public R<ApiMessageDataVO> view(@RequestBody MessageRequest request){
|
||||
ApiMessageDataVO data = apiMessageService.view(getUserId(), request.getId());
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@ApiOperation("分批操作Message")
|
||||
@PostMapping("/batchOperation")
|
||||
// [停用-前端零调用] @PostMapping("/batchOperation")
|
||||
public R<Boolean> batchOperation(@RequestBody BatchOperationMessageRequest request){
|
||||
String msg = apiMessageService.batchOperation(getUserId(), Arrays.asList(request.getIds()), request.getStatus());
|
||||
return StringUtils.isEmpty(msg) ? R.ok(true, "操作成功!") : R.fail(false, msg);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user