@@ -10,64 +10,64 @@ syntax = "v1"
1010)
1111service {{ .ServiceName }} {
1212 @doc (
13- summary: " 查询 {{ .TableComment }}"
13+ summary: " 获取 {{ .TableComment }}"
1414 )
1515 @handler Get{{ .StructName }}
16- get /{{ .RouteName }}/:{{ .IdRawName }} (Get{{ .StructName }}Req ) returns (Get{{ .StructName }}Resp )
16+ get /{{ .RouteName }}/:{{ .IdRawName }} (Get{{ .StructName }}{{ .ReqName }} ) returns (Get{{ .StructName }}{{ .RespName }} )
1717
1818 @doc (
19- summary: " 获取 {{ .TableComment }}分页 "
19+ summary: " 列出 {{ .TableComment }}"
2020 )
21- @handler Paginate {{ .StructName }}
22- get /{{ .RouteName }} (Paginate {{ .StructName }}Req ) returns (Paginate {{ .StructName }}Resp )
21+ @handler List {{ .StructNamePlural }}
22+ get /{{ .RouteName }} (List {{ .StructNamePlural }}{{ .ReqName }} ) returns (List {{ .StructNamePlural }}{{ .RespName }} )
2323
2424 @doc (
2525 summary: " 创建{{ .TableComment }}"
2626 )
2727 @handler Create{{ .StructName }}
28- post /{{ .RouteName }} (Create{{ .StructName }}Req ) returns (Create{{ .StructName }}Resp )
28+ post /{{ .RouteName }} (Create{{ .StructName }}{{ .ReqName }} ) returns (Create{{ .StructName }}{{ .RespName }} )
2929
3030 @doc (
3131 summary: " 更新{{ .TableComment }}"
3232 )
3333 @handler Update{{ .StructName }}
34- put /{{ .RouteName }}/:{{ .IdRawName }} (Update{{ .StructName }}Req ) returns (Update{{ .StructName }}Resp )
34+ put /{{ .RouteName }}/:{{ .IdRawName }} (Update{{ .StructName }}{{ .ReqName }} ) returns (Update{{ .StructName }}{{ .RespName }} )
3535
3636 @doc (
3737 summary: " 删除{{ .TableComment }}"
3838 )
3939 @handler Delete{{ .StructName }}
40- delete /{{ .RouteName }}/:{{ .IdRawName }} (Delete{{ .StructName }}Req ) returns (Delete{{ .StructName }}Resp )
40+ delete /{{ .RouteName }}/:{{ .IdRawName }} (Delete{{ .StructName }}{{ .ReqName }} ) returns (Delete{{ .StructName }}{{ .RespName }} )
4141
4242 @doc (
43- summary: " 部分更新 {{ .TableComment }}"
43+ summary: " 修补 {{ .TableComment }}"
4444 )
4545 @handler Patch{{ .StructName }}
46- patch /{{ .RouteName }}/:{{ .IdRawName }} (Patch{{ .StructName }}Req ) returns (Patch{{ .StructName }}Resp )
46+ patch /{{ .RouteName }}/:{{ .IdRawName }} (Patch{{ .StructName }}{{ .ReqName }} ) returns (Patch{{ .StructName }}{{ .RespName }} )
4747
4848 @doc (
49- summary: " 获取 {{ .TableComment }}列表 "
49+ summary: " 批量获取 {{ .TableComment }}"
5050 )
51- @handler List {{ .StructName }}
52- post /{{ .RouteName }}/list (List {{ .StructName }}Req ) returns (List {{ .StructName }}Resp )
51+ @handler BatchGet {{ .StructNamePlural }}
52+ post /{{ .RouteName }}/batch{{ .Delimiter }}get (BatchGet {{ .StructNamePlural }}{{ .ReqName }} ) returns (BatchGet {{ .StructNamePlural }}{{ .RespName }} )
5353
5454 @doc (
5555 summary: " 批量创建{{ .TableComment }}"
5656 )
57- @handler Create {{ .StructNamePlural }}
58- post /{{ .RouteName }}/batch/ create (Create {{ .StructNamePlural }}Req ) returns (Create {{ .StructNamePlural }}Resp )
57+ @handler BatchCreate {{ .StructNamePlural }}
58+ post /{{ .RouteName }}/batch{{ .Delimiter }} create (BatchCreate {{ .StructNamePlural }}{{ .ReqName }} ) returns (BatchCreate {{ .StructNamePlural }}{{ .RespName }} )
5959
6060 @doc (
6161 summary: " 批量更新{{ .TableComment }}"
6262 )
63- @handler Update {{ .StructNamePlural }}
64- post /{{ .RouteName }}/batch/ update (Update {{ .StructNamePlural }}Req ) returns (Update {{ .StructNamePlural }}Resp )
63+ @handler BatchUpdate {{ .StructNamePlural }}
64+ post /{{ .RouteName }}/batch{{ .Delimiter }} update (BatchUpdate {{ .StructNamePlural }}{{ .ReqName }} ) returns (BatchUpdate {{ .StructNamePlural }}{{ .RespName }} )
6565
6666 @doc (
6767 summary: " 批量删除{{ .TableComment }}"
6868 )
69- @handler Delete {{ .StructNamePlural }}
70- post /{{ .RouteName }}/batch/ delete (Delete {{ .StructNamePlural }}Req ) returns (Delete {{ .StructNamePlural }}Resp )
69+ @handler BatchDelete {{ .StructNamePlural }}
70+ post /{{ .RouteName }}/batch{{ .Delimiter }} delete (BatchDelete {{ .StructNamePlural }}{{ .ReqName }} ) returns (BatchDelete {{ .StructNamePlural }}{{ .RespName }} )
7171}
7272
7373// -------------------- {{ .TableComment }} {{ .StructName }} -------------------- //
@@ -76,113 +76,113 @@ type {{ .StructName }} {
7676 {{ .StructInfo }}
7777}
7878
79- // Get{{ .StructName }}Req 查询 {{ .TableComment }}请求
80- type Get{{ .StructName }}Req {
79+ // Get{{ .StructName }}{{ .ReqName }} 获取 {{ .TableComment }}请求
80+ type Get{{ .StructName }}{{ .ReqName }} {
8181 {{ .IdName }} {{ .IdType }} ` path:"{{ .IdRawName }}" validate:"required" label:"{{ .IdLabel }}"` // {{ .IdComment }}
8282}
8383
84- // Get{{ .StructName }}Resp 查询 {{ .TableComment }}响应
85- type Get{{ .StructName }}Resp {
84+ // Get{{ .StructName }}{{ .RespName }} 获取 {{ .TableComment }}响应
85+ type Get{{ .StructName }}{{ .RespName }} {
8686 {{ .StructName }}
8787}
8888
89- // Paginate {{ .StructName }}Req 获取 {{ .TableComment }}分页请求
90- type Paginate {{ .StructName }}Req {
89+ // List {{ .StructNamePlural }}{{ .ReqName }} 列出 {{ .TableComment }}请求
90+ type List {{ .StructNamePlural }}{{ .ReqName }} {
9191 {{ .StructGetInfo }}
9292 Page int64 ` form:"page" validate:"required" label:"页数"` // 页数
9393 PageSize int64 ` form:"page_size" validate:"required" label:"每条页数"` // 每条页数
9494}
9595
96- // Paginate {{ .StructName }}Resp 获取 {{ .TableComment }}分页响应
97- type Paginate {{ .StructName }}Resp {
96+ // List {{ .StructNamePlural }}{{ .RespName }} 列出 {{ .TableComment }}响应
97+ type List {{ .StructNamePlural }}{{ .RespName }} {
9898 Count int64 ` json:"count"` // 总数
9999 PageCount int64 ` json:"page_count"` // 页数
100100 Results []*{{ .StructName }} ` json:"results"` // 结果
101101}
102102
103- // Create{{ .StructName }}Req 创建{{ .TableComment }}请求
104- type Create{{ .StructName }}Req {
103+ // Create{{ .StructName }}{{ .ReqName }} 创建{{ .TableComment }}请求
104+ type Create{{ .StructName }}{{ .ReqName }} {
105105 {{ .StructCreateInfo }}
106106}
107107
108- // Create{{ .StructName }}Resp 创建{{ .TableComment }}响应
109- type Create{{ .StructName }}Resp {
108+ // Create{{ .StructName }}{{ .RespName }} 创建{{ .TableComment }}响应
109+ type Create{{ .StructName }}{{ .RespName }} {
110110 {{ .StructName }}
111111}
112112
113- // Update{{ .StructName }}Req 更新{{ .TableComment }}请求
114- type Update{{ .StructName }}Req {
113+ // Update{{ .StructName }}{{ .ReqName }} 更新{{ .TableComment }}请求
114+ type Update{{ .StructName }}{{ .ReqName }} {
115115 {{ .StructUpdateInfo }}
116116}
117117
118- // Update{{ .StructName }}Resp 更新{{ .TableComment }}响应
119- type Update{{ .StructName }}Resp {
118+ // Update{{ .StructName }}{{ .RespName }} 更新{{ .TableComment }}响应
119+ type Update{{ .StructName }}{{ .RespName }} {
120120 {{ .StructName }}
121121}
122122
123- // Delete{{ .StructName }}Req 删除{{ .TableComment }}请求
124- type Delete{{ .StructName }}Req {
123+ // Delete{{ .StructName }}{{ .ReqName }} 删除{{ .TableComment }}请求
124+ type Delete{{ .StructName }}{{ .ReqName }} {
125125 {{ .IdName }} {{ .IdType }} ` path:"{{ .IdRawName }}" validate:"required" label:"{{ .IdLabel }}"` // {{ .IdComment }}
126126}
127127
128- // Delete{{ .StructName }}Resp 删除{{ .TableComment }}响应
129- type Delete{{ .StructName }}Resp {
128+ // Delete{{ .StructName }}{{ .RespName }} 删除{{ .TableComment }}响应
129+ type Delete{{ .StructName }}{{ .RespName }} {
130130 {{ .IdName }} {{ .IdType }} ` json:"{{ .IdRawName }}"` // {{ .IdComment }}
131131}
132132
133- // Patch{{ .StructName }}Req 部分更新 {{ .TableComment }}请求
134- type Patch{{ .StructName }}Req {
133+ // Patch{{ .StructName }}{{ .ReqName }} 修补 {{ .TableComment }}请求
134+ type Patch{{ .StructName }}{{ .ReqName }} {
135135 {{ .StructUpdateInfo }}
136136}
137137
138- // Patch{{ .StructName }}Resp 部分更新 {{ .TableComment }}响应
139- type Patch{{ .StructName }}Resp {
138+ // Patch{{ .StructName }}{{ .RespName }} 修补 {{ .TableComment }}响应
139+ type Patch{{ .StructName }}{{ .RespName }} {
140140 {{ .StructName }}
141141}
142142
143- // {{ .StructName }}Filter {{ .TableComment }}筛选参数
143+ // {{ .StructName }}Filter {{ .TableComment }}过滤参数
144144type {{ .StructName }}Filter {
145145 {{ .IdNamePlural }} []{{ .IdType }} ` json:"{{ .IdRawNamePlural }},optional"` // {{ .IdComment }}列表
146146 {{ .StructFilterInfo }}
147147}
148148
149- // List {{ .StructName }}Req 获取 {{ .TableComment }}列表请求
150- type List {{ .StructName }}Req {
151- Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}筛选参数
149+ // BatchGet {{ .StructNamePlural }}{{ .ReqName }} 批量获取 {{ .TableComment }}请求
150+ type BatchGet {{ .StructNamePlural }}{{ .ReqName }} {
151+ Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}过滤参数
152152}
153153
154- // List {{ .StructName }}Resp 获取 {{ .TableComment }}列表响应
155- type List {{ .StructName }}Resp {
154+ // BatchGet {{ .StructNamePlural }}{{ .RespName }} 批量获取 {{ .TableComment }}响应
155+ type BatchGet {{ .StructNamePlural }}{{ .RespName }} {
156156 Results []*{{ .StructName }} ` json:"results"` // 结果
157157}
158158
159- // Create {{ .StructNamePlural }}Req 批量创建{{ .TableComment }}请求
160- type Create {{ .StructNamePlural }}Req {
161- Objects []*Create{{ .StructName }}Req ` json:"objects" validate:"gt=0,dive" label:"{{ .TableComment }}列表"` // {{ .TableComment }}列表
159+ // BatchCreate {{ .StructNamePlural }}{{ .ReqName }} 批量创建{{ .TableComment }}请求
160+ type BatchCreate {{ .StructNamePlural }}{{ .ReqName }} {
161+ Objects []*Create{{ .StructName }}{{ .ReqName }} ` json:"objects" validate:"gt=0,dive" label:"{{ .TableComment }}列表"` // {{ .TableComment }}列表
162162}
163163
164- // Create {{ .StructNamePlural }}Resp 批量创建{{ .TableComment }}响应
165- type Create {{ .StructNamePlural }}Resp {
164+ // BatchCreate {{ .StructNamePlural }}{{ .RespName }} 批量创建{{ .TableComment }}响应
165+ type BatchCreate {{ .StructNamePlural }}{{ .RespName }} {
166166 Results []*{{ .StructName }} ` json:"results"` // 结果
167167}
168168
169- // Update {{ .StructNamePlural }}Req 批量更新{{ .TableComment }}请求
170- type Update {{ .StructNamePlural }}Req {
171- Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}筛选参数
169+ // BatchUpdate {{ .StructNamePlural }}{{ .ReqName }} 批量更新{{ .TableComment }}请求
170+ type BatchUpdate {{ .StructNamePlural }}{{ .ReqName }} {
171+ Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}过滤参数
172172 {{ .StructBatchUpdateInfo }}
173173}
174174
175- // Update {{ .StructNamePlural }}Resp 批量更新{{ .TableComment }}响应
176- type Update {{ .StructNamePlural }}Resp {
175+ // BatchUpdate {{ .StructNamePlural }}{{ .RespName }} 批量更新{{ .TableComment }}响应
176+ type BatchUpdate {{ .StructNamePlural }}{{ .RespName }} {
177177 Affected int64 ` json:"affected"` // 影响数量
178178}
179179
180- // Delete {{ .StructNamePlural }}Req 批量删除{{ .TableComment }}请求
181- type Delete {{ .StructNamePlural }}Req {
182- Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}筛选参数
180+ // BatchDelete {{ .StructNamePlural }}{{ .ReqName }} 批量删除{{ .TableComment }}请求
181+ type BatchDelete {{ .StructNamePlural }}{{ .ReqName }} {
182+ Filter {{ .StructName }}Filter ` json:"filter"` // {{ .TableComment }}过滤参数
183183}
184184
185- // Delete {{ .StructNamePlural }}Resp 批量删除{{ .TableComment }}响应
186- type Delete {{ .StructNamePlural }}Resp {
185+ // BatchDelete {{ .StructNamePlural }}{{ .RespName }} 批量删除{{ .TableComment }}响应
186+ type BatchDelete {{ .StructNamePlural }}{{ .RespName }} {
187187 Affected int64 ` json:"affected"` // 影响数量
188188}
0 commit comments