Skip to content

Commit

Permalink
refactor : separate fetch APi method
Browse files Browse the repository at this point in the history
  • Loading branch information
oU-Ua committed Dec 19, 2023
1 parent 3d865c7 commit b232f47
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import mvc.promiseme.calendar.dto.CalendarAndTodoAllByRoleDto;
import mvc.promiseme.calendar.dto.CalendarResponseDTO;
import mvc.promiseme.calendar.service.CalendarService;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
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;
import java.time.format.DateTimeFormatter;
import java.util.List;

@Slf4j
@RestController
@Controller
@RequiredArgsConstructor
@RequestMapping("/calendar")
public class CalendarController {
Expand All @@ -25,4 +29,13 @@ public class CalendarController {
//
// }

}
@GetMapping("/todoAll")
public ResponseEntity<List<CalendarAndTodoAllByRoleDto>> calendarTodoAll(
@RequestParam(name = "projectId") Long projectId
, @RequestParam(name = "todoDate") String todoDate){
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate localDate = LocalDate.parse(todoDate, formatter);
return ResponseEntity.ok(calendarService.calendarAndtodoAll(projectId, localDate));
}

}

0 comments on commit b232f47

Please sign in to comment.