Pull latest changes from upstream/main (GitHub) including: - Purchase RPC service (proto, server, logic, models) - Gateway route updates for purchase endpoints - SQL migration and config updates Excludes deploy/bin/ pre-compiled arm64 binaries (builds use multi-stage Dockerfiles targeting amd64).
34 lines
760 B
Go
34 lines
760 B
Go
package order
|
|
|
|
import (
|
|
"context"
|
|
|
|
"muyu-apiserver/gateway/internal/svc"
|
|
"muyu-apiserver/pkg/ctxdata"
|
|
"muyu-apiserver/rpc/purchase/purchaseservice"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type ConfirmPurchaseOrderLogic struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
func NewConfirmPurchaseOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ConfirmPurchaseOrderLogic {
|
|
return &ConfirmPurchaseOrderLogic{
|
|
Logger: logx.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
func (l *ConfirmPurchaseOrderLogic) ConfirmPurchaseOrder() error {
|
|
id := ctxdata.GetPathId(l.ctx)
|
|
_, err := l.svcCtx.PurchaseRpc.ConfirmPurchaseOrder(l.ctx, &purchaseservice.ConfirmPurchaseOrderReq{
|
|
OrderId: id,
|
|
})
|
|
return err
|
|
}
|