|
@@ -46,8 +46,8 @@ public class AdminController {
|
|
|
// 用户管理
|
|
// 用户管理
|
|
|
@PostMapping("/users")
|
|
@PostMapping("/users")
|
|
|
public Result<Page<User>> getUsers(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<User>> getUsers(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
Page<User> pageParam = new Page<>(page, size);
|
|
Page<User> pageParam = new Page<>(page, size);
|
|
|
Page<User> result = userMapper.selectPage(pageParam, null);
|
|
Page<User> result = userMapper.selectPage(pageParam, null);
|
|
|
return Result.success(result);
|
|
return Result.success(result);
|
|
@@ -117,8 +117,8 @@ public class AdminController {
|
|
|
// 孩子管理
|
|
// 孩子管理
|
|
|
@PostMapping("/children")
|
|
@PostMapping("/children")
|
|
|
public Result<Page<Child>> getChildren(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<Child>> getChildren(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
Page<Child> pageParam = new Page<>(page, size);
|
|
Page<Child> pageParam = new Page<>(page, size);
|
|
|
Page<Child> result = childMapper.selectPage(pageParam, null);
|
|
Page<Child> result = childMapper.selectPage(pageParam, null);
|
|
|
return Result.success(result);
|
|
return Result.success(result);
|
|
@@ -140,7 +140,7 @@ public class AdminController {
|
|
|
public Result<Map<String, Object>> adjustPoints(
|
|
public Result<Map<String, Object>> adjustPoints(
|
|
|
@PathVariable Long id,
|
|
@PathVariable Long id,
|
|
|
@RequestBody Map<String, Object> params) {
|
|
@RequestBody Map<String, Object> params) {
|
|
|
- Integer amount = (Integer) params.get("amount");
|
|
|
|
|
|
|
+ Integer amount = params.get("amount") != null ? ((Number) params.get("amount")).intValue() : 0;
|
|
|
String reason = (String) params.get("reason");
|
|
String reason = (String) params.get("reason");
|
|
|
|
|
|
|
|
Child child = childMapper.selectById(id);
|
|
Child child = childMapper.selectById(id);
|
|
@@ -174,8 +174,8 @@ public class AdminController {
|
|
|
// 任务管理
|
|
// 任务管理
|
|
|
@PostMapping("/tasks")
|
|
@PostMapping("/tasks")
|
|
|
public Result<Page<Task>> getTasks(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<Task>> getTasks(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
String status = (String) params.get("status");
|
|
String status = (String) params.get("status");
|
|
|
Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
|
|
Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
|
|
|
|
|
|
|
@@ -209,8 +209,8 @@ public class AdminController {
|
|
|
// 奖励管理
|
|
// 奖励管理
|
|
|
@PostMapping("/rewards")
|
|
@PostMapping("/rewards")
|
|
|
public Result<Page<Reward>> getRewards(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<Reward>> getRewards(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
String status = (String) params.get("status");
|
|
String status = (String) params.get("status");
|
|
|
Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
|
|
Long familyId = params.get("familyId") != null ? ((Number) params.get("familyId")).longValue() : null;
|
|
|
|
|
|
|
@@ -335,7 +335,7 @@ public class AdminController {
|
|
|
// 安全解析page
|
|
// 安全解析page
|
|
|
if (params.get("page") != null) {
|
|
if (params.get("page") != null) {
|
|
|
if (params.get("page") instanceof Integer) {
|
|
if (params.get("page") instanceof Integer) {
|
|
|
- page = (Integer) params.get("page");
|
|
|
|
|
|
|
+ page = ((Number) params.get("page")).intValue();
|
|
|
} else if (params.get("page") instanceof Number) {
|
|
} else if (params.get("page") instanceof Number) {
|
|
|
page = ((Number) params.get("page")).intValue();
|
|
page = ((Number) params.get("page")).intValue();
|
|
|
} else {
|
|
} else {
|
|
@@ -346,7 +346,7 @@ public class AdminController {
|
|
|
// 安全解析size
|
|
// 安全解析size
|
|
|
if (params.get("size") != null) {
|
|
if (params.get("size") != null) {
|
|
|
if (params.get("size") instanceof Integer) {
|
|
if (params.get("size") instanceof Integer) {
|
|
|
- size = (Integer) params.get("size");
|
|
|
|
|
|
|
+ size = ((Number) params.get("size")).intValue();
|
|
|
} else if (params.get("size") instanceof Number) {
|
|
} else if (params.get("size") instanceof Number) {
|
|
|
size = ((Number) params.get("size")).intValue();
|
|
size = ((Number) params.get("size")).intValue();
|
|
|
} else {
|
|
} else {
|
|
@@ -392,8 +392,8 @@ public class AdminController {
|
|
|
// 家庭管理
|
|
// 家庭管理
|
|
|
@PostMapping("/families")
|
|
@PostMapping("/families")
|
|
|
public Result<Page<Family>> getFamilies(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<Family>> getFamilies(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
String name = (String) params.get("name");
|
|
String name = (String) params.get("name");
|
|
|
|
|
|
|
|
Page<Family> pageParam = new Page<>(page, size);
|
|
Page<Family> pageParam = new Page<>(page, size);
|
|
@@ -453,11 +453,11 @@ public class AdminController {
|
|
|
// 任务模板管理
|
|
// 任务模板管理
|
|
|
@PostMapping("/task-templates")
|
|
@PostMapping("/task-templates")
|
|
|
public Result<Page<TaskTemplate>> getTaskTemplates(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<TaskTemplate>> getTaskTemplates(@RequestBody Map<String, Object> params) {
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
String category = (String) params.get("category");
|
|
String category = (String) params.get("category");
|
|
|
String difficulty = (String) params.get("difficulty");
|
|
String difficulty = (String) params.get("difficulty");
|
|
|
- Integer isActive = params.get("isActive") != null ? (Integer) params.get("isActive") : null;
|
|
|
|
|
|
|
+ Integer isActive = params.get("isActive") != null ? ((Number) params.get("isActive")).intValue() : null;
|
|
|
|
|
|
|
|
Page<TaskTemplate> pageParam = new Page<>(page, size);
|
|
Page<TaskTemplate> pageParam = new Page<>(page, size);
|
|
|
LambdaQueryWrapper<TaskTemplate> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<TaskTemplate> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -514,8 +514,8 @@ public class AdminController {
|
|
|
@PostMapping("/guide/applications")
|
|
@PostMapping("/guide/applications")
|
|
|
public Result<Page<User>> getGuideApplications(@RequestBody Map<String, Object> params) {
|
|
public Result<Page<User>> getGuideApplications(@RequestBody Map<String, Object> params) {
|
|
|
String status = params.get("status") != null ? (String) params.get("status") : "pending";
|
|
String status = params.get("status") != null ? (String) params.get("status") : "pending";
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
|
|
|
|
|
Page<User> pageParam = new Page<>(page, size);
|
|
Page<User> pageParam = new Page<>(page, size);
|
|
|
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<User>()
|
|
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<User>()
|
|
@@ -676,8 +676,8 @@ public class AdminController {
|
|
|
return Result.error("无权限查看该家庭的任务");
|
|
return Result.error("无权限查看该家庭的任务");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
|
|
|
|
|
Page<Task> pageParam = new Page<>(page, size);
|
|
Page<Task> pageParam = new Page<>(page, size);
|
|
|
Page<Task> result = taskMapper.selectPage(pageParam, new LambdaQueryWrapper<Task>()
|
|
Page<Task> result = taskMapper.selectPage(pageParam, new LambdaQueryWrapper<Task>()
|
|
@@ -703,8 +703,8 @@ public class AdminController {
|
|
|
return Result.error("无权限查看该家庭的奖励");
|
|
return Result.error("无权限查看该家庭的奖励");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int page = params.get("page") != null ? (Integer) params.get("page") : 1;
|
|
|
|
|
- int size = params.get("size") != null ? (Integer) params.get("size") : 10;
|
|
|
|
|
|
|
+ int page = params.get("page") != null ? ((Number) params.get("page")).intValue() : 1;
|
|
|
|
|
+ int size = params.get("size") != null ? ((Number) params.get("size")).intValue() : 10;
|
|
|
|
|
|
|
|
Page<Reward> pageParam = new Page<>(page, size);
|
|
Page<Reward> pageParam = new Page<>(page, size);
|
|
|
Page<Reward> result = rewardMapper.selectPage(pageParam, new LambdaQueryWrapper<Reward>()
|
|
Page<Reward> result = rewardMapper.selectPage(pageParam, new LambdaQueryWrapper<Reward>()
|