From 12299736e0a53f8d6a91cd794d2f419b15e8f2aa Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 22 Dec 2022 20:19:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=94=AF=E4=BB=98=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=92=8C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 4 ++++ modules/pay/module.go | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index fabdb5fcb..ded2c12d3 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -336,4 +336,8 @@ type ( IGrowtask interface { BingoAllGrowTask(session IUserSession) error } + //支付发货 + IPayDelivery interface { + Delivery(session IUserSession, pid string) (code pb.ErrorCode, items []*pb.UserAssets) + } ) diff --git a/modules/pay/module.go b/modules/pay/module.go index 3b8763013..f98cfab0a 100644 --- a/modules/pay/module.go +++ b/modules/pay/module.go @@ -29,6 +29,7 @@ type Pay struct { modelPay *modelPayComp modelPayUser *modelPayUserComp modelDaily *modelDailyComp + privilege comm.IPayDelivery //月卡 configure *configureComp } @@ -45,6 +46,11 @@ func (this *Pay) Init(service core.IService, module core.IModule, options core.I } func (this *Pay) Start() (err error) { err = this.ModuleBase.Start() + var module core.IModule + if module, err = this.service.GetModule(comm.ModuleMainline); err != nil { + return + } + this.privilege = module.(comm.IPayDelivery) this.service.RegisterFunctionName(string(comm.Rpc_ModulePayDelivery), this.Rpc_ModulePayDelivery) return } @@ -115,6 +121,9 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery case 2: reply.Code, items = this.modelDaily.delivery(session, args.Productid) break + case 3: + reply.Code, items = this.privilege.Delivery(session, args.Productid) + break } for _, v := range res { items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N}) @@ -131,6 +140,6 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery return } } - this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) + go this.ModuleHero.RechargeMoney(session.GetUserId(), conf.Amount) return }