From 1970c22e2a59906f7bd62bdc1a1ac504cf0adf9f Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 22 Mar 2022 15:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0APP=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/api/config/ConfigAppController.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main/java/cn/com/tenlion/usercenter/controller/app/api/config/ConfigAppController.java diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/app/api/config/ConfigAppController.java b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/config/ConfigAppController.java new file mode 100644 index 0000000..55c2b93 --- /dev/null +++ b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/config/ConfigAppController.java @@ -0,0 +1,39 @@ +package cn.com.tenlion.usercenter.controller.app.api.config; + +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.login.base.manager.ConfigManager; +import ink.wgink.pojo.result.ErrorResult; +import io.swagger.annotations.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName: ConfigAppController + * @Description: 业务 + * @Author: CodeFactory + * @Date: 2021-11-03 21:32:52 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "配置接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/config") +public class ConfigAppController extends DefaultBaseController { + + @ApiOperation(value = "获取配置", notes = "获取配置接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-config") + public Map getConfig(@RequestHeader("token") String token) { + Map configParams = ConfigManager.getInstance().getAppConfigParams(); + return configParams == null ? new HashMap<>(0) : configParams; + } + +} \ No newline at end of file