|
|
@ -1,5 +1,9 @@ |
|
|
package com.youlai.boot.mini.controller; |
|
|
package com.youlai.boot.mini.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.youlai.boot.common.annotation.Log; |
|
|
|
|
|
import com.youlai.boot.common.annotation.RepeatSubmit; |
|
|
|
|
|
import com.youlai.boot.common.enums.ActionTypeEnum; |
|
|
|
|
|
import com.youlai.boot.common.enums.LogModuleEnum; |
|
|
import com.youlai.boot.common.result.PageResult; |
|
|
import com.youlai.boot.common.result.PageResult; |
|
|
import com.youlai.boot.common.result.Result; |
|
|
import com.youlai.boot.common.result.Result; |
|
|
import com.youlai.boot.framework.security.util.SecurityUtils; |
|
|
import com.youlai.boot.framework.security.util.SecurityUtils; |
|
|
@ -26,12 +30,12 @@ import org.springframework.web.bind.annotation.*; |
|
|
public class PointController { |
|
|
public class PointController { |
|
|
|
|
|
|
|
|
private final MiniPointAccountService pointAccountService; |
|
|
private final MiniPointAccountService pointAccountService; |
|
|
private final MiniPointRuleService pointRuleService; |
|
|
|
|
|
private final MiniPointRecordService pointRecordService; |
|
|
private final MiniPointRecordService pointRecordService; |
|
|
private final MiniSignService signService; |
|
|
private final MiniSignService signService; |
|
|
|
|
|
|
|
|
@Operation(summary = "查询当前用户的积分账户信息") |
|
|
@Operation(summary = "查询当前用户的积分账户信息") |
|
|
@GetMapping("/my") |
|
|
@GetMapping("/my") |
|
|
|
|
|
@Log(module = LogModuleEnum.POINT_ACCOUNT, value = ActionTypeEnum.LIST) |
|
|
public Result<MyPointVO> getMyPoint() { |
|
|
public Result<MyPointVO> getMyPoint() { |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
MyPointVO myPoint = pointAccountService.getUserPoint(userId); |
|
|
MyPointVO myPoint = pointAccountService.getUserPoint(userId); |
|
|
@ -40,6 +44,7 @@ public class PointController { |
|
|
|
|
|
|
|
|
@Operation(summary = "分页查询当前用户的积分流水列表") |
|
|
@Operation(summary = "分页查询当前用户的积分流水列表") |
|
|
@GetMapping("/records") |
|
|
@GetMapping("/records") |
|
|
|
|
|
@Log(module = LogModuleEnum.POINT_RECORD, value = ActionTypeEnum.LIST) |
|
|
public PageResult<MyPointRecordVO> getMyPointRecords(@ParameterObject MyPointRecordQuery query) { |
|
|
public PageResult<MyPointRecordVO> getMyPointRecords(@ParameterObject MyPointRecordQuery query) { |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
return PageResult.success(pointRecordService.pageMyPointRecord(userId, query)); |
|
|
return PageResult.success(pointRecordService.pageMyPointRecord(userId, query)); |
|
|
@ -47,18 +52,22 @@ public class PointController { |
|
|
|
|
|
|
|
|
@Operation(summary = "用户签到") |
|
|
@Operation(summary = "用户签到") |
|
|
@PostMapping("/sign") |
|
|
@PostMapping("/sign") |
|
|
|
|
|
@RepeatSubmit |
|
|
|
|
|
@Log(module = LogModuleEnum.SIGN_RECORD, value = ActionTypeEnum.INSERT) |
|
|
public Result<SignResultVO> sign() { |
|
|
public Result<SignResultVO> sign() { |
|
|
return Result.success(signService.sign()); |
|
|
return Result.success(signService.sign()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Operation(summary = "查询用户签到状态/当月签到日历") |
|
|
@Operation(summary = "查询用户签到状态/当月签到日历") |
|
|
@GetMapping("/sign/status") |
|
|
@GetMapping("/sign/status") |
|
|
|
|
|
@Log(module = LogModuleEnum.SIGN_RECORD, value = ActionTypeEnum.LIST) |
|
|
public Result<SignStatusVO> getSignStatus() { |
|
|
public Result<SignStatusVO> getSignStatus() { |
|
|
return Result.success(signService.getSignStatus()); |
|
|
return Result.success(signService.getSignStatus()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Operation(summary = "用户分享领取奖励") |
|
|
@Operation(summary = "用户分享领取奖励") |
|
|
@PostMapping("/share/reward") |
|
|
@PostMapping("/share/reward") |
|
|
|
|
|
@Log(module = LogModuleEnum.OTHER, value = ActionTypeEnum.OTHER) |
|
|
public Result<Integer> shareReward() { |
|
|
public Result<Integer> shareReward() { |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Integer point = pointRecordService.giveShareReward(userId); |
|
|
Integer point = pointRecordService.giveShareReward(userId); |
|
|
@ -67,6 +76,7 @@ public class PointController { |
|
|
|
|
|
|
|
|
@Operation(summary = "登记流浪动物领取积分") |
|
|
@Operation(summary = "登记流浪动物领取积分") |
|
|
@PostMapping("/register-animal/reward") |
|
|
@PostMapping("/register-animal/reward") |
|
|
|
|
|
@Log(module = LogModuleEnum.OTHER, value = ActionTypeEnum.OTHER) |
|
|
public Result<Integer> registerAnimalReward( |
|
|
public Result<Integer> registerAnimalReward( |
|
|
@Parameter(description = "登记的流浪动物ID", required = true) @RequestParam Long animalId) { |
|
|
@Parameter(description = "登记的流浪动物ID", required = true) @RequestParam Long animalId) { |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
@ -76,6 +86,7 @@ public class PointController { |
|
|
|
|
|
|
|
|
@Operation(summary = "AI生成扣除积分") |
|
|
@Operation(summary = "AI生成扣除积分") |
|
|
@PostMapping("/ai-generate/deduct") |
|
|
@PostMapping("/ai-generate/deduct") |
|
|
|
|
|
@Log(module = LogModuleEnum.OTHER, value = ActionTypeEnum.OTHER) |
|
|
public Result<Integer> aiGenerateImageDeduct( |
|
|
public Result<Integer> aiGenerateImageDeduct( |
|
|
@Parameter(description = "AI生成任务唯一ID(用于幂等)", required = true) @RequestParam String taskId) { |
|
|
@Parameter(description = "AI生成任务唯一ID(用于幂等)", required = true) @RequestParam String taskId) { |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
Long userId = SecurityUtils.getUserId(); |
|
|
|