Skip to content

Commit

Permalink
fix: fix gen api
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkgos committed Sep 25, 2024
1 parent 47c92db commit 166b1d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/dyngen/command/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func (g *CodeGen) Gen() *CodeGen {
//* list
g.Printf("message List%sRequest {\n", structName)
g.genFields(et.Fields, nil, false)
g.Println(` // @gotags: binding:"gt=0"`)
g.Println(" int64 page = 30 [(google.api.field_behavior) = REQUIRED,(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { type: [ INTEGER ] }];")
g.Println(` // @gotags: binding:"min=1,max=500"`)
g.Println(" int64 perPage = 31 [(google.api.field_behavior) = REQUIRED,(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { type: [ INTEGER ] }];")
g.Println("}")
g.Printf("message List%sReply {\n", structName)
g.Println(" int64 total = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { type: [ INTEGER ] }];")
Expand Down

0 comments on commit 166b1d7

Please sign in to comment.