This commit is contained in:
@@ -3,9 +3,7 @@ package v1
|
||||
import (
|
||||
"mime/multipart"
|
||||
|
||||
"quyun/v2/app/errorx"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/app/services"
|
||||
"quyun/v2/providers/jwt"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
@@ -63,14 +61,14 @@ func (d *demo) Foo(
|
||||
file *multipart.FileHeader,
|
||||
req *FooUploadReq,
|
||||
) error {
|
||||
_, err := services.Test.Test(ctx)
|
||||
if err != nil {
|
||||
// 示例:在控制器层自定义错误消息/附加数据
|
||||
appErr := errorx.Wrap(err).
|
||||
WithMsg("获取测试失败").
|
||||
WithData(fiber.Map{"route": "/v1/test"}).
|
||||
WithParams("handler", "Test.Hello")
|
||||
return appErr
|
||||
}
|
||||
// _, err := services.Test.Test(ctx)
|
||||
// if err != nil {
|
||||
// // 示例:在控制器层自定义错误消息/附加数据
|
||||
// appErr := errorx.Wrap(err).
|
||||
// WithMsg("获取测试失败").
|
||||
// WithData(fiber.Map{"route": "/v1/test"}).
|
||||
// WithParams("handler", "Test.Hello")
|
||||
// return appErr
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user