u
This commit is contained in:
1 parent
ac0843c041
commit
a917be08d1
65 files changed
+8043
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// Code generated by hertz generator.
|
||||
|
||||
package hello
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
hello "cn/oneao/base-go/biz/model/hertz/hello"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
)
|
||||
|
||||
// Method1 .
|
||||
// @router /hello [GET]
|
||||
func Method1(ctx context.Context, c *app.RequestContext) {
|
||||
var err error
|
||||
var req hello.HelloReq
|
||||
err = c.BindAndValidate(&req)
|
||||
if err != nil {
|
||||
c.String(consts.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
resp := new(hello.HelloResp)
|
||||
|
||||
c.JSON(consts.StatusOK, resp)
|
||||
}
|
||||
Reference in new issue
Block a user