package Ġcom . al uc ard lock on . jk rest boot . modules . system . account . controller Ċ Ċ import Ġcom . al uc ard lock on . jk rest boot . base . api . Api Result Ċ import Ġcom . al uc ard lock on . jk rest boot . modules . system . account . entity . Account Ċ import Ġcom . al uc ard lock on . jk rest boot . modules . system . account . service . impl . Account Service Ċ import Ġcom . baomidou . mybatisplus . extension . plugins . pagination . Page Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . security . crypto . password . Password Encoder Ċ import Ġorg . springframework . web . bind . annotation .* Ċ Ċ @ RestController Ċ @ RequestMapping ("/ account ") Ċ class ĠAccount Controller Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġservice : ĠAccount Service ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġpassword Encoder : ĠPassword Encoder ĊĊĠĠĠ Ġ@ GetMapping ("/") ĊĠĠĠ Ġfun Ġlist ( page : ĠPage < Account >): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . getById ( 1 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ { id }") ĊĠĠĠ Ġfun Ġget (@ PathVariable Ġid : ĠInt ): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . getById ( id )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ("/") ĊĠĠĠ Ġfun Ġpost (@ RequestBody Ġaccount : ĠAccount ): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġaccount . password Ġ= Ġpassword Encoder . encode ( account . password ) ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . save ( account )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Put Mapping ("/ { id }") ĊĠĠĠ Ġfun Ġput (@ PathVariable Ġid : ĠInt ,@ RequestBody Ġaccount : ĠAccount ): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġaccount . id Ġ= Ġid ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . update ById ( account )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Delete Mapping ("/ { id }") ĊĠĠĠ Ġfun Ġdelete (@ PathVariable Ġid : ĠInt ): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . remove ById ( id )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/* ĊĠĠĠ Ġ@ PostMapping ("/ login ") ĊĠĠĠ Ġfun Ġlogin (@ RequestBody Ġaccount : ĠAccount ): ĠApi Result Ġ{ ĊĠĠĠĠĠĠĠ Ġprintln ( BC rypt Password Encoder (). encode ( account . password )) ĊĠĠĠĠĠĠĠ Ġreturn ĠApi Result ( service . getOne ( Query Wrapper < Account >( Account ( username Ġ= Ġaccount . username , password Ġ= ĠBC rypt Password Encoder (). encode ( account . password ))))) ĊĠĠĠ Ġ} ĊĠĠĠ Ġ*/ Ċ } Ċ