package Ġbr . com . ox ent . sf arma . resource Ċ Ċ import Ġbr . com . ox ent . sf arma . model . entity . Set or Ċ import Ġbr . com . ox ent . sf arma . model . service . Set or Service Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġjava . security . Principal Ċ import Ġjavax . validation . Valid ĊĊ Ċ @ RestController Ċ @ RequestMapping ("/ api / seto res ") Ċ class ĠSet or Resource Ġ@ Autowired Ċ constructor ( private Ġval Ġset or Service : ĠSet or Service ) Ġ{ ĊĊĠĠĠ Ġ@ GetMapping ĊĠĠĠ Ġfun ĠgetList () Ġ= ĠResponseEntity . ok ( set or Service . getList ()) ĊĊĠĠĠ Ġ@ GetMapping ("/ dependent es ") ĊĠĠĠ Ġfun ĠgetList Usuario ( principal : ĠPrincipal ) Ġ= ĠResponseEntity . ok ( set or Service . getList Usuario ( principal . name )) ĊĊĠĠĠ Ġ@ GetMapping ("/ org ano gram a ") ĊĠĠĠ Ġfun Ġget Org ano gram a () Ġ= ĠResponseEntity . ok ( set or Service . get Org ano gram a ()) ĊĊĠĠĠ Ġ@ GetMapping ("/ { id }") ĊĠĠĠ Ġfun Ġget (@ PathVariable Ġid : ĠInt ) Ġ= ĠResponseEntity . status ( HttpStatus . OK ). body ( set or Service . get ( id )) ĊĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġfun Ġset Set or (@ Valid Ġ@ RequestBody Ġset or : ĠSet or ): ĠResponseEntity < Set or > Ġ{ ĊĠĠĠĠĠĠĠ Ġset or Service . set ( set or ) ĊĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok < Set or >( set or ) ĊĠĠĠ Ġ} ĊĊ Ċ }