mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-08 02:04:04 +08:00
系统配置接口返回部门和分类
This commit is contained in:
parent
baf4d50b33
commit
1103a89e71
@ -17,6 +17,7 @@ package xyz.playedu.api.controller.backend;
|
|||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -25,6 +26,8 @@ import xyz.playedu.common.annotation.Log;
|
|||||||
import xyz.playedu.common.constant.BusinessTypeConstant;
|
import xyz.playedu.common.constant.BusinessTypeConstant;
|
||||||
import xyz.playedu.common.constant.ConfigConstant;
|
import xyz.playedu.common.constant.ConfigConstant;
|
||||||
import xyz.playedu.common.context.BCtx;
|
import xyz.playedu.common.context.BCtx;
|
||||||
|
import xyz.playedu.common.service.CategoryService;
|
||||||
|
import xyz.playedu.common.service.DepartmentService;
|
||||||
import xyz.playedu.common.types.JsonResponse;
|
import xyz.playedu.common.types.JsonResponse;
|
||||||
import xyz.playedu.common.util.RequestUtil;
|
import xyz.playedu.common.util.RequestUtil;
|
||||||
|
|
||||||
@ -38,6 +41,10 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class SystemController {
|
public class SystemController {
|
||||||
|
|
||||||
|
@Autowired private DepartmentService departmentService;
|
||||||
|
|
||||||
|
@Autowired private CategoryService categoryService;
|
||||||
|
|
||||||
@GetMapping("/config")
|
@GetMapping("/config")
|
||||||
@Log(title = "其它-系统配置", businessType = BusinessTypeConstant.GET)
|
@Log(title = "其它-系统配置", businessType = BusinessTypeConstant.GET)
|
||||||
public JsonResponse config() {
|
public JsonResponse config() {
|
||||||
@ -78,6 +85,12 @@ public class SystemController {
|
|||||||
// LDAP登录
|
// LDAP登录
|
||||||
data.put("ldap-enabled", "1".equals(configData.get(ConfigConstant.LDAP_ENABLED)));
|
data.put("ldap-enabled", "1".equals(configData.get(ConfigConstant.LDAP_ENABLED)));
|
||||||
|
|
||||||
|
// 全部部门
|
||||||
|
data.put("departments", departmentService.groupByParent());
|
||||||
|
|
||||||
|
// 全部资源分类
|
||||||
|
data.put("resource_categories", categoryService.groupByParent());
|
||||||
|
|
||||||
return JsonResponse.data(data);
|
return JsonResponse.data(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user