优化响应中间件,自动识别响应数据格式

This commit is contained in:
孟帅
2023-06-16 19:58:29 +08:00
parent 50e64e132f
commit 9b89402bf6
13 changed files with 112 additions and 128 deletions

View File

@@ -10,7 +10,10 @@ type NotifyAliPayReq struct {
g.Meta `path:"/pay/notify/alipay" method:"post" tags:"支付异步通知" summary:"支付宝回调"`
}
type NotifyAliPayRes payin.PayNotifyModel
type NotifyAliPayRes struct {
g.Meta `mime:"text/html" type:"string" example:"<html/>"`
payin.PayNotifyModel
}
// NotifyWxPayReq 微信支付回调
type NotifyWxPayReq struct {
@@ -24,4 +27,7 @@ type NotifyQQPayReq struct {
g.Meta `path:"/pay/notify/qqpay" method:"post" tags:"支付异步通知" summary:"QQ支付回调"`
}
type NotifyQQPayRes payin.PayNotifyModel
type NotifyQQPayRes struct {
g.Meta `mime:"text/xml" type:"string" example:"<html/>"`
payin.PayNotifyModel
}

View File

@@ -11,8 +11,9 @@ import (
type HelloReq struct {
g.Meta `path:"/hello" tags:"Hello" method:"get" summary:"You first hello api"`
Name string `json:"name" d:"hotgo" dc:"名字"`
}
type HelloRes struct {
g.Meta `mime:"text/html" example:"string"`
Tips string `json:"tips"`
}