增加APP配置获取接口
This commit is contained in:
parent
c2a8dbba0e
commit
1970c22e2a
@ -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<String, String> getConfig(@RequestHeader("token") String token) {
|
||||
Map<String, String> configParams = ConfigManager.getInstance().getAppConfigParams();
|
||||
return configParams == null ? new HashMap<>(0) : configParams;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user