mengy месяцев назад: 11
Родитель
Сommit
654e506356

+ 14 - 0
src/main/java/com/unissoft/sys/controller/LabelInfoController.java

@@ -2,6 +2,7 @@ package com.unissoft.sys.controller;
2 2
 
3 3
 
4 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.unissoft.basic.model.BasicEnum;
5 6
 import com.unissoft.common.MyConstant;
6 7
 import com.unissoft.common.PageParam;
7 8
 import com.unissoft.common.ResultView;
@@ -13,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
13 14
 import org.springframework.beans.factory.annotation.Autowired;
14 15
 import org.springframework.web.bind.annotation.*;
15 16
 
17
+import java.util.List;
16 18
 import java.util.UUID;
17 19
 
18 20
 
@@ -97,4 +99,16 @@ public class LabelInfoController {
97 99
         return ResultView.error(MyConstant.ID_NULL);
98 100
     }
99 101
 
102
+    @GetMapping("/getParentsList")
103
+    @ApiOperation(value = "父级列表", notes = "标签父级列表")
104
+    public ResultView getParentsList() {
105
+        try {
106
+            List<LabelInfo> parentsList = labelInfoService.getParentsList();
107
+            return ResultView.success(parentsList);
108
+        } catch (Exception e) {
109
+            e.printStackTrace();
110
+            return ResultView.error();
111
+        }
112
+    }
113
+
100 114
 }

+ 4 - 0
src/main/java/com/unissoft/sys/mapper/LabelInfoMapper.java

@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
9 9
 import org.apache.ibatis.annotations.Param;
10 10
 import org.springframework.stereotype.Repository;
11 11
 
12
+import java.util.List;
13
+
12 14
 /**
13 15
  * <p>
14 16
  *  Mapper 接口
@@ -21,4 +23,6 @@ import org.springframework.stereotype.Repository;
21 23
 public interface LabelInfoMapper extends BaseMapper<LabelInfo> {
22 24
 
23 25
     IPage<LabelInfo> getLabelPage(IPage<LabelInfo> labelInfoPage, @Param("ew") QueryWrapper<LabelInfo> ew);;
26
+
27
+    List<LabelInfo> getParentsList();
24 28
 }

+ 4 - 0
src/main/java/com/unissoft/sys/service/LabelInfoService.java

@@ -1,10 +1,13 @@
1 1
 package com.unissoft.sys.service;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.unissoft.basic.model.BasicEnum;
4 5
 import com.unissoft.common.PageParam;
5 6
 import com.unissoft.sys.model.LabelInfo;
6 7
 import com.baomidou.mybatisplus.extension.service.IService;
7 8
 
9
+import java.util.List;
10
+
8 11
 /**
9 12
  * <p>
10 13
  *  服务类
@@ -16,4 +19,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
16 19
 public interface LabelInfoService extends IService<LabelInfo> {
17 20
 
18 21
     IPage<LabelInfo> getLabelPage(PageParam pageParam);
22
+    List<LabelInfo> getParentsList();
19 23
 }

+ 5 - 1
src/main/java/com/unissoft/sys/service/impl/LabelInfoServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
4 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.unissoft.basic.model.BasicEnum;
7 8
 import com.unissoft.common.PageParam;
8 9
 import com.unissoft.sys.model.LabelInfo;
9 10
 import com.unissoft.sys.mapper.LabelInfoMapper;
@@ -133,5 +134,8 @@ public class LabelInfoServiceImpl extends ServiceImpl<LabelInfoMapper, LabelInfo
133 134
         }
134 135
     }
135 136
 
136
-
137
+    @Override
138
+    public List<LabelInfo> getParentsList() {
139
+        return labelInfoMapper.getParentsList();
140
+    }
137 141
 }