mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 14:17:56 +00:00
perf[protocol]: 支持TypeScript
This commit is contained in:
1 parent
1fa4ff032e
commit
cf87e673a5
11 files changed
+27
-11
No files matched your search
@@ -36,6 +36,7 @@ public class NetConfig {
|
||||
private String protocolParam;
|
||||
// 是否生成对应语言的协议
|
||||
private boolean javascriptProtocol;
|
||||
private boolean typescriptProtocol;
|
||||
private boolean csharpProtocol;
|
||||
private boolean luaProtocol;
|
||||
private boolean gdscriptProtocol;
|
||||
@@ -173,6 +174,14 @@ public class NetConfig {
|
||||
this.cppProtocol = cppProtocol;
|
||||
}
|
||||
|
||||
public boolean isTypescriptProtocol() {
|
||||
return typescriptProtocol;
|
||||
}
|
||||
|
||||
public void setTypescriptProtocol(boolean typescriptProtocol) {
|
||||
this.typescriptProtocol = typescriptProtocol;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
||||
@@ -90,6 +90,9 @@ public class PacketService implements IPacketService {
|
||||
if (netConfig.isJavascriptProtocol()) {
|
||||
generateOperation.getGenerateLanguages().add(CodeLanguage.JavaScript);
|
||||
}
|
||||
if (netConfig.isTypescriptProtocol()) {
|
||||
generateOperation.getGenerateLanguages().add(CodeLanguage.TypeScript);
|
||||
}
|
||||
if (netConfig.isCsharpProtocol()) {
|
||||
generateOperation.getGenerateLanguages().add(CodeLanguage.CSharp);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ public class NetDefinitionParser implements BeanDefinitionParser {
|
||||
resolvePlaceholder("id", "id", builder, element, parserContext);
|
||||
resolvePlaceholder("protocol-location", "protocolLocation", builder, element, parserContext);
|
||||
resolvePlaceholder("javascript-protocol", "javascriptProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("typescript-protocol", "typescriptProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("csharp-protocol", "csharpProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("lua-protocol", "luaProtocol", builder, element, parserContext);
|
||||
resolvePlaceholder("gdscript-protocol", "gdscriptProtocol", builder, element, parserContext);
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<xsd:attribute name="id" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="protocol-location" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="javascript-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="typescript-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="csharp-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="lua-protocol" type="xsd:string" default="false"/>
|
||||
<xsd:attribute name="gdscript-protocol" type="xsd:string" default="false"/>
|
||||
|
||||
Reference in new issue
Block a user