From e472433337ead563f4635d20a145143b089c6889 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Mon, 14 Oct 2024 12:21:06 +0800 Subject: [PATCH] =?UTF-8?q?release:=20app=E5=8F=AF=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E4=B8=AD=E5=A5=96=E7=BB=93=E6=9E=9C=E7=AD=9B=E9=80=89=E7=94=A8?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../luoo/user/controller/PointController.java | 6 ++--- .../point/LotteryParticipatedSearchDto.java | 24 +++++++++++++++++++ .../com/luoo/user/service/LotteryService.java | 5 ++-- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 luoo_user/src/main/java/com/luoo/user/dto/point/LotteryParticipatedSearchDto.java diff --git a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java index a3a8140..9e59059 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/PointController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/PointController.java @@ -372,14 +372,14 @@ public class PointController { } @ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP") - @GetMapping("/lottery/participated/{page}/{size}") + @PostMapping("/lottery/participated/{page}/{size}") @GlobalInterceptor(checkAppUserLogin = true) public Result> findParticipatedLotteryUserList( @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, - @ApiParam(value = "抽奖id") @RequestParam("lotteryId") String lotteryId, + @ApiParam(value = "查询参数") @RequestBody LotteryParticipatedSearchDto lotteryParticipatedSearchDto, @ApiParam(value = "页码", required = true) @PathVariable Integer page, @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { - return Result.success(lotteryService.findPageByLotteryId(page, size, lotteryId)); + return Result.success(lotteryService.findPageByLotteryId(page, size, lotteryParticipatedSearchDto)); } @ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP") diff --git a/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryParticipatedSearchDto.java b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryParticipatedSearchDto.java new file mode 100644 index 0000000..ae43701 --- /dev/null +++ b/luoo_user/src/main/java/com/luoo/user/dto/point/LotteryParticipatedSearchDto.java @@ -0,0 +1,24 @@ +package com.luoo.user.dto.point; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * @program: luoo_parent + * @description: 已参加抽奖的人查询参数 + * @author: yawei.huang + * @create: 2024-10-14 12:13 + **/ +@Data +public class LotteryParticipatedSearchDto implements Serializable { + + private static final long serialVersionUID = -1188283935760704569L; + + @ApiModelProperty(value = "抽奖id") + private String lotteryId; + + @ApiModelProperty(value = "中奖结果 1-中奖 2-未中奖 null-全部") + private Integer lotteryResult; +} diff --git a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java index 0710a50..c52318b 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/LotteryService.java @@ -9,6 +9,7 @@ import com.luoo.user.dao.LotteryRegionDao; import com.luoo.user.dao.LotteryUserDao; import com.luoo.user.dao.UserInfoDao; import com.luoo.user.dto.point.DrawDTO; +import com.luoo.user.dto.point.LotteryParticipatedSearchDto; import com.luoo.user.dto.point.LotterySearchDto; import com.luoo.user.pojo.*; import com.luoo.user.vo.point.*; @@ -581,13 +582,13 @@ public class LotteryService { return lotteryRegionList; } - public PageResult findPageByLotteryId(Integer page, Integer size, String lotteryId) { + public PageResult findPageByLotteryId(Integer page, Integer size, LotteryParticipatedSearchDto lotteryParticipatedSearchDto) { QLotteryUser qLotteryUser = QLotteryUser.lotteryUser; QUserInfo qUserInfo = QUserInfo.userInfo; BooleanBuilder booleanBuilder = new BooleanBuilder(); - checkLotteryUserCondition(booleanBuilder, qLotteryUser, lotteryId, null); + checkLotteryUserCondition(booleanBuilder, qLotteryUser, lotteryParticipatedSearchDto.getLotteryId(), lotteryParticipatedSearchDto.getLotteryResult()); Pageable pageable = PageRequest.of(page - 1, size); // 头像字段拼接字符串