package logic import ( "context" "fmt" . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/service" "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/internal/svc" "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/pb" "github.com/zeromicro/go-zero/core/logx" ) type DeductionLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewDeductionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeductionLogic { return &DeductionLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 资源扣减 func (l *DeductionLogic) Deduction(in *pb.DeductionReq) (*pb.Resp, error) { resp := &pb.Resp{} status, err := Deduction(in.Appid, in.FunctionCode, in.AccountId, in.EntAccountId, in.Count, in.Ids) if err != nil { l.Error(fmt.Sprintf("%+v", in), err) } resp.Status = status return resp, nil }