|
@@ -0,0 +1,47 @@
|
|
|
+package com.ym.mec.student.controller;
|
|
|
+
|
|
|
+import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
+import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+import com.ym.mec.biz.service.SysTenantConfigService;
|
|
|
+import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 系统配置控制层
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@Api(tags = "系统参数设置")
|
|
|
+@RequestMapping(value = "sysTenantConfig")
|
|
|
+public class SysTenantConfigController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SysTenantConfigService sysTenantConfigService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserFeignService sysUserFeignService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "参数列表")
|
|
|
+ @GetMapping(value = "queryAll")
|
|
|
+ public Object queryAll(String group) {
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ Map<String,Object> params = new HashMap<String, Object>(2);
|
|
|
+ params.put("group", group);
|
|
|
+ params.put("tenantId", sysUser.getTenantId());
|
|
|
+ return succeed(sysTenantConfigService.queryAll(params));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取单个配置")
|
|
|
+ @PostMapping(value = "findByName")
|
|
|
+ public Object findByName(String configName) {
|
|
|
+ return succeed(sysTenantConfigService.getTenantConfigValue(configName,TenantContextHolder.getTenantId()));
|
|
|
+ }
|
|
|
+}
|