|
@@ -29,7 +29,7 @@ public class TbVdsDtctService {
|
|
|
private final TbCmmnCdRepository codeRepo;
|
|
|
|
|
|
// 데이터 1건 조회, 없으면 exception
|
|
|
- private TbVdsDtct requireOne(String id) throws NoSuchElementException {
|
|
|
+ private TbVdsDtct requireOne(Long id) throws NoSuchElementException {
|
|
|
Optional<TbVdsDtct> info = this.repo.findById(id);
|
|
|
if (info.isPresent()) {
|
|
|
return info.get();
|
|
@@ -68,7 +68,7 @@ public class TbVdsDtctService {
|
|
|
|
|
|
// 데이터 1건 조회(기존 데이터가 반드시 존재해야 함)
|
|
|
@Transactional(readOnly = true)
|
|
|
- public TbVdsDtctDto findById(String id) {
|
|
|
+ public TbVdsDtctDto findById(Long id) {
|
|
|
TbVdsDtct entity = requireOne(id);
|
|
|
return entity.toDto();
|
|
|
}
|
|
@@ -80,7 +80,7 @@ public class TbVdsDtctService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public TbVdsDtctDto updateById(String id, TbVdsDtctDto.TbVdsDtctUpdReq req) {
|
|
|
+ public TbVdsDtctDto updateById(Long id, TbVdsDtctDto.TbVdsDtctUpdReq req) {
|
|
|
TbVdsDtct entity = requireOne(id);
|
|
|
entity.updateInfo(req);
|
|
|
this.repo.save(entity);
|
|
@@ -136,7 +136,7 @@ public class TbVdsDtctService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public TbVdsDtctDto deleteById(String id) {
|
|
|
+ public TbVdsDtctDto deleteById(Long id) {
|
|
|
TbVdsDtct entity = requireOne(id);
|
|
|
// 검지기 링크 관계설정 정보 삭제
|
|
|
this.linkRltnRepo.deleteById(id);
|
|
@@ -149,9 +149,9 @@ public class TbVdsDtctService {
|
|
|
|
|
|
// 정보 삭제-목록, 존재하는 데이터 만 삭제
|
|
|
@Transactional
|
|
|
- public List<TbVdsDtctDto> deleteByIds(List<String> ids) {
|
|
|
+ public List<TbVdsDtctDto> deleteByIds(List<Long> ids) {
|
|
|
List<TbVdsDtctDto> result = new ArrayList<>();
|
|
|
- for (String id : ids) {
|
|
|
+ for (Long id : ids) {
|
|
|
// 검지기 링크 관계설정 정보 삭제
|
|
|
this.linkRltnRepo.deleteById(id);
|
|
|
Optional<TbVdsDtct> obj = this.repo.findById(id);
|