分类管理(WRITE)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user