Skip to content

Commit 8152be7

Browse files
committed
docs: update api document
1 parent e08b237 commit 8152be7

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

api/serverNameExample/v1/userExample.proto

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
3838
}
3939
};
4040

41-
service UserExample {
42-
// create a new userExample
41+
service userExample {
42+
// Create a new userExample
4343
rpc Create(CreateUserExampleRequest) returns (CreateUserExampleReply) {
4444
option (google.api.http) = {
4545
post: "/api/v1/userExample"
4646
body: "*"
4747
};
4848
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
49-
summary: "create a new userExample";
49+
summary: "Create a new userExample";
5050
description: "Creates a new userExample entity using the provided data in the request body.";
5151
};
5252
}
5353

54-
// delete a userExample by id
54+
// Delete a userExample by id
5555
rpc DeleteByID(DeleteUserExampleByIDRequest) returns (DeleteUserExampleByIDReply) {
5656
option (google.api.http) = {
5757
delete: "/api/v1/userExample/{id}"
5858
};
5959
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
60-
summary: "delete a userExample by id";
60+
summary: "Delete a userExample by id";
6161
description: "Deletes a existing userExample identified by the given id in the path.";
6262
//security: {
6363
// security_requirement: {
@@ -68,14 +68,14 @@ service UserExample {
6868
};
6969
}
7070

71-
// update a userExample by id
71+
// Update a userExample by id
7272
rpc UpdateByID(UpdateUserExampleByIDRequest) returns (UpdateUserExampleByIDReply) {
7373
option (google.api.http) = {
7474
put: "/api/v1/userExample/{id}"
7575
body: "*"
7676
};
7777
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
78-
summary: "update a userExample by id";
78+
summary: "Update a userExample by id";
7979
description: "Updates the specified userExample with new data provided in the request body. The target is identified by id in the path.";
8080
//security: {
8181
// security_requirement: {
@@ -86,13 +86,13 @@ service UserExample {
8686
};
8787
}
8888

89-
// get userExample details by id
89+
// Get a userExample by id
9090
rpc GetByID(GetUserExampleByIDRequest) returns (GetUserExampleByIDReply) {
9191
option (google.api.http) = {
9292
get: "/api/v1/userExample/{id}"
9393
};
9494
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
95-
summary: "get userExample details by id";
95+
summary: "Get a userExample by id";
9696
description: "Gets detailed information of a userExample specified by the given id in the path.";
9797
//security: {
9898
// security_requirement: {

pkg/sql2code/parser/template.go

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -104,32 +104,32 @@ import "validate/validate.proto";
104104
105105
option go_package = "github.com/go-dev-frame/sponge/api/serverNameExample/v1;v1";
106106
107-
service {{.TableName}} {
108-
// create a new {{.TName}}
107+
service {{.TName}} {
108+
// Create a new {{.TName}}
109109
rpc Create(Create{{.TableName}}Request) returns (Create{{.TableName}}Reply) {}
110110
111-
// delete a {{.TName}} by id
111+
// Delete a {{.TName}} by id
112112
rpc DeleteByID(Delete{{.TableName}}ByIDRequest) returns (Delete{{.TableName}}ByIDReply) {}
113113
114-
// update a {{.TName}} by id
114+
// Update a {{.TName}} by id
115115
rpc UpdateByID(Update{{.TableName}}ByIDRequest) returns (Update{{.TableName}}ByIDReply) {}
116116
117-
// get {{.TName}} details by id
117+
// Get a {{.TName}} by id
118118
rpc GetByID(Get{{.TableName}}ByIDRequest) returns (Get{{.TableName}}ByIDReply) {}
119119
120-
// get a list of {{.TName}} by custom conditions
120+
// Get a paginated list of {{.TName}} by custom conditions
121121
rpc List(List{{.TableName}}Request) returns (List{{.TableName}}Reply) {}
122122
123-
// delete {{.TName}} by batch id
123+
// Batch delete {{.TName}} by ids
124124
rpc DeleteByIDs(Delete{{.TableName}}ByIDsRequest) returns (Delete{{.TableName}}ByIDsReply) {}
125125
126-
// get {{.TName}} details by custom condition
126+
// Get a {{.TName}} by custom condition
127127
rpc GetByCondition(Get{{.TableName}}ByConditionRequest) returns (Get{{.TableName}}ByConditionReply) {}
128128
129-
// get a list of {{.TName}} by batch id
129+
// Batch get {{.TName}} by ids
130130
rpc ListByIDs(List{{.TableName}}ByIDsRequest) returns (List{{.TableName}}ByIDsReply) {}
131131
132-
// get a list of {{.TName}} by last id
132+
// Get a paginated list of {{.TName}} by last id
133133
rpc ListByLastID(List{{.TableName}}ByLastIDRequest) returns (List{{.TableName}}ByLastIDReply) {}
134134
}
135135
@@ -227,20 +227,20 @@ import "validate/validate.proto";
227227
228228
option go_package = "github.com/go-dev-frame/sponge/api/serverNameExample/v1;v1";
229229
230-
service {{.TableName}} {
231-
// create a new {{.TName}}
230+
service {{.TName}} {
231+
// Create a new {{.TName}}
232232
rpc Create(Create{{.TableName}}Request) returns (Create{{.TableName}}Reply) {}
233233
234-
// delete a {{.TName}} by id
234+
// Delete a {{.TName}} by id
235235
rpc DeleteByID(Delete{{.TableName}}ByIDRequest) returns (Delete{{.TableName}}ByIDReply) {}
236236
237-
// update a {{.TName}} by id
237+
// Update a {{.TName}} by id
238238
rpc UpdateByID(Update{{.TableName}}ByIDRequest) returns (Update{{.TableName}}ByIDReply) {}
239239
240-
// get {{.TName}} details by id
240+
// Get a {{.TName}} by id
241241
rpc GetByID(Get{{.TableName}}ByIDRequest) returns (Get{{.TableName}}ByIDReply) {}
242242
243-
// get a list of {{.TName}} by custom conditions
243+
// Get a paginated list of {{.TName}} by custom conditions
244244
rpc List(List{{.TableName}}Request) returns (List{{.TableName}}Reply) {}
245245
}
246246
@@ -345,70 +345,70 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
345345
}
346346
};
347347
348-
service {{.TableName}} {
349-
// create a new {{.TName}}
348+
service {{.TName}} {
349+
// Create a new {{.TName}}
350350
rpc Create(Create{{.TableName}}Request) returns (Create{{.TableName}}Reply) {
351351
option (google.api.http) = {
352352
post: "/api/v1/{{.TName}}"
353353
body: "*"
354354
};
355355
}
356356
357-
// delete a {{.TName}} by id
357+
// Delete a {{.TName}} by id
358358
rpc DeleteByID(Delete{{.TableName}}ByIDRequest) returns (Delete{{.TableName}}ByIDReply) {
359359
option (google.api.http) = {
360360
delete: "/api/v1/{{.TName}}/{id}"
361361
};
362362
}
363363
364-
// update a {{.TName}} by id
364+
// Update a {{.TName}} by id
365365
rpc UpdateByID(Update{{.TableName}}ByIDRequest) returns (Update{{.TableName}}ByIDReply) {
366366
option (google.api.http) = {
367367
put: "/api/v1/{{.TName}}/{id}"
368368
body: "*"
369369
};
370370
}
371371
372-
// get {{.TName}} details by id
372+
// Get a {{.TName}} by id
373373
rpc GetByID(Get{{.TableName}}ByIDRequest) returns (Get{{.TableName}}ByIDReply) {
374374
option (google.api.http) = {
375375
get: "/api/v1/{{.TName}}/{id}"
376376
};
377377
}
378378
379-
// get a list of {{.TName}} by custom conditions
379+
// Get a paginated list of {{.TName}} by custom conditions
380380
rpc List(List{{.TableName}}Request) returns (List{{.TableName}}Reply) {
381381
option (google.api.http) = {
382382
post: "/api/v1/{{.TName}}/list"
383383
body: "*"
384384
};
385385
}
386386
387-
// delete {{.TName}} by batch id
387+
// Batch delete {{.TName}} by ids
388388
rpc DeleteByIDs(Delete{{.TableName}}ByIDsRequest) returns (Delete{{.TableName}}ByIDsReply) {
389389
option (google.api.http) = {
390390
post: "/api/v1/{{.TName}}/delete/ids"
391391
body: "*"
392392
};
393393
}
394394
395-
// get {{.TName}} details by custom condition
395+
// Get a {{.TName}} by custom condition
396396
rpc GetByCondition(Get{{.TableName}}ByConditionRequest) returns (Get{{.TableName}}ByConditionReply) {
397397
option (google.api.http) = {
398398
post: "/api/v1/{{.TName}}/condition"
399399
body: "*"
400400
};
401401
}
402402
403-
// get a list of {{.TName}} by batch id
403+
// Batch get {{.TName}} by ids
404404
rpc ListByIDs(List{{.TableName}}ByIDsRequest) returns (List{{.TableName}}ByIDsReply) {
405405
option (google.api.http) = {
406406
post: "/api/v1/{{.TName}}/list/ids"
407407
body: "*"
408408
};
409409
}
410410
411-
// get a list of {{.TName}} by last id
411+
// Get a paginated list of {{.TName}} by last id
412412
rpc ListByLastID(List{{.TableName}}ByLastIDRequest) returns (List{{.TableName}}ByLastIDReply) {
413413
option (google.api.http) = {
414414
get: "/api/v1/{{.TName}}/list"
@@ -567,38 +567,38 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
567567
}
568568
};
569569
570-
service {{.TableName}} {
571-
// create a new {{.TName}}
570+
service {{.TName}} {
571+
// Create a new {{.TName}}
572572
rpc Create(Create{{.TableName}}Request) returns (Create{{.TableName}}Reply) {
573573
option (google.api.http) = {
574574
post: "/api/v1/{{.TName}}"
575575
body: "*"
576576
};
577577
}
578578
579-
// delete a {{.TName}} by id
579+
// Delete a {{.TName}} by id
580580
rpc DeleteByID(Delete{{.TableName}}ByIDRequest) returns (Delete{{.TableName}}ByIDReply) {
581581
option (google.api.http) = {
582582
delete: "/api/v1/{{.TName}}/{id}"
583583
};
584584
}
585585
586-
// update a {{.TName}} by id
586+
// Update a {{.TName}} by id
587587
rpc UpdateByID(Update{{.TableName}}ByIDRequest) returns (Update{{.TableName}}ByIDReply) {
588588
option (google.api.http) = {
589589
put: "/api/v1/{{.TName}}/{id}"
590590
body: "*"
591591
};
592592
}
593593
594-
// get {{.TName}} details by id
594+
// Get a {{.TName}} by id
595595
rpc GetByID(Get{{.TableName}}ByIDRequest) returns (Get{{.TableName}}ByIDReply) {
596596
option (google.api.http) = {
597597
get: "/api/v1/{{.TName}}/{id}"
598598
};
599599
}
600600
601-
// get a list of {{.TName}} by custom conditions
601+
// Get a paginated list of {{.TName}} by custom conditions
602602
rpc List(List{{.TableName}}Request) returns (List{{.TableName}}Reply) {
603603
option (google.api.http) = {
604604
post: "/api/v1/{{.TName}}/list"

0 commit comments

Comments
 (0)