package Ġcom . my world . s chat . controller Ċ Ċ import Ġcom . my world . s chat . common . Api Result Ċ import Ġcom . my world . s chat . service . ChatMessage Service Ċ import Ġorg . apache . logging . log 4 j . Log Manager Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġorg . springframework . web . multipart . Multipart File Ċ import Ġjava . io . IOException Ċ import Ġjavax . servlet . http . HttpServletRequest Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ @ RestController Ċ class ĠChat Message Controller Ġ{ ĊĠĠĠ Ġprivate Ġval Ġlog Ġ= ĠLog Manager . getRoot Logger () ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġchat Message Service : ĠChat Message Service ĊĊĠĠĠ Ġ@ GetMapping ("/ getList Pair ") ĊĠĠĠ Ġfun ĠgetList Pair (@ RequestParam ĠtagName : ĠString , Ġrequest : ĠHttpServletRequest ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . getList Pair ( tagName , Ġrequest ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ getList Group ") ĊĠĠĠ Ġfun ĠgetList Group (): ĠApi Result < *> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . getList Group () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ("/ edit Chat Group ") ĊĠĠĠ Ġfun Ġedit Chat Group ( ĊĠĠĠĠĠĠĠ Ġ@ RequestParam (" nickname ") Ġnickname : ĠString , ĊĠĠĠĠĠĠĠ Ġ@ RequestParam (" member Name ") Ġmember Name : ĠString , ĊĠĠĠĠĠĠĠ Ġ@ RequestParam (" show Member Nick name ") Ġshow Member Nick name : ĠBoolean , ĊĠĠĠĠĠĠĠ Ġ@ RequestParam (" groupId ") ĠgroupId : ĠString ?, ĊĠĠĠĠĠĠĠ Ġ@ RequestBody Ġwid Name List : ĠMutable List < String > ĊĠĠĠ Ġ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . edit Chat Group ( nickname , Ġmember Name , Ġshow Member Nick name , ĠgroupId , Ġwid Name List ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Delete Mapping ("/ del Chat Group ") ĊĠĠĠ Ġfun Ġdel Chat Group (@ RequestParam Ġid : ĠString ): ĠApi Result < *> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . del Chat Group ( id ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ PostMapping ( value Ġ= Ġ["/ upload Chat Photo "], Ġconsume s Ġ= Ġ[ MediaType . MULTI PART _ FORM _ DATA _ VALUE ]) ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġupload Chat Photo (@ RequestParam Ġto Names : ĠString , Ġ@ RequestParam Ġsend Time : ĠString , Ġ@ RequestBody Ġfile : ĠMultip art File , Ġrequest : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . upload Chat Photo ( to Names , Ġsend Time , Ġfile , Ġrequest , Ġresponse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ( value Ġ= Ġ["/ upload Chat File "], Ġconsume s Ġ= Ġ[ MediaType . MULTI PART _ FORM _ DATA _ VALUE ]) ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġupload Chat File (@ RequestParam Ġto Names : ĠString , Ġ@ RequestParam Ġsend Time : ĠString , Ġ@ RequestBody Ġfile : ĠMultip art File , Ġrequest : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . upload Chat File ( to Names , Ġsend Time , Ġfile , Ġrequest , Ġresponse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ PostMapping ("/ upload Chat Photo Base 6 4 ") ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġupload Chat Photo Base 6 4 (@ RequestParam Ġto Names : ĠString , Ġ@ RequestParam Ġsend Time : ĠString , Ġ@ RequestBody Ġbase 6 4 : ĠString , Ġrequest : ĠHttpServletRequest , Ġresponse : ĠHttpServletResponse ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . upload Chat Photo Base 6 4 ( to Names , Ġsend Time , Ġbase 6 4 , Ġrequest , Ġresponse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ["/ get Chat File Location /{ id Detail } "], Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ OCT ET _ STREAM _ VALUE ]) ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġget Chat File Location (@ PathVariable Ġid Detail : ĠString , Ġresponse : ĠHttpServletResponse ) Ġ{ ĊĠĠĠĠĠĠĠ Ġchat Message Service . get Chat File Location ( id Detail , Ġresponse ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ PostMapping ("/ upload Group Avatar Base 6 4 ") ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġupload Group Avatar Base 6 4 (@ RequestParam ĠgroupId : ĠString , Ġ@ RequestBody Ġbase 6 4 : ĠString ): ĠApi Result < *> ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġchat Message Service . upload Group Avatar Base 6 4 ( groupId , Ġbase 6 4 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ( value Ġ= Ġ["/ avatar Group /{ id } "], Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ OCT ET _ STREAM _ VALUE ]) ĊĠĠĠ Ġ@ Throws ( IOException :: class ) ĊĠĠĠ Ġfun Ġget Group Photo Location (@ PathVariable Ġid : ĠString , Ġresponse : ĠHttpServletResponse ) Ġ{ ĊĠĠĠĠĠĠĠ Ġchat Message Service . get Avatar Group ( id , Ġresponse ) ĊĠĠĠ Ġ} Ċ } Ċ