|
@@ -7,6 +7,7 @@ import com.backendsys.modules.common.config.security.utils.SecurityUtil;
|
|
import com.backendsys.modules.common.utils.Result;
|
|
import com.backendsys.modules.common.utils.Result;
|
|
import com.backendsys.modules.system.dao.SysUserDao;
|
|
import com.backendsys.modules.system.dao.SysUserDao;
|
|
import com.backendsys.modules.system.entity.SysUser;
|
|
import com.backendsys.modules.system.entity.SysUser;
|
|
|
|
+import com.backendsys.modules.system.entity.SysUserIntegral;
|
|
import com.backendsys.modules.system.entity.SysUserIntegralLog;
|
|
import com.backendsys.modules.system.entity.SysUserIntegralLog;
|
|
import com.backendsys.modules.system.service.SysUserIntegralLogService;
|
|
import com.backendsys.modules.system.service.SysUserIntegralLogService;
|
|
import com.backendsys.modules.system.service.SysUserIntegralService;
|
|
import com.backendsys.modules.system.service.SysUserIntegralService;
|
|
@@ -15,8 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -36,16 +36,20 @@ public class SysUserIntegralController {
|
|
@SysLog("增加系统用户积分")
|
|
@SysLog("增加系统用户积分")
|
|
@Operation(summary = "增加系统用户积分")
|
|
@Operation(summary = "增加系统用户积分")
|
|
@PreAuthorize("@sr.hasPermission('3.3.1')")
|
|
@PreAuthorize("@sr.hasPermission('3.3.1')")
|
|
- @GetMapping("/api/system/user/increaseUserIntegral")
|
|
|
|
- public Result increaseUserIntegral(Long user_id, Integer integral) {
|
|
|
|
|
|
+ @PutMapping("/api/system/user/increaseUserIntegral")
|
|
|
|
+ public Result increaseUserIntegral(@Validated(SysUserIntegral.Increase.class) @RequestBody SysUserIntegral sysUserIntegral) {
|
|
|
|
+ Long user_id = sysUserIntegral.getUser_id();
|
|
|
|
+ Integer integral = sysUserIntegral.getIntegral();
|
|
return Result.success().put("data", sysUserIntegralService.increase(user_id, integral));
|
|
return Result.success().put("data", sysUserIntegralService.increase(user_id, integral));
|
|
}
|
|
}
|
|
|
|
|
|
@SysLog("减少系统用户积分")
|
|
@SysLog("减少系统用户积分")
|
|
@Operation(summary = "减少系统用户积分")
|
|
@Operation(summary = "减少系统用户积分")
|
|
@PreAuthorize("@sr.hasPermission('3.3.2')")
|
|
@PreAuthorize("@sr.hasPermission('3.3.2')")
|
|
- @GetMapping("/api/system/user/decreaseUserIntegral")
|
|
|
|
- public Result decreaseUserIntegral(Long user_id, Integer integral) {
|
|
|
|
|
|
+ @PutMapping("/api/system/user/decreaseUserIntegral")
|
|
|
|
+ public Result decreaseUserIntegral(@Validated(SysUserIntegral.Decrease.class) @RequestBody SysUserIntegral sysUserIntegral) {
|
|
|
|
+ Long user_id = sysUserIntegral.getUser_id();
|
|
|
|
+ Integer integral = sysUserIntegral.getIntegral();
|
|
return Result.success().put("data", sysUserIntegralService.decrease(user_id, integral));
|
|
return Result.success().put("data", sysUserIntegralService.decrease(user_id, integral));
|
|
}
|
|
}
|
|
|
|
|