package Ġcom . pre j ade . kt admin . rest . sys Ċ Ċ import Ġcom . pre j ade . kt admin . annotation . Log Ċ import Ġcom . pre j ade . kt admin . common . Http Result Ċ import Ġcom . pre j ade . kt admin . modules . sys . model . Add Permission Ċ import Ġcom . pre j ade . kt admin . modules . sys . service . Sys Permission Service Ċ import Ġio . swagger . annotations . ApiOperation Ċ import Ġorg . springframework . security . access . pre post . Pre Authorize Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ ApiOperation (" æĿĥéĻĲ ") Ċ @ RestController Ċ @ RequestMapping (" sys / permission ") Ċ class ĠSys Permission Rest ( val Ġservice : ĠSys Permission Service ) Ġ{ ĊĠĠĠ Ġ@ Log (" æĸ°å¢ŀ æĿĥéĻĲ ") ĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : edit ') ") ĊĠĠĠ Ġ@ PostMapping ĊĠĠĠ Ġfun Ġsave (@ RequestBody Ġadd Permission : ĠAdd Permission ): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok ( service . add ( add Permission )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Log (" ç¼ĸè¾ĳ æĿĥéĻĲ ") ĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : edit ') ") ĊĠĠĠ Ġ@ PostMapping ("{ id }") ĊĠĠĠ Ġfun Ġup d (@ PathVariable Ġid : ĠInt , Ġ@ RequestBody Ġup d : ĠAdd Permission ): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġservice . upd ( id , Ġup d ) ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : view ') ") ĊĠĠĠ Ġ@ GetMapping (" tree ") ĊĠĠĠ Ġfun Ġtree (): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok ( service . tree ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : edit ') ") ĊĠĠĠ Ġ@ GetMapping ("{ id }") ĊĠĠĠ Ġfun Ġget (@ PathVariable Ġid : ĠInt ): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok ( service . getModel ( id )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : edit ') ") ĊĠĠĠ Ġ@ GetMapping (" find ByName ") ĊĠĠĠ Ġfun Ġfind ByName ( name : ĠString ): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok ( service . find Model ByName ( name )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Log (" åĪłéĻ¤ æĿĥéĻĲ ") ĊĠĠĠ Ġ@ Pre Authorize ("@ ss . has Permission (' sys : permission : edit ') ") ĊĠĠĠ Ġ@ Delete Mapping ("{ id }") ĊĠĠĠ Ġfun Ġdelete (@ PathVariable Ġid : ĠInt ): ĠHttp Result Ġ{ ĊĠĠĠĠĠĠĠ Ġservice . del ( id ) ĊĠĠĠĠĠĠĠ Ġreturn ĠHttp Result . ok () ĊĠĠĠ Ġ} Ċ } Ċ