release- TaskPoint序列化

release-2024-08-08
huangyawei 4 months ago
parent c44c213f92
commit a2bed1ddf6

@ -46,305 +46,311 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "积分模块") @Api(tags = "积分模块")
public class PointController { public class PointController {
@Autowired @Autowired
private TaskPointService taskPointService; private TaskPointService taskPointService;
@Autowired @Autowired
private UserPointLogService userPointLogService; private UserPointLogService userPointLogService;
@Autowired @Autowired
private LotteryService lotteryService; private LotteryService lotteryService;
@Autowired @Autowired
private DrawLotteryService drawLotteryService; private DrawLotteryService drawLotteryService;
@ApiOperation(value = "1.1.新增任务积分配置(PC)", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.1.新增任务积分配置(PC)", notes = "仅限admin权限用户调用")
@PostMapping("/task/add") @PostMapping("/task/add")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskPoint", value = "任务积分配置", required = true, dataType = "TaskPoint", paramType = "body"), @ApiImplicitParam(name = "taskPoint", value = "任务积分配置", required = true, dataType = "TaskPoint", paramType = "body"),
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")}) @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")})
public Result<Void> add( public Result<Void> add(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody TaskPointDto taskPointDto) { @RequestBody TaskPointDto taskPointDto) {
TaskPoint taskPoint = new TaskPoint(); TaskPoint taskPoint = new TaskPoint();
BeanUtils.copyProperties(taskPointDto, taskPoint); BeanUtils.copyProperties(taskPointDto, taskPoint);
taskPointService.add(taskPoint, authorization); taskPointService.add(taskPoint, authorization);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "1.2.修改任务积分配置(PC)", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.2.修改任务积分配置(PC)", notes = "仅限admin权限用户调用")
@PostMapping("/task/update") @PostMapping("/task/update")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskPoint", value = "任务积分配置", required = true, dataType = "TaskPoint", paramType = "body"), @ApiImplicitParam(name = "taskPoint", value = "任务积分配置", required = true, dataType = "TaskPoint", paramType = "body"),
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")} @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")}
) )
public Result<Void> update( public Result<Void> update(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody TaskPointDto taskPointDto) { @RequestBody TaskPointDto taskPointDto) {
TaskPoint taskPoint = new TaskPoint(); TaskPoint taskPoint = new TaskPoint();
BeanUtils.copyProperties(taskPointDto, taskPoint); BeanUtils.copyProperties(taskPointDto, taskPoint);
taskPointService.update(taskPoint, authorization); taskPointService.update(taskPoint, authorization);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "1.3.批量修改任务积分配置(PC)", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.3.批量修改任务积分配置(PC)", notes = "仅限admin权限用户调用")
@PostMapping("/task/batch/update") @PostMapping("/task/batch/update")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskPoints", value = "任务积分配置", required = true, dataType = "List<TaskPoint>", paramType = "body"), @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")} @ApiImplicitParam(name = "taskPoints", value = "任务积分配置", required = true, dataType = "List<TaskPoint>", paramType = "body")}
) )
public Result<Void> batchUpdate( public Result<Void> batchUpdate(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody List<TaskPointDto> taskPoints) { @RequestBody List<TaskPointDto> taskPoints) {
taskPointService.batchUpdate(taskPoints, authorization); taskPointService.batchUpdate(taskPoints, authorization);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "1.4.批量禁用任务积分配置(PC)", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.4.批量禁用任务积分配置(PC)", notes = "仅限admin权限用户调用")
@PostMapping("/task/batch/disable") @PostMapping("/task/batch/disable")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "任务积分配置id", required = true, dataType = "List<String>", paramType = "body"), @ApiImplicitParam(name = "ids", value = "任务积分配置id", required = true, dataType = "List<String>", paramType = "body"),
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "valid", value = "是否生效 1-生效 2-不生效", required = true, dataType = "Integer", paramType = "query") @ApiImplicitParam(name = "valid", value = "是否生效 1-生效 2-不生效", required = true, dataType = "Integer", paramType = "query")
} }
) )
public Result<Void> batchDisable( public Result<Void> batchDisable(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody List<String> ids, @RequestBody List<String> ids,
@RequestParam Integer valid) { @RequestParam Integer valid) {
taskPointService.batchDisable(ids, authorization, valid); taskPointService.batchDisable(ids, authorization, valid);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "1.5.禁用任务积分配置(PC)", notes = "仅限admin权限用户调用") @ApiOperation(value = "1.5.禁用任务积分配置(PC)", notes = "仅限admin权限用户调用")
@PostMapping("/task/disable") @PostMapping("/task/disable")
@GlobalInterceptor(checkAdminLogin = true) @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "任务积分配置id", required = true, dataType = "String", paramType = "body"), @ApiImplicitParam(name = "id", value = "任务积分配置id", required = true, dataType = "String", paramType = "body"),
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "valid", value = "是否生效 1-生效 2-不生效", required = true, dataType = "Integer", paramType = "query") @ApiImplicitParam(name = "valid", value = "是否生效 1-生效 2-不生效", required = true, dataType = "Integer", paramType = "query")
}) })
public Result<Void> disable( public Result<Void> disable(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestParam String id, @RequestParam String id,
@RequestParam Integer valid) { @RequestParam Integer valid) {
taskPointService.disable(id, authorization, valid); taskPointService.disable(id, authorization, valid);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "1.6. 任务积分列表(PC)", notes = "任务积分列表") @ApiOperation(value = "1.6. 任务积分列表(PC)", notes = "任务积分列表")
@GetMapping("/task/list/{page}/{size}") @GetMapping("/task/list/{page}/{size}")
public Result<PageResult<TaskPoint>> getUnApproveList( public Result<PageResult<TaskPoint>> getUnApproveList(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "页码", required = true) @PathVariable Integer page, @ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
return Result.success(taskPointService.getTaskPointList(page, size)); return Result.success(taskPointService.getTaskPointList(page, size));
} }
@ApiOperation(value = "2.1. 用户根据新手任务获取积分", notes = "仅限app用户调用") @ApiOperation(value = "2.1. 用户根据新手任务获取积分", notes = "仅限app用户调用")
@PostMapping("/log/earn/task/new") @PostMapping("/log/earn/task/new")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "taskPointId", value = "任务积分配置id", required = true, dataType = "String", paramType = "body") @ApiImplicitParam(name = "taskPointId", value = "任务积分配置id", required = true, dataType = "String", paramType = "body")
}) })
public Result<Void> addLogNew( public Result<Void> addLogNew(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody String taskPointId) { @RequestBody String taskPointId) {
userPointLogService.addByTaskNew(taskPointId, authorization); userPointLogService.addByTaskNew(taskPointId, authorization);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "2.2. 用户根据日常任务获取积分", notes = "仅限app用户调用") @ApiOperation(value = "2.2. 用户根据日常任务获取积分", notes = "仅限app用户调用")
@PostMapping("/log/earn/task/daily") @PostMapping("/log/earn/task/daily")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@ApiImplicitParam(name = "taskPointId", value = "任务积分配置id", required = true, dataType = "String", paramType = "body") @ApiImplicitParam(name = "taskPointId", value = "任务积分配置id", required = true, dataType = "String", paramType = "body")
}) })
public Result<Void> addLogDaily( public Result<Void> addLogDaily(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@RequestBody String taskPointId) { @RequestBody String taskPointId) {
userPointLogService.addByTaskDaily(taskPointId, authorization); userPointLogService.addByTaskDaily(taskPointId, authorization);
return Result.success(); return Result.success();
} }
@ApiOperation(value = "2.3.用户积分日志列表(APP&PC)", notes = "用户积分日志列表") @ApiOperation(value = "2.3.用户积分日志列表(APP&PC)", notes = "用户积分日志列表")
@PostMapping("/log/list/{page}/{size}") @PostMapping("/log/list/{page}/{size}")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
public Result<PageResult<UserPointLog>> getUserPointLogList( public Result<PageResult<UserPointLog>> getUserPointLogList(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "查询对象") @RequestBody UserPointLogSearchDto userPointLogSearchDto, @ApiParam(value = "查询对象") @RequestBody UserPointLogSearchDto userPointLogSearchDto,
@ApiParam(value = "页码", required = true) @PathVariable Integer page, @ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
return Result.success( return Result.success(
userPointLogService.getUserPointLogList(token, userPointLogSearchDto, page, size)); userPointLogService.getUserPointLogList(token, userPointLogSearchDto, page, size));
} }
@ApiOperation(value = "2.4.每日签到(APP)", notes = "仅限app用户调用") @ApiOperation(value = "2.4.每日签到(APP)", notes = "仅限app用户调用")
@PostMapping("/log/earn/sign") @PostMapping("/log/earn/sign")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header") @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header")
}) })
public Result<Void> addLogSign(@RequestHeader(value = "Authorization", required = true) String authorization) { public Result<Void> addLogSign(
userPointLogService.dailySign(authorization); @RequestHeader(value = "Authorization", required = true) String authorization) {
return Result.success(); userPointLogService.dailySign(authorization);
} return Result.success();
}
@ApiOperation(value = "2.5.分享期刊(APP)", notes = "仅限app用户调用")
@PostMapping("/log/share/journal") @ApiOperation(value = "2.5.分享期刊(APP)", notes = "仅限app用户调用")
@GlobalInterceptor(checkAppUserLogin = true) @PostMapping("/log/share/journal")
@ApiImplicitParams({ @GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiImplicitParams({
@ApiImplicitParam(name = "journalId", value = "期刊id", required = true, dataType = "String", paramType = "query") @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
}) @ApiImplicitParam(name = "journalId", value = "期刊id", required = true, dataType = "String", paramType = "query")
public Result<Void> addLogShareJournal(@RequestHeader(value = "Authorization", required = true) String authorization, @RequestParam String journalId) { })
userPointLogService.shareJournal(authorization); public Result<Void> addLogShareJournal(
return Result.success(); @RequestHeader(value = "Authorization", required = true) String authorization,
} @RequestParam String journalId) {
userPointLogService.shareJournal(authorization);
return Result.success();
@ApiOperation(value = "3.1.添加抽奖(PC)", notes = "仅限admin权限用户调用") }
@PostMapping("/lottery/add")
@GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiOperation(value = "3.1.添加抽奖(PC)", notes = "仅限admin权限用户调用")
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @PostMapping("/lottery/add")
@ApiImplicitParam(name = "lotteryAddDto", value = "抽奖信息", required = true, dataType = "LotteryAddDto", paramType = "body") @GlobalInterceptor(checkAdminLogin = true)
}) @ApiImplicitParams({
public Result<Void> addLottery(@RequestHeader("Authorization") String token, @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@Validated @RequestBody LotteryAddDto lotteryAddDto) { @ApiImplicitParam(name = "lotteryAddDto", value = "抽奖信息", required = true, dataType = "LotteryAddDto", paramType = "body")
Lottery lottery = new Lottery(); })
BeanUtils.copyProperties(lotteryAddDto, lottery); public Result<Void> addLottery(@RequestHeader("Authorization") String token,
@Validated @RequestBody LotteryAddDto lotteryAddDto) {
lotteryService.add(lottery, token); Lottery lottery = new Lottery();
return Result.success(); BeanUtils.copyProperties(lotteryAddDto, lottery);
}
lotteryService.add(lottery, token);
@ApiOperation(value = "3.2.抽奖列表页(PC)", notes = "admin") return Result.success();
@PostMapping("/lottery/list/{page}/{size}") }
@GlobalInterceptor(checkAdminLogin = true)
public Result<PageResult<Lottery>> lotteryList( @ApiOperation(value = "3.2.抽奖列表页(PC)", notes = "admin")
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @PostMapping("/lottery/list/{page}/{size}")
@ApiParam(value = "查询对象") @RequestBody LotterySearchDto lotterySearchDto, @GlobalInterceptor(checkAdminLogin = true)
@ApiParam(value = "页码", required = true) @PathVariable Integer page, public Result<PageResult<Lottery>> lotteryList(
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
return Result.success(lotteryService.lotteryPageResult(page, size, lotterySearchDto)); @ApiParam(value = "查询对象") @RequestBody LotterySearchDto lotterySearchDto,
} @ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
@ApiOperation(value = "3.3.根据抽奖id获取地区列表(APP)", notes = "仅限app权限用户调用") return Result.success(lotteryService.lotteryPageResult(page, size, lotterySearchDto));
@PostMapping("/lottery/region/list") }
@GlobalInterceptor(checkAppUserLogin = true)
@ApiImplicitParams({ @ApiOperation(value = "3.3.根据抽奖id获取地区列表(APP)", notes = "仅限app权限用户调用")
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @PostMapping("/lottery/region/list")
@ApiImplicitParam(name = "lotteryId", value = "抽奖id", required = true, dataType = "String", paramType = "query") @GlobalInterceptor(checkAppUserLogin = true)
}) @ApiImplicitParams({
public Result<List<LotteryRegion>> getLotteryRegionList( @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@RequestHeader("Authorization") String token, @ApiImplicitParam(name = "lotteryId", value = "抽奖id", required = true, dataType = "String", paramType = "query")
@RequestParam String lotteryId) { })
return Result.success(lotteryService.getLotteryRegionList(lotteryId)); public Result<List<LotteryRegion>> getLotteryRegionList(
} @RequestHeader("Authorization") String token,
@RequestParam String lotteryId) {
@ApiOperation(value = "3.4.编辑抽奖(PC)", notes = "仅限admin权限用户调用") return Result.success(lotteryService.getLotteryRegionList(lotteryId));
@PostMapping("/lottery/edit") }
@GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiOperation(value = "3.4.编辑抽奖(PC)", notes = "仅限admin权限用户调用")
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @PostMapping("/lottery/edit")
@ApiImplicitParam(name = "lotteryUpdateDto", value = "抽奖信息", required = true, dataType = "LotteryUpdateDto", paramType = "body") @GlobalInterceptor(checkAdminLogin = true)
}) @ApiImplicitParams({
public Result<Void> editLottery(@RequestHeader("Authorization") String token, @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@Validated @RequestBody LotteryUpdateDto lotteryUpdateDto) { @ApiImplicitParam(name = "lotteryUpdateDto", value = "抽奖信息", required = true, dataType = "LotteryUpdateDto", paramType = "body")
Lottery lottery = new Lottery(); })
BeanUtils.copyProperties(lotteryUpdateDto, lottery); public Result<Void> editLottery(@RequestHeader("Authorization") String token,
lotteryService.edit(lottery, token); @Validated @RequestBody LotteryUpdateDto lotteryUpdateDto) {
return Result.success(); Lottery lottery = new Lottery();
} BeanUtils.copyProperties(lotteryUpdateDto, lottery);
lotteryService.edit(lottery, token);
@ApiOperation(value = "3.5.发布抽奖(PC)", notes = "仅限admin权限用户调用") return Result.success();
@PostMapping("/lottery/publish") }
@GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiOperation(value = "3.5.发布抽奖(PC)", notes = "仅限admin权限用户调用")
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @PostMapping("/lottery/publish")
@ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query") @GlobalInterceptor(checkAdminLogin = true)
}) @ApiImplicitParams({
public Result<Void> publishLottery(@RequestHeader("Authorization") String token, @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
@RequestParam String id) { @ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query")
lotteryService.publish(id, token); })
return Result.success(); public Result<Void> publishLottery(@RequestHeader("Authorization") String token,
} @RequestParam String id) {
lotteryService.publish(id, token);
@ApiOperation(value = "3.6.停止抽奖(PC)", notes = "仅限admin权限用户调用") return Result.success();
@PostMapping("/lottery/stop") }
@GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParams({ @ApiOperation(value = "3.6.停止抽奖(PC)", notes = "仅限admin权限用户调用")
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @PostMapping("/lottery/stop")
@ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query"), @GlobalInterceptor(checkAdminLogin = true)
@ApiImplicitParam(name = "stopReason", value = "停止原因", required = true, dataType = "String", paramType = "body") @ApiImplicitParams({
}) @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
public Result<Void> stopLottery(@RequestHeader("Authorization") String token, @ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query"),
@NotNull String id, @RequestBody @NotNull String stopReason) { @ApiImplicitParam(name = "stopReason", value = "停止原因", required = true, dataType = "String", paramType = "body")
lotteryService.stop(id, token, stopReason); })
return Result.success(); public Result<Void> stopLottery(@RequestHeader("Authorization") String token,
} @NotNull String id, @RequestBody @NotNull String stopReason) {
lotteryService.stop(id, token, stopReason);
@ApiOperation(value = "3.7.参与抽奖(APP)") return Result.success();
@PostMapping("/lottery/participate") }
@ApiImplicitParams({
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiOperation(value = "3.7.参与抽奖(APP)")
@ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query"), @PostMapping("/lottery/participate")
@ApiImplicitParam(name = "regionId", value = "区域id", required = true, dataType = "Integer", paramType = "query") @ApiImplicitParams({
}) @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
public Result<Void> participate(@RequestHeader("Authorization") String token, @NotNull String id, @NotNull Integer regionId) { @ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query"),
lotteryService.participate(id, token, regionId); @ApiImplicitParam(name = "regionId", value = "区域id", required = true, dataType = "Integer", paramType = "query")
return Result.success(); })
} public Result<Void> participate(@RequestHeader("Authorization") String token, @NotNull String id,
@NotNull Integer regionId) {
@ApiOperation(value = "3.8.自动抽奖结果(PC)", notes = "用这个方法主动触发自动抽奖结果") lotteryService.participate(id, token, regionId);
@PostMapping("/lottery/auto") return Result.success();
@GlobalInterceptor(checkAdminLogin = true) }
@ApiImplicitParams({
@ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"), @ApiOperation(value = "3.8.自动抽奖结果(PC)", notes = "用这个方法主动触发自动抽奖结果")
@ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query") @PostMapping("/lottery/auto")
}) @GlobalInterceptor(checkAdminLogin = true)
public Result<Void> auto(@RequestHeader("Authorization") String token, @NotNull String id) { @ApiImplicitParams({
drawLotteryService.auto(id, token); @ApiImplicitParam(name = "Authorization", value = "token", required = true, dataType = "String", paramType = "header"),
return Result.success(); @ApiImplicitParam(name = "id", value = "抽奖id", required = true, dataType = "String", paramType = "query")
} })
public Result<Void> auto(@RequestHeader("Authorization") String token, @NotNull String id) {
@ApiOperation(value = "3.9.抽奖列表页,以及本人是否已参加(APP)", notes = "APP") drawLotteryService.auto(id, token);
@PostMapping("/lottery/list/user/{page}/{size}") return Result.success();
@GlobalInterceptor(checkAppUserLogin = true) }
public Result<PageResult<Lottery>> findLotteryListForApp(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, @ApiOperation(value = "3.9.抽奖列表页,以及本人是否已参加(APP)", notes = "APP")
@ApiParam(value = "查询对象") @RequestBody LotterySearchDto lotterySearchDto, @PostMapping("/lottery/list/user/{page}/{size}")
@ApiParam(value = "页码", required = true) @PathVariable Integer page, @GlobalInterceptor(checkAppUserLogin = true)
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { public Result<PageResult<Lottery>> findLotteryListForApp(
return Result.success(lotteryService.findLotteryListForApp(page, size, lotterySearchDto, token)); @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
} @ApiParam(value = "查询对象") @RequestBody LotterySearchDto lotterySearchDto,
@ApiParam(value = "页码", required = true) @PathVariable Integer page,
@ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP") @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
@PostMapping("/lottery/participated/{page}/{size}") return Result.success(
@GlobalInterceptor(checkAppUserLogin = true) lotteryService.findLotteryListForApp(page, size, lotterySearchDto, token));
public Result<PageResult<LotteryUser>> findParticipatedLotteryUserList( }
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id") String lotteryId, @ApiOperation(value = "3.10.已参与抽奖的人(APP)", notes = "APP")
@ApiParam(value = "页码", required = true) @PathVariable Integer page, @PostMapping("/lottery/participated/{page}/{size}")
@ApiParam(value = "每页条数", required = true) @PathVariable Integer size) { @GlobalInterceptor(checkAppUserLogin = true)
return Result.success(lotteryService.findPageByLotteryId(page, size, lotteryId)); public Result<PageResult<LotteryUser>> findParticipatedLotteryUserList(
} @ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id") String lotteryId,
@ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP") @ApiParam(value = "页码", required = true) @PathVariable Integer page,
@PostMapping("/lottery/result/{id}") @ApiParam(value = "每页条数", required = true) @PathVariable Integer size) {
@GlobalInterceptor(checkAppUserLogin = true) return Result.success(lotteryService.findPageByLotteryId(page, size, lotteryId));
public Result<Integer> findLotteryResult(@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token, }
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
return Result.success(lotteryService.getLotteryUserResult(id, token)); @ApiOperation(value = "3.11.抽奖结果(APP)", notes = "APP")
} @PostMapping("/lottery/result/{id}")
@GlobalInterceptor(checkAppUserLogin = true)
public Result<Integer> findLotteryResult(
@ApiParam(value = "Header中的token信息", required = true) @RequestHeader("Authorization") String token,
@ApiParam(value = "抽奖id", required = true) @PathVariable String id) {
return Result.success(lotteryService.getLotteryUserResult(id, token));
}
} }

@ -2,6 +2,7 @@ package com.luoo.user.pojo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -32,7 +33,7 @@ import org.springframework.format.annotation.DateTimeFormat;
@DynamicUpdate @DynamicUpdate
@Table(name = "tb_task_point") @Table(name = "tb_task_point")
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)
public class TaskPoint { public class TaskPoint implements Serializable {
@Id @Id
@Size(max = 20) @Size(max = 20)

@ -19,3 +19,7 @@ alter table tb_user_info
alter table tb_user_info alter table tb_user_info
add enable_chat int null comment '是否允许私信 0为关闭 1为启用 默认启用'; add enable_chat int null comment '是否允许私信 0为关闭 1为启用 默认启用';
alter table tb_lottery_user
modify region_id int null comment '地区id';

Loading…
Cancel
Save