上传配置

This commit is contained in:
liwei 2023-08-10 13:58:08 +08:00
parent f843f92a36
commit 995b264851
3 changed files with 28 additions and 0 deletions

View File

@ -620,6 +620,7 @@ type (
//推送礼包 //推送礼包
IPushgiftbag interface { IPushgiftbag interface {
IBuriedUpdateNotify IBuriedUpdateNotify
IPayDelivery
} }
IUiGame interface { IUiGame interface {
HDPSTodayConsum(uid string, ps int32) // 今日消耗的体力 HDPSTodayConsum(uid string, ps int32) // 今日消耗的体力

View File

@ -36,6 +36,7 @@ type Pay struct {
warorder comm.IWarorder //战令 warorder comm.IWarorder //战令
shopcenter comm.IPayDelivery //购物中心 shopcenter comm.IPayDelivery //购物中心
addrecharge comm.IAddrecharge //累充系统 addrecharge comm.IAddrecharge //累充系统
pushgiftbag comm.IPushgiftbag //推送礼包
configure *configureComp configure *configureComp
} }
@ -69,6 +70,10 @@ func (this *Pay) Start() (err error) {
return return
} }
this.addrecharge = module.(comm.IAddrecharge) this.addrecharge = module.(comm.IAddrecharge)
if module, err = this.service.GetModule(comm.ModulePushgiftbag); err != nil {
return
}
this.pushgiftbag = module.(comm.IPushgiftbag)
this.service.RegisterFunctionName(string(comm.Rpc_ModulePayDelivery), this.Rpc_ModulePayDelivery) this.service.RegisterFunctionName(string(comm.Rpc_ModulePayDelivery), this.Rpc_ModulePayDelivery)
return return
} }
@ -172,6 +177,12 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
return return
} }
break break
case 7:
if errdata, items = this.pushgiftbag.Delivery(session, args.Productid); errdata != nil {
reply.Code = errdata.Code
return
}
break
} }
this.addrecharge.RechargeIntegral(session, conf.Integral) //记录累充积分 this.addrecharge.RechargeIntegral(session, conf.Integral) //记录累充积分
for _, v := range res { for _, v := range res {
@ -275,6 +286,11 @@ func (this *Pay) ModulePayDelivery(session comm.IUserSession, Productid string,
if errdata, items = this.shopcenter.Delivery(session, Productid); errdata != nil { if errdata, items = this.shopcenter.Delivery(session, Productid); errdata != nil {
return return
} }
case 7:
if errdata, items = this.pushgiftbag.Delivery(session, Productid); errdata != nil {
return
}
break
} }
for _, v := range res { for _, v := range res {
items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N}) items = append(items, &pb.UserAssets{A: v.A, T: v.T, N: v.N})

View File

@ -1,6 +1,7 @@
package pushgiftbag package pushgiftbag
import ( import (
"fmt"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/sys/log"
@ -70,8 +71,18 @@ func (this *PushGiftbag) Delivery(session comm.IUserSession, pid string) (errdat
} }
if conf == nil { if conf == nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.String(),
Message: fmt.Sprintf("no found pid:%s", pid),
}
return return
} }
if errdata = this.DispenseRes(session, conf.Lbid, true); err != nil {
return
}
for i, v := range info.Item { for i, v := range info.Item {
if v.Id == conf.Id { if v.Id == conf.Id {
info.Item = append(info.Item[0:i], info.Item[i+1:]...) info.Item = append(info.Item[0:i], info.Item[i+1:]...)