package Ġcom . s achin r ana . nag p . eb ro ker . e Broker . controller Ċ Ċ import Ġcom . s achin r ana . nag p . eb ro ker . e Broker . dto . Equ ity Dto Ċ import Ġcom . s achin r ana . nag p . eb ro ker . e Broker . service . Equ ity Service Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġjavax . validation . Valid Ċ Ċ @ RestController Ċ @ RequestMapping ("/ equ ity ") Ċ class ĠEqu ity Controller Ġ@ Autowired Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġequ ity Service : ĠEqu ity Service Ċ ) Ġ{ ĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġfun Ġsave Equ ity ( ĊĠĠĠĠĠĠĠ Ġ@ Valid Ġ@ RequestBody Ġequ ity Dto : ĠEqu ity Dto ĊĠĠĠ Ġ): ĠResponseEntity < Long > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( equ ity Service . add Equ ity ( equ ity Dto )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ { id }") ĊĠĠĠ Ġfun Ġget Equ ity (@ PathVariable Ġid : ĠLong ): ĠResponseEntity < Equ ity Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( equ ity Service . get Equ ity ( id )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ĊĠĠĠ Ġfun ĠgetAll Equ ity (): ĠResponseEntity < List < Equ ity Dto >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( equ ity Service . getAll Equ ity ()) ĊĠĠĠ Ġ} Ċ Ċ }