mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-22 18:29:51 +08:00
部门列表返回值优化
This commit is contained in:
@@ -15,6 +15,8 @@ public interface DepartmentService extends IService<Department> {
|
||||
|
||||
List<Department> listByParentId(Integer id);
|
||||
|
||||
List<Department> all();
|
||||
|
||||
Department findOrFail(Integer id) throws NotFoundException;
|
||||
|
||||
void deleteById(Integer id) throws NotFoundException;
|
||||
|
||||
@@ -27,7 +27,12 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
|
||||
|
||||
@Override
|
||||
public List<Department> listByParentId(Integer id) {
|
||||
return list(query().getWrapper().eq("parent_id", id));
|
||||
return list(query().getWrapper().eq("parent_id", id).orderByAsc("sort"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Department> all() {
|
||||
return list(query().getWrapper().orderByAsc("sort"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user