|
|
@@ -0,0 +1,100 @@
|
|
|
+package com.its.op.controller.its.facility;
|
|
|
+
|
|
|
+import com.its.op.dto.its.oper.TbUserMsgDto;
|
|
|
+import com.its.op.dto.its.oper.TbUserMsgToDto;
|
|
|
+import com.its.op.service.its.oper.TbUserMsgService;
|
|
|
+import com.its.op.service.its.oper.TbUserMsgToService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Api(tags = "01.시설물관리-4.시설물정보 전파-2.유지보수 메시지 전송")
|
|
|
+@Validated
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping("/api/facility/tb_user_msg")
|
|
|
+public class TbUserMsgController {
|
|
|
+
|
|
|
+ private final TbUserMsgService service;
|
|
|
+ private final TbUserMsgToService toService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "사용자 메시지 전체조회(TB_USER_MSG)", response = TbUserMsgDto.class, responseContainer = "ArrayList")
|
|
|
+ @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbUserMsgDto> findAllList() {
|
|
|
+ return this.service.findAllList();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "사용자 메시지 개별조회(TB_USER_MSG)", response = TbUserMsgDto.class)
|
|
|
+ @GetMapping(value = "/{msgNmbr}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbUserMsgDto findById(@PathVariable("msgNmbr") final Long msgNmbr) {
|
|
|
+ return this.service.findById(msgNmbr);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "사용자 메시지 정보변경(TB_USER_MSG)", response = TbUserMsgDto.class)
|
|
|
+ @PutMapping(value = "/{msgNmbr}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbUserMsgDto updateById(@PathVariable("msgNmbr") final Long msgNmbr, @RequestBody @Valid final TbUserMsgDto.TbUserMsgUpdReq req) {
|
|
|
+ return this.service.updateById(msgNmbr, req);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "사용자 메시지 정보변경/생성-개별(TB_USER_MSG)", response = TbUserMsgDto.class)
|
|
|
+ @PostMapping(value = "/{msgNmbr}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbUserMsgDto mergeInfo(@PathVariable("msgNmbr") final Long msgNmbr, @RequestBody @Valid final TbUserMsgDto.TbUserMsgUpdReq req) {
|
|
|
+ return this.service.mergeInfo(req);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "사용자 메시지 정보삭제-개별(TB_USER_MSG)", response = TbUserMsgDto.class)
|
|
|
+ @DeleteMapping(value = "/{msgNmbr}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbUserMsgDto deleteDataById(@PathVariable("msgNmbr") final Long msgNmbr) {
|
|
|
+ return this.service.deleteById(msgNmbr);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 로그인 사용자 Notify 메시지 조회
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "로그인 사용자가 확인하지 않고 남아있는 메시지를 조회", response = TbUserMsgDto.class, responseContainer = "ArrayList")
|
|
|
+ @GetMapping(value = "/list/notify/{userId}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbUserMsgDto> findAllListNotify(@PathVariable("userId") final String userId) {
|
|
|
+ return this.service.findAllListNotify(userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "유지보수 메시지 이력 조회", response = TbUserMsgDto.class, responseContainer = "ArrayList")
|
|
|
+ @GetMapping(value = "/list/history", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbUserMsgDto> findAllListHistory(
|
|
|
+ @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24MI00)", example = "20220122000000", required = true)
|
|
|
+ @RequestParam String FROM_DT,
|
|
|
+ @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20220122235959", required = true)
|
|
|
+ @RequestParam String TO_DT) {
|
|
|
+ return this.service.findAllListHistory(FROM_DT, TO_DT);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 사용자 메시지 대상 테이블 Controller
|
|
|
+ * @param msgNmbr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "사용자 메시지 대상 개별조회(TB_USER_MSG_TO)", response = TbUserMsgToDto.class, responseContainer = "ArrayList")
|
|
|
+ @GetMapping(value = "/to/{msgNmbr}", produces = {"application/json; charset=utf8"})
|
|
|
+ public List<TbUserMsgToDto> findAllListTo(@PathVariable("msgNmbr") final Long msgNmbr) {
|
|
|
+ return this.toService.findAllListTo(msgNmbr);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 사용자 메시지 확인
|
|
|
+ * @param msgNmbr
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "사용자 메시지 확인", response = TbUserMsgToDto.class)
|
|
|
+ @PostMapping(value = "/to/cnfm/{msgNmbr}/{userId}", produces = {"application/json; charset=utf8"})
|
|
|
+ public TbUserMsgToDto mergeInfo(@PathVariable("msgNmbr") final Long msgNmbr, @PathVariable("userId") final String userId) {
|
|
|
+ return this.toService.cnfmMsg(msgNmbr, userId);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|