package Ġru . work log . api . v 1 Ċ Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġru . work log . services . Mapper Ċ import Ġru . work log . services . Time Entries Service Ċ import Ġru . work log . shared . Time Entry Dto Ċ import Ġjava . time . LocalDate Ċ Ċ @ RestController Ċ @ RequestMapping ("/ api / v 1 / time _ entries ") Ċ class ĠTime Entries Controller ( private Ġval Ġtime Entries Service : ĠTime Entries Service ) Ġ{ ĊĊĠĠĠ Ġ@ PostMapping ("/ save ") ĊĠĠĠ Ġfun Ġstart (@ RequestBody Ġtime Entry Dto : ĠTime Entry Dto ): ĠTime Entry Dto Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMapper . time Entry To Dto ( time Entries Service . save OrUpdate ( time Entry Dto )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Delete Mapping ("/ delete ") ĊĠĠĠ Ġfun Ġdelete (@ RequestParam (" entry ID ") Ġentry ID : ĠLong ): ĠTime Entry Dto Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠMapper . time Entry To Dto ( time Entries Service . delete Time Entry ( entry ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ get /{ date }") ĊĠĠĠ Ġfun Ġget Entries By Date (@ PathVariable (" date ") Ġdate String : ĠString ): ĠList < Time Entry Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdate Ġ= ĠLocalDate . parse ( date String ) ĊĠĠĠĠĠĠĠ Ġval Ġentries By Date Ġ= Ġtime Entries Service . get Entries By Date ( date ) ĊĠĠĠĠĠĠĠ Ġreturn Ġentries By Date . map Ġ{ ĠMapper . time Entry To Dto ( it ) Ġ} ĊĠĠĠ Ġ} Ċ }