|
|
@@ -39,7 +39,7 @@ public class FinanceCheckinController {
|
|
|
@PostMapping("/stats")
|
|
|
public Result<Map<String, Object>> stats(
|
|
|
@RequestBody Map<String, Object> params,
|
|
|
- @RequestAttribute("userId") Long userId) {
|
|
|
+ @RequestAttribute(value = "userId", required = false) Long userId) {
|
|
|
Long childId = params.get("childId") != null
|
|
|
? Long.valueOf(params.get("childId").toString()) : null;
|
|
|
Map<String, Object> stats = financeCheckinService.getCheckinStats(userId, childId);
|
|
|
@@ -50,7 +50,10 @@ public class FinanceCheckinController {
|
|
|
@PostMapping("/create")
|
|
|
public Result<FinanceCheckin> create(
|
|
|
@RequestBody FinanceCheckin checkin,
|
|
|
- @RequestAttribute("userId") Long userId) {
|
|
|
+ @RequestAttribute(value = "userId", required = false) Long userId) {
|
|
|
+ if (checkin.getCheckinType() == null || checkin.getCheckinType().trim().isEmpty()) {
|
|
|
+ return Result.error("checkinType不能为空");
|
|
|
+ }
|
|
|
checkin.setUserId(userId);
|
|
|
FinanceCheckin created = financeCheckinService.createCheckin(checkin);
|
|
|
return Result.success(created);
|