重构
This commit is contained in:
1 parent
dc23ea53ed
commit
8c7a9040d2
106 files changed
+5668
-9910
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.babytracker.module.summary;
|
||||
|
||||
import com.babytracker.common.response.ApiResponse;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/summary")
|
||||
public class SummaryController {
|
||||
private final SummaryService summaryService;
|
||||
|
||||
public SummaryController(SummaryService summaryService) {
|
||||
this.summaryService = summaryService;
|
||||
}
|
||||
|
||||
@GetMapping("/daily")
|
||||
public ApiResponse<DailySummary> daily(
|
||||
@RequestParam String babyId,
|
||||
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date
|
||||
) {
|
||||
return ApiResponse.ok(summaryService.daily(babyId, date));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user