transfer_middleware/cmd/rpc/internal/logic/physicalOrderSubLogic.go

32 lines
773 B
Go
Raw Permalink Normal View History

2024-11-06 18:00:56 +08:00
package logic
import (
"context"
"trasfer_middleware/until/common"
"trasfer_middleware/cmd/rpc/internal/svc"
"trasfer_middleware/cmd/rpc/pb/transfer"
"github.com/zeromicro/go-zero/core/logx"
)
type PhysicalOrderSubLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewPhysicalOrderSubLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PhysicalOrderSubLogic {
return &PhysicalOrderSubLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *PhysicalOrderSubLogic) PhysicalOrderSub(in *transfer.PhysicalOrderSubReq) (*transfer.PhysicalOrderSubRes, error) {
res, err := l.svcCtx.Physical.SetData(l.ctx, in.AppId, common.StructToMap(in), &l.svcCtx.Config.Mq).OrderSubmit()
return res, err
}