공통코드 기능 수정
This commit is contained in:
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.code.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.code.dto.CommonCodeDto;
|
||||
import com.kamco.cd.kamcoback.postgres.core.CommonCodeCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -13,6 +14,24 @@ public class CommonCodeService {
|
||||
|
||||
private final CommonCodeCoreService commonCodeCoreService;
|
||||
|
||||
|
||||
/**
|
||||
* 공통코드 목록 조회
|
||||
* @return
|
||||
*/
|
||||
public List<CommonCodeDto.Basic> getFindAll() {
|
||||
return commonCodeCoreService.findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드 단건 조회
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public CommonCodeDto.Basic getOneById(Long id) {
|
||||
return commonCodeCoreService.getOneById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드 생성 요청
|
||||
* @param req 생성요청 정보
|
||||
@@ -20,7 +39,23 @@ public class CommonCodeService {
|
||||
*/
|
||||
@Transactional
|
||||
public Long save(CommonCodeDto.AddReq req) {
|
||||
Long id = commonCodeCoreService.save(req).getId();
|
||||
return id;
|
||||
return commonCodeCoreService.save(req).getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드 수정 요청
|
||||
* @param id 코드 아이디
|
||||
* @param req 수정요청 정보
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
public Long update(Long id, CommonCodeDto.ModifyReq req) {
|
||||
return commonCodeCoreService.update(id, req).getId();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void remove(Long id) {
|
||||
commonCodeCoreService.remove(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user