[EDIT] 名前で検索できる機能を追加しました。

This commit is contained in:
s-choi
2026-09-17 13:44:57 +09:00
parent d31d6aaf2d
commit 5ab8109504
2 changed files with 24 additions and 10 deletions

View File

@@ -9,4 +9,6 @@ public interface CategoryService {
public List<CategoryModel> findAll();
public CategoryModel findOne(Long categoryId);
public CategoryModel findOneByCategoryName(String categoryName);
}

View File

@@ -36,4 +36,16 @@ public class CategoryServiceImpl implements CategoryService{
}
public CategoryModel findOneByCategoryName(String categoryName) {
CategoryEntity categoryModel = categoryRepository.findByCategoryName(categoryName);
if (categoryModel == null) {
return null;
}
return CategoryModel.convertFrom(categoryModel);
}
}