Skip to content

Commit

Permalink
ref[csharp]: refactor generate csharp protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed May 22, 2024
1 parent 7fedbe5 commit ab3ca0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions net/src/main/java/com/zfoo/net/config/model/NetConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class NetConfig {
/**
* {@link GenerateOperation}
*/
private boolean mergerProtocol;
private boolean mergeProtocol;
/**
* {@link GenerateOperation}
*/
Expand Down Expand Up @@ -81,12 +81,12 @@ public void setProtocolLocation(String protocolLocation) {
this.protocolLocation = protocolLocation;
}

public boolean isMergerProtocol() {
return mergerProtocol;
public boolean isMergeProtocol() {
return mergeProtocol;
}

public void setMergerProtocol(boolean mergerProtocol) {
this.mergerProtocol = mergerProtocol;
public void setMergeProtocol(boolean mergeProtocol) {
this.mergeProtocol = mergeProtocol;
}

public boolean isFoldProtocol() {
Expand Down
2 changes: 1 addition & 1 deletion net/src/main/java/com/zfoo/net/packet/PacketService.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void init() {
var protocolLocation = netConfig.getProtocolLocation();

var generateOperation = new GenerateOperation();
generateOperation.setMergeProtocol(netConfig.isMergerProtocol());
generateOperation.setMergeProtocol(netConfig.isMergeProtocol());
generateOperation.setFoldProtocol(netConfig.isFoldProtocol());
generateOperation.setProtocolPath(netConfig.getProtocolPath());
generateOperation.setProtocolParam(netConfig.getProtocolParam());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void parseNetConfig(Element element, ParserContext parserContext) {
resolvePlaceholder("protocol-location", "protocolLocation", builder, element, parserContext);

// 协议文件是否生成在同一个协议文件中
resolvePlaceholder("merger-protocol", "mergerProtocol", builder, element, parserContext);
resolvePlaceholder("merge-protocol", "mergeProtocol", builder, element, parserContext);
// 文件是否折叠
resolvePlaceholder("fold-protocol", "foldProtocol", builder, element, parserContext);
// 生成各种语言的协议列表
Expand Down
2 changes: 1 addition & 1 deletion net/src/main/resources/net-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="protocol-location" type="xsd:string" use="required"/>
<xsd:attribute name="merger-protocol" type="xsd:boolean" default="false"/>
<xsd:attribute name="merge-protocol" type="xsd:boolean" default="false"/>
<xsd:attribute name="fold-protocol" type="xsd:boolean" default="false"/>
<xsd:attribute name="code-languages" type="xsd:string"/>
<xsd:attribute name="protocol-path" type="xsd:string"/>
Expand Down

0 comments on commit ab3ca0e

Please sign in to comment.