[EDIT] 名前で検索できる機能を追加しました。
This commit is contained in:
@@ -9,4 +9,6 @@ public interface CategoryService {
|
|||||||
public List<CategoryModel> findAll();
|
public List<CategoryModel> findAll();
|
||||||
|
|
||||||
public CategoryModel findOne(Long categoryId);
|
public CategoryModel findOne(Long categoryId);
|
||||||
|
|
||||||
|
public CategoryModel findOneByCategoryName(String categoryName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user