parent
6b3b38e058
commit
58cd959e01
@ -1,34 +1,34 @@ |
||||
* [首页](/?t=1570680160879) |
||||
* [首页](/?t=1571107529420) |
||||
* 开发文档 |
||||
* [快速体验](files/10010_快速体验.md?t=1570680160882) |
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1570680160897) |
||||
* [新增接口](files/10020_新增接口.md?t=1570680160897) |
||||
* [开发流程](files/10021_开发流程.md?t=1570680160897) |
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1570680160897) |
||||
* [错误处理](files/10040_错误处理.md?t=1570680160897) |
||||
* [编写文档](files/10041_编写文档.md?t=1570680160898) |
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1570680160898) |
||||
* [easyopen支持](files/10070_easyopen支持.md?t=1570680160898) |
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1570680160898) |
||||
* [ISV管理](files/10085_ISV管理.md?t=1570680160898) |
||||
* [自定义返回结果](files/10087_自定义返回结果.md?t=1570680160898) |
||||
* [自定义过滤器](files/10088_自定义过滤器.md?t=1570680160898) |
||||
* [路由授权](files/10090_路由授权.md?t=1570680160898) |
||||
* [接口限流](files/10092_接口限流.md?t=1570680160899) |
||||
* [监控日志](files/10093_监控日志.md?t=1570680160899) |
||||
* [SDK开发](files/10095_SDK开发.md?t=1570680160899) |
||||
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1570680160899) |
||||
* [应用授权](files/10097_应用授权.md?t=1570680160899) |
||||
* [提供restful接口](files/10100_提供restful接口.md?t=1570680160899) |
||||
* [文件上传](files/10104_文件上传.md?t=1570680160899) |
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1570680160899) |
||||
* [预发布灰度发布](files/10110_预发布灰度发布.md?t=1570680160899) |
||||
* [动态修改请求参数](files/10111_动态修改请求参数.md?t=1570680160899) |
||||
* [使用eureka](files/10112_使用eureka.md?t=1570680160899) |
||||
* [扩展其它注册中心](files/10113_扩展其它注册中心.md?t=1570680160900) |
||||
* [快速体验](files/10010_快速体验.md?t=1571107529423) |
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1571107529447) |
||||
* [新增接口](files/10020_新增接口.md?t=1571107529447) |
||||
* [开发流程](files/10021_开发流程.md?t=1571107529447) |
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1571107529447) |
||||
* [错误处理](files/10040_错误处理.md?t=1571107529447) |
||||
* [编写文档](files/10041_编写文档.md?t=1571107529447) |
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1571107529448) |
||||
* [easyopen支持](files/10070_easyopen支持.md?t=1571107529448) |
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1571107529448) |
||||
* [ISV管理](files/10085_ISV管理.md?t=1571107529448) |
||||
* [自定义返回结果](files/10087_自定义返回结果.md?t=1571107529448) |
||||
* [自定义过滤器](files/10088_自定义过滤器.md?t=1571107529448) |
||||
* [路由授权](files/10090_路由授权.md?t=1571107529448) |
||||
* [接口限流](files/10092_接口限流.md?t=1571107529448) |
||||
* [监控日志](files/10093_监控日志.md?t=1571107529448) |
||||
* [SDK开发](files/10095_SDK开发.md?t=1571107529449) |
||||
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1571107529449) |
||||
* [应用授权](files/10097_应用授权.md?t=1571107529449) |
||||
* [提供restful接口](files/10100_提供restful接口.md?t=1571107529449) |
||||
* [文件上传](files/10104_文件上传.md?t=1571107529449) |
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1571107529449) |
||||
* [预发布灰度发布](files/10110_预发布灰度发布.md?t=1571107529449) |
||||
* [动态修改请求参数](files/10111_动态修改请求参数.md?t=1571107529450) |
||||
* [使用eureka](files/10112_使用eureka.md?t=1571107529450) |
||||
* [扩展其它注册中心](files/10113_扩展其它注册中心.md?t=1571107529450) |
||||
* 原理分析 |
||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1570680160900) |
||||
* [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1570680160900) |
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1570680160900) |
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1570680160900) |
||||
* [常见问题](files/90100_常见问题.md?t=1570680160900) |
||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1571107529450) |
||||
* [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1571107529450) |
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1571107529450) |
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1571107529450) |
||||
* [常见问题](files/90100_常见问题.md?t=1571107529450) |
||||
|
@ -0,0 +1,23 @@ |
||||
package com.gitee.sop.servercommon.manager; |
||||
|
||||
import org.springframework.core.env.Environment; |
||||
|
||||
/** |
||||
* @author tanghc |
||||
*/ |
||||
public class EnvironmentContext { |
||||
private static Environment environment; |
||||
|
||||
public static Environment getEnvironment() { |
||||
return environment; |
||||
} |
||||
|
||||
public static void setEnvironment(Environment environment) { |
||||
EnvironmentContext.environment = environment; |
||||
} |
||||
|
||||
public static String getValue(String key, String defaultValue) { |
||||
return environment.getProperty(key, defaultValue); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.gitee.sop.servercommon.manager; |
||||
|
||||
import javax.annotation.Nullable; |
||||
|
||||
public enum EnvironmentKeys { |
||||
SPRING_PROFILES_ACTIVE("spring.profiles.active", "default"), |
||||
/** |
||||
* spring.application.name |
||||
*/ |
||||
SPRING_APPLICATION_NAME("spring.application.name"), |
||||
|
||||
/** |
||||
* sop.restful.prefix=xxx,指定web开发模式前缀,不指定默认为service-id |
||||
*/ |
||||
SOP_RESTFUL_PREFIX("sop.restful.prefix"); |
||||
|
||||
private String key; |
||||
private String defaultValue; |
||||
|
||||
public String getKey() { |
||||
return key; |
||||
} |
||||
|
||||
EnvironmentKeys(String key) { |
||||
this.key = key; |
||||
} |
||||
|
||||
EnvironmentKeys(String key, String defaultValue) { |
||||
this.key = key; |
||||
this.defaultValue = defaultValue; |
||||
} |
||||
|
||||
@Nullable |
||||
public String getValue() { |
||||
return EnvironmentContext.getValue(key, defaultValue); |
||||
} |
||||
} |
Loading…
Reference in new issue