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