feat[go]: 支持golang协议生成的xsd配置

This commit is contained in:
godotg
2022-09-15 17:35:37 +08:00
parent 400066262f
commit bf41b85d7b
4 changed files with 14 additions and 0 deletions
@@ -42,6 +42,7 @@ public class NetConfig {
private boolean luaProtocol;
private boolean gdscriptProtocol;
private boolean cppProtocol;
private boolean goProtocol;
private boolean protobufProtocol;
/**
@@ -197,6 +198,14 @@ public class NetConfig {
this.typescriptProtocol = typescriptProtocol;
}
public boolean isGoProtocol() {
return goProtocol;
}
public void setGoProtocol(boolean goProtocol) {
this.goProtocol = goProtocol;
}
@Override
public boolean equals(Object o) {
if (this == o) {
@@ -105,6 +105,9 @@ public class PacketService implements IPacketService {
if (netConfig.isCppProtocol()) {
generateOperation.getGenerateLanguages().add(CodeLanguage.Cpp);
}
if (netConfig.isGoProtocol()) {
generateOperation.getGenerateLanguages().add(CodeLanguage.Go);
}
if (netConfig.isProtobufProtocol()) {
generateOperation.getGenerateLanguages().add(CodeLanguage.Protobuf);
}
@@ -109,6 +109,7 @@ public class NetDefinitionParser implements BeanDefinitionParser {
resolvePlaceholder("lua-protocol", "luaProtocol", builder, element, parserContext);
resolvePlaceholder("gdscript-protocol", "gdscriptProtocol", builder, element, parserContext);
resolvePlaceholder("cpp-protocol", "cppProtocol", builder, element, parserContext);
resolvePlaceholder("go-protocol", "goProtocol", builder, element, parserContext);
resolvePlaceholder("protobuf-protocol", "protobufProtocol", builder, element, parserContext);
// 文件是否折叠
+1
View File
@@ -72,6 +72,7 @@
<xsd:attribute name="lua-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="gdscript-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="cpp-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="go-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="protobuf-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="fold-protocol" type="xsd:string" default="false"/>
<xsd:attribute name="protocol-path" type="xsd:string"/>