From 851de1b3ef8d726df3caccfb8f5df1bfe2b22aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 27 Jan 2025 15:07:58 +0800 Subject: [PATCH] save code --- router/meta.go | 6 +++++- router/register.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/router/meta.go b/router/meta.go index 93d9204..b821f86 100644 --- a/router/meta.go +++ b/router/meta.go @@ -7,7 +7,11 @@ // Date : 2024-07-20 21:40 package router -// Meta 接口的元信息 +// Meta 接口的元信息, 主要包含如下信息: +// +// uri: 接口路由(不包含group前缀) +// +// method: 请求方法: get/post 等 // // Author : go_developer@163.com<白茶清欢> // diff --git a/router/register.go b/router/register.go index 2f3ca60..5cce58f 100644 --- a/router/register.go +++ b/router/register.go @@ -163,10 +163,10 @@ func registerUri(uriConfig *UriConfig, methodValue reflect.Value, middlewareList } err := errData.Interface() if e, ok := err.(exception.IException); ok { - response.SendWithException(ctx, e, businessData) + response.SendWithException(ctx, e, map[string]any{"business_data": businessData}) return } 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 } }