update go mod + update send with exception

This commit is contained in:
2024-03-15 10:50:01 +08:00
parent c4edba172b
commit 0ffe074179
3 changed files with 46 additions and 18 deletions

View File

@ -77,11 +77,11 @@ func SendWithException(ctx *gin.Context, e exception.IException, data interface{
if nil == e {
e = exception.NewSuccess(data)
}
if nil != e.GetData() {
Send(ctx, e.GetCode(), e.GetHttpCode(), e.GetData())
} else {
Send(ctx, e.GetCode(), e.GetHttpCode(), data)
outputData := map[string]interface{}{
"e_data": e.GetData(),
"u_e_data": data,
}
Send(ctx, e.GetCode(), e.GetHttpCode(), outputData)
}
// JSON ctx.JSON 的平替, 增加了数据是否已相应的标识