分类管理(WRITE)

This commit is contained in:
slhaf
2024-09-10 15:29:04 +08:00
parent ae69dba64a
commit d6471726b9
4 changed files with 43 additions and 1 deletions

View File

@@ -2,9 +2,12 @@ package com.sky.service;
import com.sky.dto.CategoryDTO;
import com.sky.dto.CategoryPageQueryDTO;
import com.sky.entity.Category;
import com.sky.result.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface CategoryService {
/**
@@ -38,4 +41,11 @@ public interface CategoryService {
* @param categoryDTO
*/
void update(CategoryDTO categoryDTO);
/**
* 根据类型查询分类
* @param type
* @return
*/
List<Category> list(Integer type);
}

View File

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
@Service
@@ -104,4 +105,15 @@ public class CategoryServiceImpl implements CategoryService {
BaseContext.removeCurrentId();
categoryMapper.update(category);
}
/**
* 根据类型查询分类
* @param type
* @return
*/
@Override
public List<Category> list(Integer type) {
List<Category> list = categoryMapper.selectByType(type);
return list;
}
}