|
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
@Tag(name = "家长心愿单管理")
|
|
@Tag(name = "家长心愿单管理")
|
|
|
@RestController
|
|
@RestController
|
|
@@ -33,7 +34,7 @@ public class RewardWishlistController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取我的心愿单")
|
|
@Operation(summary = "获取我的心愿单")
|
|
|
- @GetMapping
|
|
|
|
|
|
|
+ @GetMapping("/my")
|
|
|
public Result<List<RewardWishlist>> getMyWishlist(@RequestAttribute("userId") Long userId) {
|
|
public Result<List<RewardWishlist>> getMyWishlist(@RequestAttribute("userId") Long userId) {
|
|
|
List<RewardWishlist> list = rewardWishlistService.getByUserId(userId);
|
|
List<RewardWishlist> list = rewardWishlistService.getByUserId(userId);
|
|
|
return Result.success(list);
|
|
return Result.success(list);
|
|
@@ -61,7 +62,8 @@ public class RewardWishlistController {
|
|
|
@Operation(summary = "审核心愿")
|
|
@Operation(summary = "审核心愿")
|
|
|
@PostMapping("/{id}/approve")
|
|
@PostMapping("/{id}/approve")
|
|
|
public Result<Boolean> approve(@PathVariable Long id,
|
|
public Result<Boolean> approve(@PathVariable Long id,
|
|
|
- @RequestParam boolean approved) {
|
|
|
|
|
|
|
+ @RequestBody Map<String, Boolean> body) {
|
|
|
|
|
+ boolean approved = body.get("approved");
|
|
|
boolean success = rewardWishlistService.approve(id, approved);
|
|
boolean success = rewardWishlistService.approve(id, approved);
|
|
|
return Result.success(success);
|
|
return Result.success(success);
|
|
|
}
|
|
}
|