Skip to content

Commit

Permalink
feat: (#231) 남은 연차 개수 API
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Dec 20, 2022
1 parent 93dcb9b commit 7b9f29b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import org.springframework.web.bind.annotation.RestController
import team.comit.simtong.domain.holiday.dto.QueryIndividualHolidaysResponse
import team.comit.simtong.domain.holiday.dto.request.AppointAnnualWebRequest
import team.comit.simtong.domain.holiday.dto.request.AppointHolidayWebRequest
import team.comit.simtong.domain.holiday.dto.response.RemainAnnualWebResponse
import team.comit.simtong.domain.holiday.usecase.AppointAnnualUseCase
import team.comit.simtong.domain.holiday.usecase.AppointHolidayUseCase
import team.comit.simtong.domain.holiday.usecase.CancelHolidayUseCase
import team.comit.simtong.domain.holiday.usecase.QueryIndividualHolidayUseCase
import team.comit.simtong.domain.holiday.usecase.RemainAnnualUseCase
import java.time.LocalDate

/**
Expand All @@ -29,12 +31,20 @@ import java.time.LocalDate
@RestController
@RequestMapping("/holidays")
class WebHolidayAdapter(
private val remainAnnualUseCase: RemainAnnualUseCase,
private val appointAnnualUseCase: AppointAnnualUseCase,
private val appointHolidayUseCase: AppointHolidayUseCase,
private val cancelHolidayUseCase: CancelHolidayUseCase,
private val queryIndividualHolidayUseCase: QueryIndividualHolidayUseCase
) {

@GetMapping("/annual/count")
fun remainAnnual(@RequestParam year: Int) : RemainAnnualWebResponse {
return RemainAnnualWebResponse(
remainAnnualUseCase.execute(year)
)
}

@PostMapping("/annual")
@ResponseStatus(HttpStatus.CREATED)
fun appointAnnual(@RequestBody request: AppointAnnualWebRequest) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package team.comit.simtong.domain.holiday.dto.response

/**
*
* 남은 연차 개수를 전송하는 RemainAnnualWebResponse
*
* @author Chokyunghyeon
* @date 2022/12/20
* @version 1.0.0
**/
data class RemainAnnualWebResponse(
val result: Long
)

0 comments on commit 7b9f29b

Please sign in to comment.