|
|
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
|
4
|
4
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
5
|
5
|
import com.ruoyi.novel.domain.NovelCategory;
|
|
6
|
6
|
import com.ruoyi.novel.service.NovelCategoryService;
|
|
|
7
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
7
|
8
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
8
|
9
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
9
|
10
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -16,13 +17,13 @@ import java.util.stream.Collectors;
|
|
16
|
17
|
@RestController
|
|
17
|
18
|
@RequestMapping("/category")
|
|
18
|
19
|
public class CategoryController extends BaseController {
|
|
19
|
|
-// @Autowired
|
|
20
|
|
-// private NovelCategoryService categoryService;
|
|
21
|
|
- private final NovelCategoryService categoryService;
|
|
22
|
|
-
|
|
23
|
|
- public CategoryController(@Qualifier("categoryService") NovelCategoryService categoryService) {
|
|
24
|
|
- this.categoryService = categoryService;
|
|
25
|
|
- }
|
|
|
20
|
+ @Autowired
|
|
|
21
|
+ private NovelCategoryService categoryService;
|
|
|
22
|
+// private final NovelCategoryService categoryService;
|
|
|
23
|
+//
|
|
|
24
|
+// public CategoryController(@Qualifier("novelCategoryService") NovelCategoryService categoryService) {
|
|
|
25
|
+// this.categoryService = categoryService;
|
|
|
26
|
+// }
|
|
26
|
27
|
@GetMapping("/tree")
|
|
27
|
28
|
public AjaxResult tree() {
|
|
28
|
29
|
List<NovelCategory> categories = categoryService.getCategoryTree();
|