mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-19 21:26:08 +00:00
feat[go]: 支持golang协议生成的xsd配置
This commit is contained in:
@@ -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);
|
||||
|
||||
// 文件是否折叠
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user