Skip to content

Commit 5a91d1d

Browse files
committed
feat: add enum
1 parent 3c31650 commit 5a91d1d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

client/cli/new/new.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ func Run(ctx *cli.Context) error {
196196
{"handler/" + dir + "_handler.go", tmpl.HandlerAPISRV},
197197
{"../proto/" + dir + "/" + dir + ".proto", tmpl.ProtoModelSRV},
198198
{"../proto/" + dir + "/handler.proto", tmpl.ProtoServiceSRV},
199+
{"../proto/" + dir + "/enum.proto", tmpl.EnumSRV},
199200
{"Dockerfile", tmpl.DockerSRV},
200201
{"Makefile", tmpl.Makefile},
201202
{"README.md", tmpl.Readme},

client/cli/new/template/proto.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ message UpdateInfoResponse {
5151
message QueryInfoRequest {
5252
uint32 id = 1 [json_name = "id"];
5353
string name = 2 [json_name = "name"];
54-
5554
int32 page = 3 [json_name = "page"];
5655
int32 size = 4 [json_name = "size"];
57-
int32 order = 5 [json_name = "order"];
56+
int32 order_type = 5 [json_name = "order_type"];
57+
string order_col = 6 [json_name = "order_col"];
5858
}
5959
6060
message QueryInfoResponseItem {
@@ -78,5 +78,16 @@ message QueryInfoDetailResponse {
7878
uint32 id = 1 [json_name = "id"];
7979
string name = 2 [json_name = "name"];
8080
}
81+
`
82+
83+
EnumSRV = `syntax = "proto3";
84+
85+
package {{dehyphen .Alias}};
86+
87+
option go_package = "./proto;{{dehyphen .Alias}}";
88+
89+
enum InfoType {
90+
None = 0;
91+
}
8192
`
8293
)

0 commit comments

Comments
 (0)