diff --git a/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingController.java b/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingController.java index 691f0bb8..1e4ff0a6 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingController.java +++ b/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingController.java @@ -20,41 +20,42 @@ import org.springframework.web.bind.annotation.*; @Tag(name = "CanvasBasicSettingController", description = "Canvas Basic Setting 관련 API") public class CanvasBasicSettingController { private final CanvasBasicSettingService canvasBasicSettingService; - + @Operation(description = "Canvas Basic Setting 정보를 조회 한다.") @GetMapping("/canvas-basic-settings/by-object/{objectNo}") public List selectCanvasBasicSetting(@PathVariable String objectNo) { - - log.debug("Basic Setting 조회 ::::: " + objectNo); - - return canvasBasicSettingService.selectCanvasBasicSetting(objectNo); + + log.debug("Basic Setting 조회 ::::: " + objectNo); + + return canvasBasicSettingService.selectCanvasBasicSetting(objectNo); } - + @Operation(description = "Canvas Basic Setting 정보를 등록 한다.") @PostMapping("/canvas-basic-settings") @ResponseStatus(HttpStatus.CREATED) - public Map insertCanvasBasicSetting(@RequestBody CanvasBasicSettingInfo csi) throws QcastException { - - log.debug("Basic Setting 등록 ::::: " + csi.getObjectNo()); - - return canvasBasicSettingService.insertCanvasBasicSetting(csi); + public Map insertCanvasBasicSetting(@RequestBody CanvasBasicSettingInfo csi) + throws QcastException { + + log.debug("Basic Setting 등록 ::::: " + csi.getObjectNo()); + + return canvasBasicSettingService.insertCanvasBasicSetting(csi); } - + @Operation(description = "지붕면 할당 정보를 등록 한다.") @PostMapping("/roof-allocation-settings") @ResponseStatus(HttpStatus.CREATED) - public Map insertRoofAllocSetting(@RequestBody RoofAllocationSettingInfo rasi) throws QcastException { - - log.debug("지붕면 할당 등록 ::::: " + rasi.getObjectNo()); - - return canvasBasicSettingService.insertRoofAllocSetting(rasi); + public Map insertRoofAllocSetting(@RequestBody RoofAllocationSettingInfo rasi) + throws QcastException { + + log.debug("지붕면 할당 등록 ::::: " + rasi.getObjectNo()); + + return canvasBasicSettingService.insertRoofAllocSetting(rasi); } - + @Operation(description = "Canvas 지붕재추가 Setting 정보를 삭제 한다.") @DeleteMapping("/canvas-basic-settings/delete-RoofMaterials/{objectNo}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteRoofMaterialsAdd(@PathVariable String objectNo) throws QcastException { - canvasBasicSettingService.deleteRoofMaterialsAdd(objectNo); + canvasBasicSettingService.deleteRoofMaterialsAdd(objectNo); } - } diff --git a/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingService.java b/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingService.java index 4ac2722f..6b6dc436 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingService.java +++ b/src/main/java/com/interplug/qcast/biz/canvasBasicSetting/CanvasBasicSettingService.java @@ -1,14 +1,5 @@ package com.interplug.qcast.biz.canvasBasicSetting; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.stereotype.Service; - import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingInfo; import com.interplug.qcast.biz.canvasBasicSetting.dto.CanvasBasicSettingResponse; import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationInfo; @@ -16,124 +7,129 @@ import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofAllocationSettingInfo; import com.interplug.qcast.biz.canvasBasicSetting.dto.RoofMaterialsAddInfo; import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.QcastException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; @Slf4j @Service @RequiredArgsConstructor public class CanvasBasicSettingService { - private final CanvasBasicSettingMapper canvasBasicSettingMapper; + private final CanvasBasicSettingMapper canvasBasicSettingMapper; - // Canvas Basic Setting 조회(objectNo) - public List selectCanvasBasicSetting(String objectNo) { - return canvasBasicSettingMapper.selectCanvasBasicSetting(objectNo); - } + // Canvas Basic Setting 조회(objectNo) + public List selectCanvasBasicSetting(String objectNo) { + return canvasBasicSettingMapper.selectCanvasBasicSetting(objectNo); + } - // Canvas Basic Setting 등록 - public Map insertCanvasBasicSetting(CanvasBasicSettingInfo csi) throws QcastException { - - Map response = new HashMap<>(); - - if (csi.getObjectNo() == null) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } + // Canvas Basic Setting 등록 + public Map insertCanvasBasicSetting(CanvasBasicSettingInfo csi) + throws QcastException { - try { - - // 먼저 데이터가 존재하는지 확인 - CanvasBasicSettingInfo cntData = canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo()); - - log.debug("cntData ::::: " + cntData); - - // 데이터가 존재하지 않으면 insert - if (cntData.getRoofCnt().intValue() < 1) { - // 도면/치수/각도 정보 insert - canvasBasicSettingMapper.insertCanvasBasicSetting(csi); - - // for-each 루프를 사용하여 지붕재추가 Setting - for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { - - rma.setObjectNo(csi.getObjectNo()); - // 신규 지붕재추가 정보 insert - canvasBasicSettingMapper.insertRoofMaterialsAdd(rma); - } - - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - - } else { - // 도면/치수/각도 정보 update - canvasBasicSettingMapper.updateCanvasBasicSetting(csi); - - // for-each 루프를 사용하여 지붕재추가 Setting - for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { - - rma.setObjectNo(csi.getObjectNo()); - // 신규 지붕재추가 정보 insert - canvasBasicSettingMapper.updateRoofMaterialsAdd(rma); - } - - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - } - - } catch (Exception e) { - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.save.error"); - } + Map response = new HashMap<>(); - // 생성된 objectNo 반환 - return response; + if (csi.getObjectNo() == null) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } - } - - // 지붕면 할당 Setting 등록 - public Map insertRoofAllocSetting(RoofAllocationSettingInfo rasi) throws QcastException { - - Map response = new HashMap<>(); - - if (rasi.getObjectNo() == null) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } + try { - try { - - // 기존 지붕재추가 정보 삭제 후 insert - canvasBasicSettingMapper.deleteRoofMaterialsAdd(rasi.getObjectNo()); - - // for-each 루프를 사용하여 지붕재추가 Setting - for (RoofAllocationInfo rai : rasi.getRoofAllocationList()) { - rai.setObjectNo(rasi.getObjectNo()); - canvasBasicSettingMapper.insertRoofAllocation(rai); - } - response.put("objectNo", rasi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - } catch (Exception e) { - response.put("objectNo", rasi.getObjectNo()); - response.put("returnMessage", "common.message.save.error"); - } + // 먼저 데이터가 존재하는지 확인 + CanvasBasicSettingInfo cntData = + canvasBasicSettingMapper.getCanvasBasicSettingCnt(csi.getObjectNo()); - // 생성된 objectNo 반환 - return response; + log.debug("cntData ::::: " + cntData); - } - - // 지붕재추가 삭제 - public void deleteRoofMaterialsAdd(String objectNo) throws QcastException { - - if (objectNo == null || objectNo.trim().isEmpty()) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - // 먼저 데이터가 존재하는지 확인 - RoofMaterialsAddInfo cntData = canvasBasicSettingMapper.getRoofMaterialsCnt(objectNo); - - // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 - if (cntData.getRoofCnt().intValue() > 0) { - canvasBasicSettingMapper.deleteRoofMaterialsAdd(objectNo); - } else { - throw new QcastException (ErrorCode.NOT_FOUND ,"삭제할 지붕재가 존재하지 않습니다."); - } - - } + // 데이터가 존재하지 않으면 insert + if (cntData.getRoofCnt().intValue() < 1) { + // 도면/치수/각도 정보 insert + canvasBasicSettingMapper.insertCanvasBasicSetting(csi); + // for-each 루프를 사용하여 지붕재추가 Setting + for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { + + rma.setObjectNo(csi.getObjectNo()); + // 신규 지붕재추가 정보 insert + canvasBasicSettingMapper.insertRoofMaterialsAdd(rma); + } + + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + + } else { + // 도면/치수/각도 정보 update + canvasBasicSettingMapper.updateCanvasBasicSetting(csi); + + // for-each 루프를 사용하여 지붕재추가 Setting + for (RoofMaterialsAddInfo rma : csi.getRoofMaterialsAddList()) { + + rma.setObjectNo(csi.getObjectNo()); + // 신규 지붕재추가 정보 insert + canvasBasicSettingMapper.updateRoofMaterialsAdd(rma); + } + + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + } + + } catch (Exception e) { + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.save.error"); + } + + // 생성된 objectNo 반환 + return response; + } + + // 지붕면 할당 Setting 등록 + public Map insertRoofAllocSetting(RoofAllocationSettingInfo rasi) + throws QcastException { + + Map response = new HashMap<>(); + + if (rasi.getObjectNo() == null) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } + + try { + + // 기존 지붕재추가 정보 삭제 후 insert + canvasBasicSettingMapper.deleteRoofMaterialsAdd(rasi.getObjectNo()); + + // for-each 루프를 사용하여 지붕재추가 Setting + for (RoofAllocationInfo rai : rasi.getRoofAllocationList()) { + rai.setObjectNo(rasi.getObjectNo()); + canvasBasicSettingMapper.insertRoofAllocation(rai); + } + response.put("objectNo", rasi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + } catch (Exception e) { + response.put("objectNo", rasi.getObjectNo()); + response.put("returnMessage", "common.message.save.error"); + } + + // 생성된 objectNo 반환 + return response; + } + + // 지붕재추가 삭제 + public void deleteRoofMaterialsAdd(String objectNo) throws QcastException { + + if (objectNo == null || objectNo.trim().isEmpty()) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } + + // 먼저 데이터가 존재하는지 확인 + RoofMaterialsAddInfo cntData = canvasBasicSettingMapper.getRoofMaterialsCnt(objectNo); + + // 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐 + if (cntData.getRoofCnt().intValue() > 0) { + canvasBasicSettingMapper.deleteRoofMaterialsAdd(objectNo); + } else { + throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 지붕재가 존재하지 않습니다."); + } + } } diff --git a/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingController.java b/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingController.java index 6d9ce950..a09f0f43 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingController.java +++ b/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingController.java @@ -19,24 +19,23 @@ import org.springframework.web.bind.annotation.*; @Tag(name = "CanvasGridSettingController", description = "Canvas Grid Setting 관련 API") public class CanvasGridSettingController { private final CanvasGridSettingService canvasGridSettingService; - + @Operation(description = "Canvas Grid Setting 정보를 조회 한다.") @GetMapping("/canvas-grid-settings/by-object/{objectNo}") public CanvasGridSettingInfo selectCanvasGridSetting(@PathVariable String objectNo) { - - log.debug("Grid Setting 조회 ::::: " + objectNo); - - return canvasGridSettingService.selectCanvasGridSetting(objectNo); + + log.debug("Grid Setting 조회 ::::: " + objectNo); + + return canvasGridSettingService.selectCanvasGridSetting(objectNo); } - + @Operation(description = "Canvas Grid Setting 정보를 등록 한다.") @PostMapping("/canvas-grid-settings") @ResponseStatus(HttpStatus.CREATED) public Map insertCanvasGridStatus(@RequestBody CanvasGridSettingInfo csi) { - - log.debug("Grid Setting 등록 ::::: " + csi.getObjectNo()); - - return canvasGridSettingService.insertCanvasGridSetting(csi); + + log.debug("Grid Setting 등록 ::::: " + csi.getObjectNo()); + + return canvasGridSettingService.insertCanvasGridSetting(csi); } - } diff --git a/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingService.java b/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingService.java index 89fee56d..dcfc9986 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingService.java +++ b/src/main/java/com/interplug/qcast/biz/canvasGridSetting/CanvasGridSettingService.java @@ -12,32 +12,30 @@ import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class CanvasGridSettingService { - private final CanvasGridSettingMapper canvasGridSettingMapper; + private final CanvasGridSettingMapper canvasGridSettingMapper; - // Canvas Setting 조회(objectNo) - public CanvasGridSettingInfo selectCanvasGridSetting(String objectNo) { - return canvasGridSettingMapper.selectCanvasGridSetting(objectNo); - } + // Canvas Setting 조회(objectNo) + public CanvasGridSettingInfo selectCanvasGridSetting(String objectNo) { + return canvasGridSettingMapper.selectCanvasGridSetting(objectNo); + } - // Canvas Setting 등록 - public Map insertCanvasGridSetting(CanvasGridSettingInfo csi) { - - Map response = new HashMap<>(); + // Canvas Setting 등록 + public Map insertCanvasGridSetting(CanvasGridSettingInfo csi) { - try { - canvasGridSettingMapper.insertCanvasGridSetting(csi); - - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - - } catch (Exception e) { - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.save.error"); - } + Map response = new HashMap<>(); - // 생성된 objectNo 반환 - return response; + try { + canvasGridSettingMapper.insertCanvasGridSetting(csi); - } + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + } catch (Exception e) { + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.save.error"); + } + + // 생성된 objectNo 반환 + return response; + } } diff --git a/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingController.java b/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingController.java index 741bd9c8..f1a91853 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingController.java +++ b/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingController.java @@ -20,33 +20,33 @@ import org.springframework.web.bind.annotation.*; @Tag(name = "CanvasSettingController", description = "Canvas Setting 관련 API") public class CanvasSettingController { private final CanvasSettingService canvasSettingService; - + @Operation(description = "Canvas Setting 정보를 조회 한다.") @GetMapping("/canvas-settings/by-object/{objectNo}") public CanvasSettingInfo selectCanvasSetting(@PathVariable String objectNo) { - - log.debug("Setting 조회 ::::: " + objectNo); - - return canvasSettingService.selectCanvasSetting(objectNo); + + log.debug("Setting 조회 ::::: " + objectNo); + + return canvasSettingService.selectCanvasSetting(objectNo); } - + @Operation(description = "Canvas Setting 정보를 등록 한다.") @PostMapping("/canvas-settings") @ResponseStatus(HttpStatus.CREATED) - public Map insertCanvasSetting(@RequestBody CanvasSettingInfo csi) throws QcastException { - - log.debug("Setting 등록 ::::: " + csi.getObjectNo()); - - return canvasSettingService.insertCanvasSetting(csi); + public Map insertCanvasSetting(@RequestBody CanvasSettingInfo csi) + throws QcastException { + + log.debug("Setting 등록 ::::: " + csi.getObjectNo()); + + return canvasSettingService.insertCanvasSetting(csi); } @Operation(description = "Canvas Setting 정보를 수정 한다.") @PutMapping("/canvas-settings") public void updateCanvasStatus(@RequestBody CanvasSettingInfo csi) { - - log.debug("Setting 수정 ::::: " + csi.getObjectNo()); - - canvasSettingService.updateCanvasSetting(csi); + + log.debug("Setting 수정 ::::: " + csi.getObjectNo()); + + canvasSettingService.updateCanvasSetting(csi); } - } diff --git a/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingService.java b/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingService.java index 40f4505b..239c5655 100644 --- a/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingService.java +++ b/src/main/java/com/interplug/qcast/biz/canvasSetting/CanvasSettingService.java @@ -3,65 +3,60 @@ package com.interplug.qcast.biz.canvasSetting; import com.interplug.qcast.biz.canvasSetting.dto.CanvasSettingInfo; import com.interplug.qcast.config.Exception.ErrorCode; import com.interplug.qcast.config.Exception.QcastException; - -import lombok.RequiredArgsConstructor; - import java.util.HashMap; import java.util.Map; - +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class CanvasSettingService { - private final CanvasSettingMapper canvasSettingMapper; + private final CanvasSettingMapper canvasSettingMapper; - // Canvas Setting 조회(objectNo) - public CanvasSettingInfo selectCanvasSetting(String objectNo) { - return canvasSettingMapper.selectCanvasSetting(objectNo); - } + // Canvas Setting 조회(objectNo) + public CanvasSettingInfo selectCanvasSetting(String objectNo) { + return canvasSettingMapper.selectCanvasSetting(objectNo); + } - // Canvas Setting 등록 - public Map insertCanvasSetting(CanvasSettingInfo csi) throws QcastException { - - Map response = new HashMap<>(); - - if (csi.getObjectNo() == null) { - throw new QcastException (ErrorCode.INVALID_INPUT_VALUE ,"올바르지 않은 입력값입니다."); - } - - try { - - // 먼저 데이터가 존재하는지 확인 - CanvasSettingInfo cntData = canvasSettingMapper.getCanvasSettingCnt(csi.getObjectNo()); - - // 데이터가 존재하지 않으면 insert - if (cntData.getCnt().intValue() < 1) { - canvasSettingMapper.insertCanvasSetting(csi); - - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - - } else { - canvasSettingMapper.updateCanvasSetting(csi); - - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.confirm.mark"); - } - - } catch (Exception e) { - response.put("objectNo", csi.getObjectNo()); - response.put("returnMessage", "common.message.save.error"); - } + // Canvas Setting 등록 + public Map insertCanvasSetting(CanvasSettingInfo csi) throws QcastException { - // 생성된 objectNo 반환 - return response; + Map response = new HashMap<>(); - } + if (csi.getObjectNo() == null) { + throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다."); + } - // Canvas Setting 수정 - public void updateCanvasSetting(CanvasSettingInfo csi) { - canvasSettingMapper.updateCanvasSetting(csi); - } + try { + // 먼저 데이터가 존재하는지 확인 + CanvasSettingInfo cntData = canvasSettingMapper.getCanvasSettingCnt(csi.getObjectNo()); + + // 데이터가 존재하지 않으면 insert + if (cntData.getCnt().intValue() < 1) { + canvasSettingMapper.insertCanvasSetting(csi); + + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + + } else { + canvasSettingMapper.updateCanvasSetting(csi); + + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.confirm.mark"); + } + + } catch (Exception e) { + response.put("objectNo", csi.getObjectNo()); + response.put("returnMessage", "common.message.save.error"); + } + + // 생성된 objectNo 반환 + return response; + } + + // Canvas Setting 수정 + public void updateCanvasSetting(CanvasSettingInfo csi) { + canvasSettingMapper.updateCanvasSetting(csi); + } } diff --git a/src/main/java/com/interplug/qcast/biz/commCode/CommCodeService.java b/src/main/java/com/interplug/qcast/biz/commCode/CommCodeService.java index 1147c4a2..6aa411e2 100644 --- a/src/main/java/com/interplug/qcast/biz/commCode/CommCodeService.java +++ b/src/main/java/com/interplug/qcast/biz/commCode/CommCodeService.java @@ -1,15 +1,15 @@ package com.interplug.qcast.biz.commCode; -import java.util.ArrayList; -import java.util.List; -import org.springframework.stereotype.Service; import com.interplug.qcast.biz.commCode.dto.CodeReq; import com.interplug.qcast.biz.commCode.dto.CodeRes; import com.interplug.qcast.biz.commCode.dto.CommCodeRes; import com.interplug.qcast.biz.commCode.dto.DetailCodeRequest; import com.interplug.qcast.biz.commCode.dto.HeadCodeRequest; +import java.util.ArrayList; +import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; @Slf4j @Service @@ -53,18 +53,23 @@ public class CommCodeService { public List selectQcastCommCode() { List result = commCodeMapper.selectQcastCommCode(); List commCodeList = new ArrayList<>(); - result.forEach(cr -> { - commCodeList.add(CommCodeRes.builder().clHeadCd(cr.getClHeadCd()).clCode(cr.getClCode()) - .clCodeNm(cr.getClCodeNm()).clCodeJp(cr.getClCodeJp()).clPriority(cr.getClPriority()) - .build()); - }); + result.forEach( + cr -> { + commCodeList.add( + CommCodeRes.builder() + .clHeadCd(cr.getClHeadCd()) + .clCode(cr.getClCode()) + .clCodeNm(cr.getClCodeNm()) + .clCodeJp(cr.getClCodeJp()) + .clPriority(cr.getClPriority()) + .build()); + }); return commCodeList; } - /** * 헤더코드 동기화 - * + * * @param headCodeList * @throws Exception */ @@ -81,13 +86,12 @@ public class CommCodeService { } catch (Exception e) { log.error(e.getMessage()); } - } } /** * 상세코드 동기화 - * + * * @param detailCodeList * @throws Exception */ @@ -104,8 +108,6 @@ public class CommCodeService { } catch (Exception e) { log.error(e.getMessage()); } - - } } } diff --git a/src/main/java/com/interplug/qcast/biz/community/BoardController.java b/src/main/java/com/interplug/qcast/biz/community/BoardController.java index f9ce8aaf..4585866c 100644 --- a/src/main/java/com/interplug/qcast/biz/community/BoardController.java +++ b/src/main/java/com/interplug/qcast/biz/community/BoardController.java @@ -1,12 +1,5 @@ package com.interplug.qcast.biz.community; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; import com.interplug.qcast.biz.community.dto.BoardRequest; import com.interplug.qcast.biz.community.dto.BoardResponse; import io.swagger.v3.oas.annotations.Operation; @@ -14,6 +7,13 @@ import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; @Slf4j @RestController @@ -41,9 +41,11 @@ public class BoardController { @Operation(description = "커뮤니티(공지사항, FAQ, 자료다운로드) 파일 다운로드를 진행한다.") @GetMapping("/file/download") @ResponseStatus(HttpStatus.OK) - public void getFileDownload(HttpServletResponse response, - @RequestParam(required = true) String keyNo, @RequestParam String zipYn) throws Exception { + public void getFileDownload( + HttpServletResponse response, + @RequestParam(required = true) String keyNo, + @RequestParam String zipYn) + throws Exception { boardService.getFileDownload(response, keyNo, zipYn); } - } diff --git a/src/main/java/com/interplug/qcast/biz/community/BoardService.java b/src/main/java/com/interplug/qcast/biz/community/BoardService.java index d412b7a0..4e4c9767 100644 --- a/src/main/java/com/interplug/qcast/biz/community/BoardService.java +++ b/src/main/java/com/interplug/qcast/biz/community/BoardService.java @@ -1,17 +1,5 @@ package com.interplug.qcast.biz.community; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpMethod; -import org.springframework.stereotype.Service; -import org.springframework.util.StreamUtils; -import org.springframework.web.util.UriComponentsBuilder; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.interplug.qcast.biz.community.dto.BoardRequest; @@ -21,8 +9,20 @@ import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.message.Messages; import com.interplug.qcast.util.InterfaceQsp; import jakarta.servlet.http.HttpServletResponse; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Service; +import org.springframework.util.StreamUtils; +import org.springframework.web.util.UriComponentsBuilder; @Slf4j @Service @@ -30,8 +30,7 @@ import lombok.extern.slf4j.Slf4j; public class BoardService { private final InterfaceQsp interfaceQsp; - @Autowired - Messages message; + @Autowired Messages message; @Value("${qsp.url}") private String QSP_API_URL; @@ -50,12 +49,14 @@ public class BoardService { /* [0]. Validation Check */ if ("".equals(boardRequest.getSchNoticeClsCd())) { // [msg] {0} is required input value. - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Notice Cls Code")); } if ("".equals(boardRequest.getSchNoticeTpCd())) { // [msg] {0} is required input value. - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Notice Type Code")); } @@ -66,14 +67,17 @@ public class BoardService { } String url = QSP_API_URL + "/api/board/list"; - String apiUrl = UriComponentsBuilder.fromHttpUrl(url) - .queryParam("noticeNo", boardRequest.getNoticeNo()).queryParam("schTitle", encodedSchTitle) - .queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd()) - .queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd()) - .queryParam("startRow", boardRequest.getStartRow()) - .queryParam("endRow", boardRequest.getEndRow()) - .queryParam("schMainYn", boardRequest.getSchMainYn()).build().toUriString(); - + String apiUrl = + UriComponentsBuilder.fromHttpUrl(url) + .queryParam("noticeNo", boardRequest.getNoticeNo()) + .queryParam("schTitle", encodedSchTitle) + .queryParam("schNoticeTpCd", boardRequest.getSchNoticeTpCd()) + .queryParam("schNoticeClsCd", boardRequest.getSchNoticeClsCd()) + .queryParam("startRow", boardRequest.getStartRow()) + .queryParam("endRow", boardRequest.getEndRow()) + .queryParam("schMainYn", boardRequest.getSchMainYn()) + .build() + .toUriString(); /* [2]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); @@ -105,14 +109,18 @@ public class BoardService { /* [0]. Validation Check */ if (boardRequest.getNoticeNo() == null) { // [msg] {0} is required input value. - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Notice No")); } /* [1]. QSP API (url + param) Setting */ String url = QSP_API_URL + "/api/board/detail"; - String apiUrl = UriComponentsBuilder.fromHttpUrl(url) - .queryParam("noticeNo", boardRequest.getNoticeNo()).build().toUriString(); + String apiUrl = + UriComponentsBuilder.fromHttpUrl(url) + .queryParam("noticeNo", boardRequest.getNoticeNo()) + .build() + .toUriString(); /* [2]. QSP API CALL -> Response */ String strResponse = interfaceQsp.callApi(HttpMethod.GET, apiUrl, null); @@ -144,8 +152,8 @@ public class BoardService { if ("".equals(keyNo)) { // [msg] {0} is required input value. String arg = "Y".equals(zipYn) ? "Notice No" : "File No"; - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", arg)); + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", arg)); } /* [1]. QSP API (url + fileNo) Setting */ @@ -165,9 +173,11 @@ public class BoardService { /* [3]. API 응답 파일 처리 */ response.addHeader("Access-Control-Expose-Headers", "Content-Disposition"); response.setContentType( - !"".equals(result.get("type")) && result.get("type") != null ? result.get("type") + !"".equals(result.get("type")) && result.get("type") != null + ? result.get("type") : "application/octet-stream"); - response.setHeader("Content-Disposition", + response.setHeader( + "Content-Disposition", !"".equals(result.get("disposition")) && result.get("disposition") != null ? result.get("disposition") : "attachment;"); @@ -180,14 +190,15 @@ public class BoardService { } catch (Exception e) { // [msg] File download error - throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, + throw new QcastException( + ErrorCode.INTERNAL_SERVER_ERROR, message.getMessage("common.message.file.download.error")); } } else { // [msg] File does not exist. - throw new QcastException(ErrorCode.NOT_FOUND, - message.getMessage("common.message.file.download.exists")); + throw new QcastException( + ErrorCode.NOT_FOUND, message.getMessage("common.message.file.download.exists")); } } } diff --git a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java index 956c14ed..d90211c8 100644 --- a/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java +++ b/src/main/java/com/interplug/qcast/biz/displayItem/DisplayItemService.java @@ -130,7 +130,7 @@ public class DisplayItemService { /** * 노출 아이템 동기화 - Batch - * + * * @param displayItemList * @throws Exception */ @@ -144,5 +144,4 @@ public class DisplayItemService { } } } - } diff --git a/src/main/java/com/interplug/qcast/biz/excelDown/ExcelDownController.java b/src/main/java/com/interplug/qcast/biz/excelDown/ExcelDownController.java index 957ea896..9b668140 100644 --- a/src/main/java/com/interplug/qcast/biz/excelDown/ExcelDownController.java +++ b/src/main/java/com/interplug/qcast/biz/excelDown/ExcelDownController.java @@ -74,5 +74,4 @@ public class ExcelDownController { log.error(e.getMessage()); } } - } diff --git a/src/main/java/com/interplug/qcast/biz/file/FileController.java b/src/main/java/com/interplug/qcast/biz/file/FileController.java index f8948c4e..3313d6de 100644 --- a/src/main/java/com/interplug/qcast/biz/file/FileController.java +++ b/src/main/java/com/interplug/qcast/biz/file/FileController.java @@ -51,7 +51,7 @@ public class FileController { public List fileUpload( HttpServletRequest request, HttpServletResponse response, FileRequest fileRequest) throws Exception { - return fileService.fileUpload(request,fileRequest); + return fileService.fileUpload(request, fileRequest); } @Operation(description = "파일을 삭제 한다.") diff --git a/src/main/java/com/interplug/qcast/biz/login/LoginController.java b/src/main/java/com/interplug/qcast/biz/login/LoginController.java index ad662f06..cbb5af84 100644 --- a/src/main/java/com/interplug/qcast/biz/login/LoginController.java +++ b/src/main/java/com/interplug/qcast/biz/login/LoginController.java @@ -1,21 +1,5 @@ package com.interplug.qcast.biz.login; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.Base64; -import javax.crypto.Cipher; -import javax.crypto.SecretKey; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.PatchMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; import com.interplug.qcast.biz.login.dto.JoinUser; import com.interplug.qcast.biz.login.dto.LoginUser; import com.interplug.qcast.biz.login.dto.UserLoginResponse; @@ -26,8 +10,24 @@ import com.interplug.qcast.config.Exception.QcastException; import com.interplug.qcast.config.message.Messages; import com.interplug.qcast.util.DefaultResponse; import io.swagger.v3.oas.annotations.Operation; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Base64; +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; @Slf4j @RestController @@ -37,8 +37,7 @@ public class LoginController { // @Autowired private LoginService loginService; private final LoginService loginService; - @Autowired - Messages message; + @Autowired Messages message; @Value("${qsp.aes256.key}") String loginPasswordAesKey; @@ -46,10 +45,9 @@ public class LoginController { @Value("${qsp.auto.login.aes256.key}") String autoLoginAesKey; - /** * Q.CAST III에 로그인하여 사용자 정보를 획득한다. - * + * * @param loginUser LoginUser * @return UserLoginResponse * @throws Exception @@ -69,7 +67,7 @@ public class LoginController { /** * 가입 신청 정보를 등록한다. - * + * * @param joinUser JoinUser * @return DefaultResponse * @throws Exception @@ -83,7 +81,7 @@ public class LoginController { /** * 비밀번호를 초기화한다. - * + * * @param userPassword UserPassword * @return DefaultResponse * @throws Exception @@ -96,7 +94,7 @@ public class LoginController { /** * 비밀번호를 변경한다. - * + * * @param userPassword UserPassword * @return DefaultResponse * @throws Exception @@ -109,7 +107,7 @@ public class LoginController { /** * 자동 로그인에 사용하는 아이디를 암호화한다. - * + * * @param loginUser LoginUser * @return String * @throws Exception @@ -121,7 +119,8 @@ public class LoginController { String loginEncryptId = ""; if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) { - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "User Id")); } @@ -136,16 +135,19 @@ public class LoginController { byte[] keyData = loginPasswordAesKey.getBytes(); SecretKey secureKey = new SecretKeySpec(keyData, "AES"); Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); - c.init(Cipher.ENCRYPT_MODE, secureKey, + c.init( + Cipher.ENCRYPT_MODE, + secureKey, new IvParameterSpec(encryptKey.substring(0, 16).getBytes())); byte[] encrypted = c.doFinal(loginUser.getLoginId().getBytes("UTF-8")); // [2]. 암호화 값 셋팅 - loginEncryptId = new String(Base64.getEncoder().encode(encrypted));; + loginEncryptId = new String(Base64.getEncoder().encode(encrypted)); + ; } catch (Exception e) { - throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, - message.getMessage("common.message.error")); + throw new QcastException( + ErrorCode.INTERNAL_SERVER_ERROR, message.getMessage("common.message.error")); } return loginEncryptId; @@ -153,7 +155,7 @@ public class LoginController { /** * 자동 로그인에 사용하는 아이디를 복호화한다. - * + * * @param loginUser LoginUser * @return String * @throws Exception @@ -165,7 +167,8 @@ public class LoginController { String loginDecryptId = ""; if ("".equals(loginUser.getLoginId()) || loginUser.getLoginId() == null) { - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "User Id")); } @@ -180,7 +183,9 @@ public class LoginController { byte[] keyData = loginPasswordAesKey.getBytes(); SecretKey secureKey = new SecretKeySpec(keyData, "AES"); Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); - c.init(Cipher.DECRYPT_MODE, secureKey, + c.init( + Cipher.DECRYPT_MODE, + secureKey, new IvParameterSpec(decryptKey.substring(0, 16).getBytes("UTF-8"))); byte[] byteStr = Base64.getDecoder().decode(loginUser.getLoginId().getBytes()); @@ -189,11 +194,10 @@ public class LoginController { loginDecryptId = new String(c.doFinal(byteStr), "UTF-8"); } catch (Exception e) { - throw new QcastException(ErrorCode.INTERNAL_SERVER_ERROR, - message.getMessage("common.message.error")); + throw new QcastException( + ErrorCode.INTERNAL_SERVER_ERROR, message.getMessage("common.message.error")); } return loginDecryptId; } - } diff --git a/src/main/java/com/interplug/qcast/biz/login/LoginService.java b/src/main/java/com/interplug/qcast/biz/login/LoginService.java index 4f4bed68..7cc1a085 100644 --- a/src/main/java/com/interplug/qcast/biz/login/LoginService.java +++ b/src/main/java/com/interplug/qcast/biz/login/LoginService.java @@ -1,9 +1,5 @@ package com.interplug.qcast.biz.login; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpMethod; -import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.interplug.qcast.biz.login.dto.JoinUser; @@ -18,6 +14,10 @@ import com.interplug.qcast.util.DefaultResponse; import com.interplug.qcast.util.InterfaceQsp; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Service; @Slf4j @Service @@ -30,23 +30,24 @@ public class LoginService { @Value("${qsp.url}") private String qspUrl; - @Autowired - Messages message; + @Autowired Messages message; /** * 로그인 처리 - * + * * @param loginUser LoginUser * @return UserLoginResponse * @throws Exception */ public UserLoginResponse getLogin(LoginUser loginUser) throws Exception { if (loginUser.getLoginId() == null || "".equals(loginUser.getLoginId())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Login Id")); if (loginUser.getPwd() == null || "".equals(loginUser.getPwd())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Password")); UserLoginResponse userLoginResponse = null; @@ -72,42 +73,49 @@ public class LoginService { /** * 가입 신청 등록 - * + * * @param joinUser JoinUser * @return DefaultResponse * @throws Exception */ public DefaultResponse joinUser(JoinUser joinUser) throws Exception { if (joinUser.getStoreQcastNm() == null || "".equals(joinUser.getStoreQcastNm())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Store QCast Name")); if (joinUser.getStoreQcastNmKana() == null || "".equals(joinUser.getStoreQcastNmKana())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Store QCast Name Kana")); if (joinUser.getPostCd() == null || "".equals(joinUser.getPostCd())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Postal Code")); if (joinUser.getAddr() == null || "".equals(joinUser.getAddr())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Address")); if (joinUser.getTelNo() == null || "".equals(joinUser.getTelNo())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Telephone")); if (joinUser.getFax() == null || "".equals(joinUser.getFax())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Fax")); + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax")); if (joinUser.getUserInfo().getUserId() == null || "".equals(joinUser.getUserInfo().getUserId())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "User Id")); if (joinUser.getUserInfo().getUserNm() == null || "".equals(joinUser.getUserInfo().getUserNm())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Name")); // if (joinUser.getUserInfo().getUserNmKana() == null @@ -116,15 +124,17 @@ public class LoginService { // message.getMessage("common.message.required.data", "Name Kana")); if (joinUser.getUserInfo().getTelNo() == null || "".equals(joinUser.getUserInfo().getTelNo())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Telephone")); if (joinUser.getUserInfo().getFax() == null || "".equals(joinUser.getUserInfo().getFax())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, - message.getMessage("common.message.required.data", "Fax")); + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Fax")); if (joinUser.getUserInfo().getEmail() == null || "".equals(joinUser.getUserInfo().getEmail())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "E-Mail")); // QSP API Call.. @@ -145,18 +155,20 @@ public class LoginService { /** * 비밀번호 초기화 - * + * * @param userPassword UserPassword * @return DefaultResponse * @throws Exception */ public DefaultResponse initPassword(UserPassword userPassword) throws Exception { if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Login Id")); if (userPassword.getEmail() == null || "".equals(userPassword.getEmail())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "E-Mail")); // QSP API Call.. @@ -177,22 +189,25 @@ public class LoginService { /** * 비밀번호 변경 - * + * * @param userPassword UserPassword * @return DefaultResponse * @throws Exception */ public DefaultResponse changePassword(UserPassword userPassword) throws Exception { if (userPassword.getLoginId() == null || "".equals(userPassword.getLoginId())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Login Id")); if (userPassword.getChgType() == null || "".equals(userPassword.getChgType())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Change Type (I :Init , C: Change)")); if (userPassword.getChgPwd() == null || "".equals(userPassword.getChgPwd())) - throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, + throw new QcastException( + ErrorCode.INVALID_INPUT_VALUE, message.getMessage("common.message.required.data", "Change Password")); // QSP API Call.. diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java index d8ddcb4d..f486f922 100644 --- a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java +++ b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoController.java @@ -24,7 +24,7 @@ public class MyInfoController { /** * 사용자 ID의 정보 조회 - * + * * @param myInfoRequest * @return */ @@ -34,5 +34,4 @@ public class MyInfoController { public MyInfoResponse getMyInfo(@ModelAttribute MyInfoRequest myInfoRequest) { return myInfoService.getMyInfo(myInfoRequest); } - } diff --git a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java index af5c14b4..b0a050b0 100644 --- a/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java +++ b/src/main/java/com/interplug/qcast/biz/myInfo/MyInfoService.java @@ -22,5 +22,4 @@ public class MyInfoService { public MyInfoResponse getMyInfo(MyInfoRequest myInfoRequest) { return myInfoMapper.selectMyInfo(myInfoRequest); } - } diff --git a/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteController.java b/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteController.java index 11ed6245..bf6f588f 100644 --- a/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteController.java +++ b/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteController.java @@ -24,7 +24,7 @@ public class SpecialNoteController { /** * 견적 특이사항 정보 등록/수정 - * + * * @param specialNoteRequest * @throws Exception */ @@ -38,7 +38,7 @@ public class SpecialNoteController { /** * 견적 특이사항 ITEM 정보 등록/수정 - * + * * @param specialNoteItemRequest * @throws Exception */ @@ -49,5 +49,4 @@ public class SpecialNoteController { throws Exception { specialNoteService.setSpecialNoteItemSave(specialNoteItemRequest); } - } diff --git a/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteService.java b/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteService.java index cdbfdfe2..3b753c0b 100644 --- a/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteService.java +++ b/src/main/java/com/interplug/qcast/biz/specialNote/SpecialNoteService.java @@ -16,7 +16,7 @@ public class SpecialNoteService { /** * 견적 특이사항 저장 - * + * * @param specialNoteRequest * @throws Exception */ @@ -26,7 +26,7 @@ public class SpecialNoteService { /** * 견적 특이사항 아이템 저장 - * + * * @param specialNoteItemRequest * @throws Exception */ @@ -37,7 +37,7 @@ public class SpecialNoteService { /** * 견적 특이사항 동기화 - Batch - * + * * @param specialNoteList * @throws Exception */ @@ -54,7 +54,7 @@ public class SpecialNoteService { /** * 견적 특이사항 아이템 동기화 - Batch - * + * * @param specialNoteItemList * @throws Exception */ @@ -69,5 +69,4 @@ public class SpecialNoteService { } } } - } diff --git a/src/main/java/com/interplug/qcast/biz/storeFavorite/StoreFavoriteController.java b/src/main/java/com/interplug/qcast/biz/storeFavorite/StoreFavoriteController.java index 860a5ff4..75dae9d5 100644 --- a/src/main/java/com/interplug/qcast/biz/storeFavorite/StoreFavoriteController.java +++ b/src/main/java/com/interplug/qcast/biz/storeFavorite/StoreFavoriteController.java @@ -32,10 +32,8 @@ public class StoreFavoriteController { int resultCnt = storeFavService.setStoreFavoriteSave(req); - if (resultCnt > 0) - userResponse.setCode("200"); - else - userResponse.setCode("500"); + if (resultCnt > 0) userResponse.setCode("200"); + else userResponse.setCode("500"); return userResponse; } @@ -47,5 +45,4 @@ public class StoreFavoriteController { throws Exception { return storeFavService.getStoreFavoriteList(req); } - }