muyu-apiserver/gateway/internal/logic/purchase/receipt/confirmpurchasereceiptlogic.go

34 lines
780 B
Go
Raw Permalink Normal View History

package receipt
import (
"context"
"muyu-apiserver/gateway/internal/svc"
"muyu-apiserver/pkg/ctxdata"
"muyu-apiserver/rpc/purchase/purchaseservice"
"github.com/zeromicro/go-zero/core/logx"
)
type ConfirmPurchaseReceiptLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewConfirmPurchaseReceiptLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfirmPurchaseReceiptLogic {
return &ConfirmPurchaseReceiptLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ConfirmPurchaseReceiptLogic) ConfirmPurchaseReceipt() error {
id := ctxdata.GetPathId(l.ctx)
_, err := l.svcCtx.PurchaseRpc.ConfirmPurchaseReceipt(l.ctx, &purchaseservice.ConfirmPurchaseReceiptReq{
ReceiptId: id,
})
return err
}