Skip to content

Commit fa49d02

Browse files
committed
Merge branch 'dev' of https://github.com/iohao/ioGame into dev
2 parents 512b776 + c932663 commit fa49d02

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

widget/light-jprotobuf/src/main/java/com/iohao/game/widget/light/protobuf/ProtoJavaAnalyse.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,13 @@ private String fieldProtoTypeToString(ProtoJavaField protoJavaField, Class<?> fi
209209
ProtoJavaRegionKey regionKey = protoJavaParent.getProtoJavaRegionKey();
210210
ProtoJavaRegion protoJavaRegion = this.getProtoJavaRegion(regionKey);
211211
protoJavaRegion.addOtherProtoFile(protoJavaFieldType);
212-
// 不在同一个文件中
213-
fieldProtoType = StrKit.format("{}.{}", filePackage, className);
212+
if (Objects.equals(protoJavaParent.getFilePackage(), filePackage)) {
213+
// 不在同一个文件夹,但是在同一个包下
214+
fieldProtoType = className;
215+
} else {
216+
// 不在同一个文件中
217+
fieldProtoType = StrKit.format("{}.{}", filePackage, className);
218+
}
214219
}
215220

216221
return fieldProtoType;

widget/light-profile/src/main/java/com/iohao/game/widget/light/profile/ProfileManager.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import lombok.experimental.UtilityClass;
2222
import lombok.extern.slf4j.Slf4j;
23+
import org.apache.commons.lang.StringUtils;
2324

2425
import java.net.URL;
2526
import java.util.*;
@@ -35,7 +36,9 @@
3536
@Slf4j
3637
@UtilityClass
3738
public final class ProfileManager {
38-
/** 主配置key */
39+
/**
40+
* 主配置key
41+
*/
3942
final String MAIN_CONFIG = "main_config";
4043
/**
4144
* <pre>
@@ -100,6 +103,14 @@ public void loadMainProfile(String profileConfigName) {
100103
Profile profile = profile();
101104
profile.load(urlList);
102105

106+
// 检查环境变量是否同名的参数 如果有则覆盖
107+
profile.map.forEach((key, value) -> {
108+
String envValue = System.getenv(key);
109+
if (StringUtils.isNotEmpty(envValue)) {
110+
profile.map.put(key, envValue);
111+
}
112+
});
113+
103114
log.debug("配置内容 - size:{} - {}", ProfileManager.profile().map.size(), ProfileManager.profile());
104115

105116
}

0 commit comments

Comments
 (0)