update Category

This commit is contained in:
Kana
2024-01-05 16:28:04 +09:00
parent 0c9d5d59ca
commit a5392ac111
7 changed files with 136 additions and 91 deletions

View File

@@ -126,13 +126,11 @@ public class CategoryController {
}
// KAN코드 중복확인 메서드
@PostMapping("/category/chackKancode")
@PostMapping("/category/checkKancode")
@ResponseBody
public int chackKancode(String kan_code) {
int chack = categoryService.checkKan(kan_code);
System.out.println(chack);
return chack;
public String chackKancode(String kan_code) {
String checkkan = categoryService.kanCheck(kan_code);
return checkkan;
}

View File

@@ -14,4 +14,5 @@ public interface CategoryMapper {
int updateByKanCode(CategoryDto dto);
int deactivateByKanCode(String kan_code);
int activateByKanCode(String kan_code);
String kanCheck(String kan_code);
}

View File

@@ -52,14 +52,8 @@ public class CategoryService {
return mapper.activateByKanCode(kan_code);
}
public int checkKan(String kan_code) {
CategoryDto dto = mapper.selectByKanCode(kan_code);
String kancode = dto.getKan_code();
if(kancode == null) {
return 0;
}else {
return 1;
}
public String kanCheck(String kan_code) {
return mapper.kanCheck(kan_code);
}