支持通过controller自动解析注册接口路由 #2

Merged
zhangdeman merged 22 commits from feature/router into master 2025-02-07 17:32:35 +08:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 851de1b3ef - Show all commits

View File

@ -7,7 +7,11 @@
// Date : 2024-07-20 21:40 // Date : 2024-07-20 21:40
package router package router
// Meta 接口的元信息 // Meta 接口的元信息, 主要包含如下信息:
//
// uri: 接口路由(不包含group前缀)
//
// method: 请求方法: get/post 等
// //
// Author : go_developer@163.com<白茶清欢> // Author : go_developer@163.com<白茶清欢>
// //

View File

@ -163,10 +163,10 @@ func registerUri(uriConfig *UriConfig, methodValue reflect.Value, middlewareList
} }
err := errData.Interface() err := errData.Interface()
if e, ok := err.(exception.IException); ok { if e, ok := err.(exception.IException); ok {
response.SendWithException(ctx, e, businessData) response.SendWithException(ctx, e, map[string]any{"business_data": businessData})
return return
} else { } else {
response.SendWithException(ctx, exception.NewFromError(-1, errData.Interface().(error)), businessData) response.SendWithException(ctx, exception.NewFromError(-1, errData.Interface().(error)), map[string]any{"business_data": businessData})
return return
} }
} }