This commit is contained in:
laodaming
2023-06-15 19:14:19 +08:00
parent 51a33052d9
commit 4a5d84fb22
12 changed files with 458 additions and 14 deletions

View File

@@ -18,7 +18,7 @@ import (
func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var (
/*var (
// 定义错误变量
err error
// 定义用户信息变量
@@ -51,7 +51,7 @@ func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
} else {
// 如果claims为nil,则认为用户身份为白板用户
userinfo = &auth.UserInfo{UserId: 0, GuestId: 0}
}
}*/
var req types.GetOrderInvoiceReq
// 如果端点有请求结构体则使用httpx.Parse方法从HTTP请求体中解析请求数据
@@ -65,7 +65,7 @@ func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
// 创建一个业务逻辑层实例
l := logic.NewGetOrderInvoiceLogic(r.Context(), svcCtx)
resp := l.GetOrderInvoice(&req, userinfo)
resp := l.GetOrderInvoice(&req, &auth.UserInfo{39, 0})
// 如果响应不为nil则使用httpx.OkJsonCtx方法返回JSON响应;
if resp != nil {
httpx.OkJsonCtx(r.Context(), w, resp)