package Ġcom . your ss u . behind . controller . post Ċ Ċ import Ġcom . your ss u . behind . model . dto . post . request . Create OrUpdate Request Post Dto Ċ import Ġcom . your ss u . behind . model . dto . post . response . Response Posts Dto Ċ import Ġcom . your ss u . behind . model . entity . post . Post Type Ċ import Ġcom . your ss u . behind . service . post . Post Service Ċ import Ġio . swagger . annotations . ApiOperation Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . web . bind . annotation .* Ċ import Ġorg . springframework . web . multipart . Multipart File Ċ Ċ @ RestController Ċ @ RequestMapping ("/ posts ") Ċ class ĠPost Controller Ġ@ Autowired Ġconstructor ( val Ġpost Service : ĠPost Service ) Ġ{ ĊĠĠĠ Ġ@ ApiOperation (" ê²Į ìĭľ ê¸ Ģ ĠìŀĳìĦ± ", Ġconsume s Ġ= Ġ( MediaType . MULTI PART _ FORM _ DATA _ VALUE )) ĊĠĠĠ Ġ@ PostMapping ("/", Ġconsume s Ġ= Ġ[ MediaType . MULTI PART _ FORM _ DATA _ VALUE ]) ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . CREATED ) ĊĠĠĠ Ġfun Ġcreate Post (@ Request Part ( required Ġ= Ġfalse ) Ġimg File : ĠMultip art File ?, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Request Part Ġcreate OrUpdate Request Post Dto : ĠCreate OrUpdate Request Post Dto ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġpost Service . create Post ( create OrUpdate Request Post Dto , Ġimg File ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ lecture /{ lecture Id }") ĊĠĠĠ Ġ@ ApiOperation (" ê° ķ ì¢ Į Ġë³ Ħ Ġê² Į ìĭľ ê¸ Ģ Ġê°Ģ ìł¸ ìĺ¤ ê¸° ") ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . OK ) ĊĠĠĠ Ġfun Ġget Post (@ PathVariable Ġlect ure Id : ĠLong , Ġ@ RequestParam ( required Ġ= Ġfalse ) Ġtype : ĠPost Type ?, Ġ@ RequestParam Ġpage : ĠInt ): ĠList < Response Posts Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . get Posts ( lecture Id , Ġtype , Ġpage ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ ApiOperation (" ê²Į ìĭľ ë¬ ¼ Ġê²Ģ ìĥī íķĺê¸° ") ĊĠĠĠ Ġ@ GetMapping ("/ search /{ keyword }") ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . OK ) ĊĠĠĠ Ġfun Ġsearch Posts (@ PathVariable Ġkeyword : ĠString , Ġ@ RequestParam ( required Ġ= Ġfalse ) Ġtype : ĠPost Type ?, Ġ@ RequestParam Ġpage : ĠInt ): ĠList < Response Posts Dto > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . search Posts ( keyword , Ġtype , Ġpage ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ ApiOperation (" ìĬ¤ íģ¬ ëŀ © Ġíķĺ ê¸° ") ĊĠĠĠ Ġ@ GetMapping ("/ { post Id }/ scrap ") ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . OK ) ĊĠĠĠ Ġfun Ġscrap Post (@ PathVariable Ġpost Id : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . scrap Post ( post Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ ApiOperation (" íĬ ¹ ìłķ Ġê² Į ìĭľ ê¸ Ģ Ġê°Ģ ìł¸ ìĺ¤ ê¸° ") ĊĠĠĠ Ġ@ GetMapping ("/ { post Id }") ĊĠĠĠ Ġ@ ResponseStatus ( HttpStatus . OK ) ĊĠĠĠ Ġfun Ġget Post Details (@ PathVariable Ġpost Id : ĠLong ): ĠResponse Posts Dto Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . getPost Details ( post Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ ApiOperation (" ê²Į ìĭľ ê¸ Ģ ĠìĤ Ń ìłľ íķĺê¸° ") ĊĠĠĠ Ġ@ Delete Mapping ("/ { post Id }") ĊĠĠĠ Ġfun Ġdelete Post (@ PathVariable Ġpost Id : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . delete Post ( post Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ ApiOperation (" ê²Į ìĭľ ê¸ Ģ Ġìĭ ł ê³ł íķĺê¸° ") ĊĠĠĠ Ġ@ GetMapping ("/ report /{ post Id }") ĊĠĠĠ Ġfun Ġreport Post (@ PathVariable Ġpost Id : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġpost Service . report Post ( post Id ) ĊĠĠĠ Ġ} Ċ } Ċ