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).
38 lines
893 B
Go
38 lines
893 B
Go
package receipt
|
|
|
|
import (
|
|
"context"
|
|
|
|
"muyu-apiserver/gateway/internal/svc"
|
|
"muyu-apiserver/gateway/internal/types"
|
|
"muyu-apiserver/pkg/ctxdata"
|
|
"muyu-apiserver/rpc/purchase/purchaseservice"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type GetPurchaseReceiptLogic struct {
|
|
logx.Logger
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
}
|
|
|
|
func NewGetPurchaseReceiptLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPurchaseReceiptLogic {
|
|
return &GetPurchaseReceiptLogic{
|
|
Logger: logx.WithContext(ctx),
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
func (l *GetPurchaseReceiptLogic) GetPurchaseReceipt() (*types.PurchaseReceiptInfo, error) {
|
|
id := ctxdata.GetPathId(l.ctx)
|
|
resp, err := l.svcCtx.PurchaseRpc.GetPurchaseReceipt(l.ctx, &purchaseservice.GetPurchaseReceiptReq{
|
|
ReceiptId: id,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return purchaseReceiptInfoFromPB(resp), nil
|
|
}
|