修改api的request
This commit is contained in:
parent
8857f84bf6
commit
29d5c91736
|
@ -27,7 +27,11 @@ func (m *FsGuestModel) GenerateGuestID(ctx context.Context, AccessSecret *string
|
|||
}
|
||||
record.AuthKey = &authKey
|
||||
record.CreatedAt = &now
|
||||
tx.Updates(record)
|
||||
err = tx.Updates(record).Error
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
|
@ -125,10 +125,10 @@ func (l *UserOderDeleteLogic) UserOderDelete(req *types.RequestOrderId, userinfo
|
|||
Uploads: stripe.GetBackendWithConfig(stripe.UploadsBackend, config),
|
||||
})
|
||||
// ['order_number' => $order->sn, 'is_refund' => 0, 'pay_status' => 1]
|
||||
pay := l.svcCtx.AllModels.FsPay
|
||||
payM := l.svcCtx.AllModels.FsPay
|
||||
|
||||
// 查询支付信息
|
||||
pays, err := pay.GetOrderPayList(l.ctx, *order.Sn, 1, 0)
|
||||
pays, err := payM.GetOrderPayList(l.ctx, *order.Sn, 1, 0)
|
||||
for _, pay := range pays {
|
||||
sc.Refunds.New(&stripe.RefundParams{
|
||||
PaymentIntent: pay.TradeNo,
|
||||
|
@ -140,12 +140,11 @@ func (l *UserOderDeleteLogic) UserOderDelete(req *types.RequestOrderId, userinfo
|
|||
}
|
||||
}
|
||||
|
||||
// if err == nil && err == nil {
|
||||
// return ResponseSuccess(200, "Cancel successfully", order)
|
||||
// }
|
||||
return resp.SetStatus(basic.CodePayCancelOk, uOrder)
|
||||
|
||||
// return ResponseError(500, "Cancellation failure")
|
||||
|
||||
return resp.SetStatus(basic.CodePayCancelNotOk)
|
||||
// return resp.SetStatus(basic.CodePayCancelNotOk)
|
||||
}
|
||||
|
||||
// func (l *OrderLogic) CancelOrder(req *types.RequestCancelOrder, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||
|
|
|
@ -7,15 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
|
|
|
@ -7,6 +7,9 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {}
|
||||
|
||||
|
||||
|
||||
// response 统一返回码
|
||||
type response {
|
||||
|
@ -15,17 +18,6 @@ type response {
|
|||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
|
||||
// responseJwt 统一返回码
|
||||
type responseJwt {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"msg"`
|
||||
Data interface{} `json:"data"`
|
||||
AccessSecret string `json:"accessSecret"`
|
||||
AccessExpire int64 `json:"accessExpire"`
|
||||
}
|
||||
|
||||
|
||||
// Auth 认证结构
|
||||
type Auth {
|
||||
AccessSecret string `json:"accessSecret"`
|
||||
|
|
|
@ -7,6 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
import "basic.api"
|
||||
|
||||
service canteen {
|
||||
//获取餐厅详情
|
||||
@handler GetCanteenDetailHandler
|
||||
|
|
|
@ -7,15 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
|
|
|
@ -7,15 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
|
|
|
@ -7,15 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
|
|
|
@ -7,17 +7,9 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
get /greet/from/:name(request) returns (response);
|
||||
service faq {
|
||||
@handler WetSetSettingHandler
|
||||
get /web-set/setting(request) returns (response);
|
||||
}
|
|
@ -42,6 +42,9 @@ service home-user-auth {
|
|||
@handler UserAddAddressHandler
|
||||
post /user/add-address(RequestAddAddress) returns (response);
|
||||
|
||||
// @handler UserOderListHandler
|
||||
// get /user/order-list(RequestOrderId) returns (response);
|
||||
|
||||
@handler UserOderDeleteHandler
|
||||
post /user/order-delete(RequestOrderId) returns (response);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ info (
|
|||
author: ""
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service map-library {
|
||||
|
|
|
@ -6,7 +6,9 @@ info (
|
|||
author: ""
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service orders {
|
||||
//获取订单发票
|
||||
@handler GetOrderInvoiceHandler
|
||||
|
|
|
@ -6,7 +6,9 @@ info (
|
|||
author: ""
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service product-templatev2 {
|
||||
//获取产品模板详情
|
||||
@handler GetTemplatevDetailHandler
|
||||
|
|
|
@ -6,7 +6,9 @@ info (
|
|||
author: ""
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service product {
|
||||
//获取产品列表
|
||||
@handler GetProductListHandler
|
||||
|
|
|
@ -7,15 +7,7 @@ info (
|
|||
email: ""
|
||||
)
|
||||
|
||||
type request {
|
||||
// TODO: add members here and delete this comment
|
||||
Name string `path:"name,options=you|me"` // parameters are auto validated
|
||||
}
|
||||
|
||||
type response {
|
||||
// TODO: add members here and delete this comment
|
||||
Message string `json:"message"`
|
||||
}
|
||||
import "basic.api"
|
||||
|
||||
service user-auth {
|
||||
@handler GreetHandler
|
||||
|
|
|
@ -6,7 +6,9 @@ info (
|
|||
author: "ldm"
|
||||
email: ""
|
||||
)
|
||||
|
||||
import "basic.api"
|
||||
|
||||
service shopping-cart-confirmation {
|
||||
//添加入购物车
|
||||
@handler CartAddHandler
|
||||
|
|
|
@ -116,6 +116,7 @@ func (resp *Response) SetStatusAddMessage(sr *StatusResponse, msg string, data .
|
|||
Code: sr.Code,
|
||||
Message: sr.Message + ":" + msg,
|
||||
}
|
||||
|
||||
switch len(data) {
|
||||
case 0:
|
||||
// 0 直接返回
|
||||
|
|
Loading…
Reference in New Issue
Block a user