공통코드 삭제 API 커밋, 삭제일시 컬럼 추가, 에러로그에 userId 토큰으로 로직 변경
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Tag(name = "공통코드 관리", description = "공통코드 관리 API")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping({"/demo/code", "/api/code"})
|
||||
@RequestMapping("/api/code")
|
||||
public class CommonCodeApiController {
|
||||
|
||||
private final CommonCodeService commonCodeService;
|
||||
@@ -148,14 +148,13 @@ public class CommonCodeApiController {
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResponseDto<Long> remove(
|
||||
public ApiResponseDto<ApiResponseDto.ResponseObj> remove(
|
||||
@io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "공통코드 삭제 요청 정보",
|
||||
required = true)
|
||||
@PathVariable
|
||||
Long id) {
|
||||
commonCodeService.remove(id);
|
||||
return ApiResponseDto.deleteOk(id);
|
||||
return ApiResponseDto.okObject(commonCodeService.removeCode(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "순서 변경", description = "공통코드 순서를 변경 합니다.")
|
||||
|
||||
@@ -90,6 +90,9 @@ public class CommonCodeDto {
|
||||
private String props2;
|
||||
private String props3;
|
||||
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime deletedDttm;
|
||||
|
||||
public Basic(
|
||||
Long id,
|
||||
String code,
|
||||
@@ -103,7 +106,9 @@ public class CommonCodeDto {
|
||||
ZonedDateTime updatedDttm,
|
||||
String props1,
|
||||
String props2,
|
||||
String props3) {
|
||||
String props3,
|
||||
ZonedDateTime deletedDttm
|
||||
) {
|
||||
this.id = id;
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
@@ -117,6 +122,7 @@ public class CommonCodeDto {
|
||||
this.props1 = props1;
|
||||
this.props2 = props2;
|
||||
this.props3 = props3;
|
||||
this.deletedDttm = deletedDttm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.kamco.cd.kamcoback.code.dto.CommonCodeDto.AddReq;
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto.Basic;
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto.ModifyReq;
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto.OrderReq;
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.CommonCodeCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -64,8 +65,8 @@ public class CommonCodeService {
|
||||
* @param id 코드 아이디
|
||||
*/
|
||||
@Transactional
|
||||
public void remove(Long id) {
|
||||
commonCodeCoreService.remove(id);
|
||||
public ApiResponseDto.ResponseObj removeCode(Long id) {
|
||||
return commonCodeCoreService.removeCode(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user