Skip to content

Commit aa05446

Browse files
committed
feat(generate-code): #452
1 parent 078bb45 commit aa05446

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

widget/generate-code/src/main/java/com/iohao/game/action/skeleton/core/doc/CsharpDocumentGenerate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ protected void generateAction(IoGameDocument ioGameDocument) {
8383

8484
actionDocumentList.forEach(actionDocument -> {
8585
Template template = ofTemplate("action.txt");
86-
// using、namespace
87-
// template.binding("using", String.join("\n", this.actionImportList));
8886
template.binding("namespace", this.namespace);
87+
template.binding("publicActionCmdName", this.publicActionCmdName ? "public" : "private");
8988

9089
new ActionGenerate()
9190
.setActionDocument(actionDocument)

widget/generate-code/src/main/java/com/iohao/game/action/skeleton/core/doc/DocumentGenerateAbout.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ abstract class AbstractDocumentGenerate implements DocumentGenerate {
418418
/** your .proto path */
419419
@Deprecated
420420
String protoImportPath;
421+
boolean publicActionCmdName;
421422
/**
422423
* The storage path of the generated files.
423424
* By default, it will be generated in the ./target/action directory

widget/generate-code/src/main/java/com/iohao/game/action/skeleton/core/doc/TypeScriptDocumentGenerate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ protected void generateAction(IoGameDocument ioGameDocument) {
133133
Template template = ofTemplate(DocumentGenerateKit.actionTemplatePath);
134134
// imports
135135
template.binding("imports", imports);
136+
template.binding("publicActionCmdName", this.publicActionCmdName ? "public" : "private");
136137

137138
new ActionGenerate()
138139
.setActionDocument(actionDocument)

widget/generate-code/src/main/resources/generate/csharp/action.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace ${namespace}
1515
public static class ${ActionName}
1616
{
1717
<%for(o in actionMemberCmdDocumentList) {%>
18-
private static readonly int ${o.memberName} = CmdKit.MappingRequest(${o.cmdMerge}, "${o.comment}");
18+
${publicActionCmdName} static readonly int ${o.memberName} = CmdKit.MappingRequest(${o.cmdMerge}, "${o.comment}");
1919
<%}%>
2020

2121
<%for(o in methodCodeList) {%>

widget/generate-code/src/main/resources/generate/ts/action.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {CmdKit, RequestCommand, ResponseResult} from "iohao-sdk";
1010
*/
1111
export class ${ActionName} {
1212
<%for(o in actionMemberCmdDocumentList) {%>
13-
private static readonly ${o.memberName}: number = CmdKit.mappingRequest(${o.cmdMerge}, "${o.comment}");
13+
${publicActionCmdName} static readonly ${o.memberName}: number = CmdKit.mappingRequest(${o.cmdMerge}, "${o.comment}");
1414
<%}%>
1515
<%for(o in methodCodeList) {%>
1616
${o}

0 commit comments

Comments
 (0)