generate facade service
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
// SendErrResponse pack error response
|
||||
func SendErrResponse(ctx context.Context, c *app.RequestContext, code int, err error) {
|
||||
// todo edit custom code
|
||||
c.String(code, err.Error())
|
||||
}
|
||||
|
||||
// SendSuccessResponse pack success response
|
||||
func SendSuccessResponse(ctx context.Context, c *app.RequestContext, code int, data interface{}) {
|
||||
// todo edit custom code
|
||||
c.JSON(code, data)
|
||||
}
|
||||
Reference in New Issue
Block a user