release- lottery h5接口处理

release-2024-04-25
huangyw 2 months ago
parent 595a92313d
commit a96b71bd06

@ -365,9 +365,9 @@ public class PointController {
@ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP")
@PostMapping("/lottery/participated/{page}/{size}")
@GlobalInterceptor(checkAppUserLogin = true)
// @GlobalInterceptor(checkAppUserLogin = true)
public Result<PageResult<LotteryUserAPPVO>> findParticipatedLotteryUserList(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "Header中的token信息") @RequestHeader("Authorization") String token,
@ApiParam(value = "查询参数") @RequestBody LotteryParticipatedSearchDto lotteryParticipatedSearchDto,
@ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
@ -411,9 +411,9 @@ public class PointController {
@ApiOperation(value = "3.14.抽奖详情(APP)", notes = "APP")
@GetMapping("/app/lottery/detail/{id}")
@GlobalInterceptor(checkAppUserLogin = true)
// @GlobalInterceptor(checkAppUserLogin = true)
public Result<LotteryDetailAPPVO> findLotteryDetailAPPVO(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "Header中的token信息") @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
return Result.success(lotteryService.getLotteryDetailAPPVO(id));
}

@ -705,6 +705,13 @@ public class LotteryService {
.limit(pageable.getPageSize())
.fetch();
UserLoginDto user = jwtUtil.getUser();
if (user == null) {
for (LotteryUserAPPVO lotteryUserAPPVO : lotteryUserList) {
lotteryUserAPPVO.setResult(null);
}
}
long total = jpaQueryFactory
.select(qLotteryUser.count())
.from(qLotteryUser)
@ -837,12 +844,15 @@ public class LotteryService {
BeanUtils.copyProperties(lotteryDetailPCVO, result);
UserLoginDto userLoginDto = jwtUtil.getUser();
LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId());
if (lotteryUser != null) {
result.setIsParticipate(PointEnums.PARTICIPATED.getCode());
} else {
result.setIsParticipate(PointEnums.NOT_PARTICIPATED.getCode());
if (userLoginDto != null) {
LotteryUser lotteryUser = lotteryUserDao.findByLotteryIdAndUserId(lotteryId, userLoginDto.getUserId());
if (lotteryUser != null) {
result.setIsParticipate(PointEnums.PARTICIPATED.getCode());
} else {
result.setIsParticipate(PointEnums.NOT_PARTICIPATED.getCode());
}
}
long participateNum = getParticipateNumByLotteryId(lotteryId);
// 设置抽奖人数
result.setParticipateNum(participateNum);

Loading…
Cancel
Save