style: canvas status 패키지 내 코드 포맷터 적용
This commit is contained in:
parent
af63ec39ac
commit
646136206e
@ -19,13 +19,15 @@ public class CanvasStatusController {
|
|||||||
|
|
||||||
@Operation(description = "계정에 해당하는 전체 견적서를 조회 한다.")
|
@Operation(description = "계정에 해당하는 전체 견적서를 조회 한다.")
|
||||||
@GetMapping("/canvas-statuses/{userId}")
|
@GetMapping("/canvas-statuses/{userId}")
|
||||||
public List<CanvasStatusResponse> selectAllCanvasStatus(@PathVariable String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectAllCanvasStatus(@PathVariable String userId)
|
||||||
|
throws QcastException {
|
||||||
return canvasStatusService.selectAllCanvasStatus(userId);
|
return canvasStatusService.selectAllCanvasStatus(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(description = "견적서를 조회 한다.")
|
@Operation(description = "견적서를 조회 한다.")
|
||||||
@GetMapping("/canvas-statuses/by-object/{objectNo}/{userId}")
|
@GetMapping("/canvas-statuses/by-object/{objectNo}/{userId}")
|
||||||
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(@PathVariable String objectNo, @PathVariable String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(
|
||||||
|
@PathVariable String objectNo, @PathVariable String userId) throws QcastException {
|
||||||
return canvasStatusService.selectObjectNoCanvasStatus(objectNo, userId);
|
return canvasStatusService.selectObjectNoCanvasStatus(objectNo, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,5 +57,4 @@ public class CanvasStatusController {
|
|||||||
public void deleteIdCanvasStatus(@PathVariable Integer id) throws QcastException {
|
public void deleteIdCanvasStatus(@PathVariable Integer id) throws QcastException {
|
||||||
canvasStatusService.deleteIdCanvasStatus(id);
|
canvasStatusService.deleteIdCanvasStatus(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,7 @@ package com.interplug.qcast.biz.canvasStatus;
|
|||||||
|
|
||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
@ -42,6 +40,4 @@ public interface CanvasStatusMapper {
|
|||||||
|
|
||||||
// 이미지(템플릿) 삭제
|
// 이미지(템플릿) 삭제
|
||||||
public void deleteIdCanvasStatus(Integer id);
|
public void deleteIdCanvasStatus(Integer id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -4,10 +4,8 @@ import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus;
|
|||||||
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
import com.interplug.qcast.biz.canvasStatus.dto.CanvasStatusResponse;
|
||||||
import com.interplug.qcast.config.Exception.ErrorCode;
|
import com.interplug.qcast.config.Exception.ErrorCode;
|
||||||
import com.interplug.qcast.config.Exception.QcastException;
|
import com.interplug.qcast.config.Exception.QcastException;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -29,10 +27,14 @@ public class CanvasStatusService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 견적서 조회(objectNo)
|
// 견적서 조회(objectNo)
|
||||||
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId) throws QcastException {
|
public List<CanvasStatusResponse> selectObjectNoCanvasStatus(String objectNo, String userId)
|
||||||
|
throws QcastException {
|
||||||
List<CanvasStatusResponse> result = null;
|
List<CanvasStatusResponse> result = null;
|
||||||
|
|
||||||
if (objectNo != null && !objectNo.trim().isEmpty() && userId != null && !userId.trim().isEmpty()) {
|
if (objectNo != null
|
||||||
|
&& !objectNo.trim().isEmpty()
|
||||||
|
&& userId != null
|
||||||
|
&& !userId.trim().isEmpty()) {
|
||||||
result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId);
|
result = canvasStatusMapper.selectObjectNoCanvasStatus(objectNo, userId);
|
||||||
} else {
|
} else {
|
||||||
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE, "올바르지 않은 입력값입니다.");
|
||||||
@ -51,7 +53,8 @@ public class CanvasStatusService {
|
|||||||
canvasStatusMapper.insertCanvasStatus(cs);
|
canvasStatusMapper.insertCanvasStatus(cs);
|
||||||
|
|
||||||
// 데이터 저장 후 Max id 확인
|
// 데이터 저장 후 Max id 확인
|
||||||
List<CanvasStatusResponse> maxId = canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId());
|
List<CanvasStatusResponse> maxId =
|
||||||
|
canvasStatusMapper.getMaxIdCanvasStatus(cs.getObjectNo(), cs.getUserId());
|
||||||
id = maxId.get(0).getId();
|
id = maxId.get(0).getId();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -78,7 +81,6 @@ public class CanvasStatusService {
|
|||||||
} else {
|
} else {
|
||||||
throw new QcastException(ErrorCode.NOT_FOUND, "수정할 견적서가 존재하지 않습니다.");
|
throw new QcastException(ErrorCode.NOT_FOUND, "수정할 견적서가 존재하지 않습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 전체 견적서 삭제
|
// 전체 견적서 삭제
|
||||||
@ -89,7 +91,8 @@ public class CanvasStatusService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 먼저 데이터가 존재하는지 확인
|
// 먼저 데이터가 존재하는지 확인
|
||||||
List<CanvasStatusResponse> existingStatus = canvasStatusMapper.getObjectNoCanvasStatus(objectNo);
|
List<CanvasStatusResponse> existingStatus =
|
||||||
|
canvasStatusMapper.getObjectNoCanvasStatus(objectNo);
|
||||||
|
|
||||||
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
// 데이터가 존재하지 않으면 수정하지 않고 예외를 던짐
|
||||||
if (existingStatus.size() > 0) {
|
if (existingStatus.size() > 0) {
|
||||||
@ -97,7 +100,6 @@ public class CanvasStatusService {
|
|||||||
} else {
|
} else {
|
||||||
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 이미지(템플릿) 삭제
|
// 이미지(템플릿) 삭제
|
||||||
@ -116,7 +118,5 @@ public class CanvasStatusService {
|
|||||||
} else {
|
} else {
|
||||||
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
throw new QcastException(ErrorCode.NOT_FOUND, "삭제할 견적서가 존재하지 않습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
<mapper namespace="com.interplug.qcast.biz.canvasStatus.CanvasStatusMapper">
|
<mapper namespace="com.interplug.qcast.biz.canvasStatus.CanvasStatusMapper">
|
||||||
|
|
||||||
@ -79,7 +80,8 @@
|
|||||||
WHERE object_no = #{objectNo}
|
WHERE object_no = #{objectNo}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
<insert id="insertCanvasStatus"
|
||||||
|
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 견적서 등록 */
|
/* sqlid : com.interplug.qcast.canvasStatus.insertCanvasStatus 견적서 등록 */
|
||||||
INSERT INTO TB_CANVAS_STATUS
|
INSERT INTO TB_CANVAS_STATUS
|
||||||
( user_id
|
( user_id
|
||||||
@ -98,7 +100,8 @@
|
|||||||
, #{mapPositionAddress})
|
, #{mapPositionAddress})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateCanvasStatus" parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
<update id="updateCanvasStatus"
|
||||||
|
parameterType="com.interplug.qcast.biz.canvasStatus.dto.CanvasStatus">
|
||||||
/* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 견적서 수정 */
|
/* sqlid : com.interplug.qcast.canvasStatus.updateCanvasStatus 견적서 수정 */
|
||||||
UPDATE TB_CANVAS_STATUS
|
UPDATE TB_CANVAS_STATUS
|
||||||
SET canvas_status = #{canvasStatus}
|
SET canvas_status = #{canvasStatus}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user