diff --git a/modules/academy/api_challenge.go b/modules/academy/api_challenge.go index a211efd87..1423d53b8 100644 --- a/modules/academy/api_challenge.go +++ b/modules/academy/api_challenge.go @@ -24,7 +24,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.AcademyChallen ) defer func() { if cd == pb.ErrorCode_Success { - session.SendMsg(string(this.module.GetType()), "challenge", &pb.AcademyChallengeResp{Code: cd, Info: &pb.BattleInfo{ + session.SendMsg(string(this.module.GetType()), "challenge", &pb.AcademyChallengeResp{Code: cd, Level: req.Level, Info: &pb.BattleInfo{ Id: record.Id, Title: record.Title, Btype: record.Btype, diff --git a/modules/academy/api_teaching.go b/modules/academy/api_teaching.go index 2749bea61..f5e6585f3 100644 --- a/modules/academy/api_teaching.go +++ b/modules/academy/api_teaching.go @@ -24,7 +24,7 @@ func (this *apiComp) Teaching(session comm.IUserSession, req *pb.AcademyTeaching ) defer func() { if cd == pb.ErrorCode_Success { - session.SendMsg(string(this.module.GetType()), "teaching", &pb.AcademyTeachingResp{Code: cd, Info: &pb.BattleInfo{ + session.SendMsg(string(this.module.GetType()), "teaching", &pb.AcademyTeachingResp{Code: cd, HeroId: req.HeroId, Info: &pb.BattleInfo{ Id: record.Id, Title: record.Title, Btype: record.Btype, diff --git a/modules/pay/api_dailybuy.go b/modules/pay/api_dailybuy.go index c093eed95..5832cfaab 100644 --- a/modules/pay/api_dailybuy.go +++ b/modules/pay/api_dailybuy.go @@ -20,9 +20,10 @@ func (this *apiComp) DailyBuyCheck(session comm.IUserSession, req *pb.PayDailyBu ///获取系统公告 func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq) (code pb.ErrorCode, data proto.Message) { var ( - info *pb.DBPayDaily - conf *cfg.GamePayPackageData - err error + info *pb.DBPayDaily + conf *cfg.GamePayPackageData + items []*pb.UserAssets + err error ) if code = this.DailyBuyCheck(session, req); code != pb.ErrorCode_Success { return @@ -48,9 +49,10 @@ func (this *apiComp) DailyBuy(session comm.IUserSession, req *pb.PayDailyBuyReq) } } - if code = this.module.modelDaily.delivery(session, conf.Packagetype); code != pb.ErrorCode_Success { + if code, items = this.module.modelDaily.delivery(session, conf.Packagetype); code != pb.ErrorCode_Success { return } - session.SendMsg(string(this.module.GetType()), "dailybuy", &pb.PayDailyBuyResp{Isucc: true}) + + session.SendMsg(string(this.module.GetType()), "dailybuy", &pb.PayDailyBuyResp{Isucc: true, Items: items}) return } diff --git a/modules/pay/modelDaily.go b/modules/pay/modelDaily.go index 24e436ff5..67c48afa3 100644 --- a/modules/pay/modelDaily.go +++ b/modules/pay/modelDaily.go @@ -59,7 +59,7 @@ func (this *modelDailyComp) updateUserDaily(info *pb.DBPayDaily) (err error) { } //每日礼包发货 -func (this *modelDailyComp) delivery(session comm.IUserSession, pid string) (code pb.ErrorCode) { +func (this *modelDailyComp) delivery(session comm.IUserSession, pid string) (code pb.ErrorCode, items []*pb.UserAssets) { var ( info *pb.DBPayDaily conf *cfg.GamePayPackageData @@ -84,6 +84,14 @@ func (this *modelDailyComp) delivery(session comm.IUserSession, pid string) (cod if err = this.updateUserDaily(info); err != nil { return } + items = make([]*pb.UserAssets, len(conf.Item)) + for i, v := range conf.Item { + items[i] = &pb.UserAssets{ + A: v.A, + T: v.T, + N: v.N, + } + } if code = this.module.DispenseRes(session, conf.Item, true); code != pb.ErrorCode_Success { return } diff --git a/modules/pay/module.go b/modules/pay/module.go index 160580c3c..7428565be 100644 --- a/modules/pay/module.go +++ b/modules/pay/module.go @@ -114,7 +114,7 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery case 1: break case 2: - reply.Code = this.modelDaily.delivery(session, args.Productid) + reply.Code, _ = this.modelDaily.delivery(session, args.Productid) break } return diff --git a/pb/academy_msg.pb.go b/pb/academy_msg.pb.go index 0d3cdd2c9..cf38b40d8 100644 --- a/pb/academy_msg.pb.go +++ b/pb/academy_msg.pb.go @@ -159,8 +159,9 @@ type AcademyChallengeResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 - Info *BattleInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info"` + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + Level int32 `protobuf:"varint,2,opt,name=level,proto3" json:"level"` + Info *BattleInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info"` } func (x *AcademyChallengeResp) Reset() { @@ -202,6 +203,13 @@ func (x *AcademyChallengeResp) GetCode() ErrorCode { return ErrorCode_Success } +func (x *AcademyChallengeResp) GetLevel() int32 { + if x != nil { + return x.Level + } + return 0 +} + func (x *AcademyChallengeResp) GetInfo() *BattleInfo { if x != nil { return x.Info @@ -373,8 +381,9 @@ type AcademyTeachingResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 - Info *BattleInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info"` + Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=ErrorCode" json:"code"` //是否成功 + HeroId string `protobuf:"bytes,2,opt,name=heroId,proto3" json:"heroId"` + Info *BattleInfo `protobuf:"bytes,3,opt,name=info,proto3" json:"info"` } func (x *AcademyTeachingResp) Reset() { @@ -416,6 +425,13 @@ func (x *AcademyTeachingResp) GetCode() ErrorCode { return ErrorCode_Success } +func (x *AcademyTeachingResp) GetHeroId() string { + if x != nil { + return x.HeroId + } + return "" +} + func (x *AcademyTeachingResp) GetInfo() *BattleInfo { if x != nil { return x.Info @@ -542,40 +558,43 @@ var file_academy_academy_msg_proto_rawDesc = []byte{ 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x2b, 0x0a, 0x13, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x22, 0x57, 0x0a, 0x14, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x43, 0x68, 0x61, 0x6c, + 0x6c, 0x22, 0x6d, 0x0a, 0x14, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x66, 0x0a, 0x11, 0x41, 0x63, - 0x61, 0x64, 0x65, 0x6d, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x0a, 0x06, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x22, 0x2c, 0x0a, 0x12, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x52, 0x65, 0x63, - 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, - 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, - 0x22, 0x2c, 0x0a, 0x12, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x61, 0x63, 0x68, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x22, 0x56, - 0x0a, 0x13, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x61, 0x63, 0x68, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x5a, 0x0a, 0x19, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, - 0x79, 0x54, 0x65, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, - 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, - 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x22, 0x34, 0x0a, 0x1a, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x61, - 0x63, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x22, 0x66, 0x0a, 0x11, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, + 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x2c, 0x0a, 0x12, 0x41, 0x63, 0x61, 0x64, + 0x65, 0x6d, 0x79, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x22, 0x2c, 0x0a, 0x12, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, + 0x79, 0x54, 0x65, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, + 0x72, 0x6f, 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x13, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, + 0x65, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, + 0x6f, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x5a, 0x0a, 0x19, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, + 0x65, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, + 0x71, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x68, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, + 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x22, 0x34, 0x0a, 0x1a, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x79, 0x54, 0x65, 0x61, 0x63, 0x68, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, + 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x69, 0x73, 0x73, 0x75, 0x63, 0x63, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/pay_msg.pb.go b/pb/pay_msg.pb.go index 57aa5c941..e24ed4f98 100644 --- a/pb/pay_msg.pb.go +++ b/pb/pay_msg.pb.go @@ -159,7 +159,8 @@ type PayDailyBuyResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Isucc bool `protobuf:"varint,1,opt,name=isucc,proto3" json:"isucc"` + Isucc bool `protobuf:"varint,1,opt,name=isucc,proto3" json:"isucc"` + Items []*UserAssets `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` } func (x *PayDailyBuyResp) Reset() { @@ -201,6 +202,77 @@ func (x *PayDailyBuyResp) GetIsucc() bool { return false } +func (x *PayDailyBuyResp) GetItems() []*UserAssets { + if x != nil { + return x.Items + } + return nil +} + +//充值完成推送 +type PayShippedPush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pid string `protobuf:"bytes,1,opt,name=pid,proto3" json:"pid"` + Orderid string `protobuf:"bytes,2,opt,name=orderid,proto3" json:"orderid"` + Items []*UserAssets `protobuf:"bytes,3,rep,name=items,proto3" json:"items"` +} + +func (x *PayShippedPush) Reset() { + *x = PayShippedPush{} + if protoimpl.UnsafeEnabled { + mi := &file_pay_pay_msg_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayShippedPush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayShippedPush) ProtoMessage() {} + +func (x *PayShippedPush) ProtoReflect() protoreflect.Message { + mi := &file_pay_pay_msg_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayShippedPush.ProtoReflect.Descriptor instead. +func (*PayShippedPush) Descriptor() ([]byte, []int) { + return file_pay_pay_msg_proto_rawDescGZIP(), []int{4} +} + +func (x *PayShippedPush) GetPid() string { + if x != nil { + return x.Pid + } + return "" +} + +func (x *PayShippedPush) GetOrderid() string { + if x != nil { + return x.Orderid + } + return "" +} + +func (x *PayShippedPush) GetItems() []*UserAssets { + if x != nil { + return x.Items + } + return nil +} + ///支付系统发货请求 type PayDeliveryReq struct { state protoimpl.MessageState @@ -215,7 +287,7 @@ type PayDeliveryReq struct { func (x *PayDeliveryReq) Reset() { *x = PayDeliveryReq{} if protoimpl.UnsafeEnabled { - mi := &file_pay_pay_msg_proto_msgTypes[4] + mi := &file_pay_pay_msg_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -228,7 +300,7 @@ func (x *PayDeliveryReq) String() string { func (*PayDeliveryReq) ProtoMessage() {} func (x *PayDeliveryReq) ProtoReflect() protoreflect.Message { - mi := &file_pay_pay_msg_proto_msgTypes[4] + mi := &file_pay_pay_msg_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -241,7 +313,7 @@ func (x *PayDeliveryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PayDeliveryReq.ProtoReflect.Descriptor instead. func (*PayDeliveryReq) Descriptor() ([]byte, []int) { - return file_pay_pay_msg_proto_rawDescGZIP(), []int{4} + return file_pay_pay_msg_proto_rawDescGZIP(), []int{5} } func (x *PayDeliveryReq) GetUid() string { @@ -278,7 +350,7 @@ type PayDeliveryResp struct { func (x *PayDeliveryResp) Reset() { *x = PayDeliveryResp{} if protoimpl.UnsafeEnabled { - mi := &file_pay_pay_msg_proto_msgTypes[5] + mi := &file_pay_pay_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -291,7 +363,7 @@ func (x *PayDeliveryResp) String() string { func (*PayDeliveryResp) ProtoMessage() {} func (x *PayDeliveryResp) ProtoReflect() protoreflect.Message { - mi := &file_pay_pay_msg_proto_msgTypes[5] + mi := &file_pay_pay_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -304,7 +376,7 @@ func (x *PayDeliveryResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PayDeliveryResp.ProtoReflect.Descriptor instead. func (*PayDeliveryResp) Descriptor() ([]byte, []int) { - return file_pay_pay_msg_proto_rawDescGZIP(), []int{5} + return file_pay_pay_msg_proto_rawDescGZIP(), []int{6} } func (x *PayDeliveryResp) GetCode() ErrorCode { @@ -326,16 +398,25 @@ var File_pay_pay_msg_proto protoreflect.FileDescriptor var file_pay_pay_msg_proto_rawDesc = []byte{ 0x0a, 0x11, 0x70, 0x61, 0x79, 0x2f, 0x70, 0x61, 0x79, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x70, 0x61, 0x79, 0x2f, 0x70, 0x61, 0x79, 0x5f, 0x64, 0x62, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0c, 0x0a, 0x0a, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x22, 0x2e, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x52, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x20, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, - 0x42, 0x75, 0x79, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, - 0x6c, 0x79, 0x42, 0x75, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x75, - 0x63, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x75, 0x63, 0x63, 0x22, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x0c, 0x0a, 0x0a, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x22, 0x2e, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x1f, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x44, 0x42, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, + 0x22, 0x20, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x42, 0x75, 0x79, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x4a, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x42, 0x75, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x75, 0x63, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x75, 0x63, 0x63, 0x12, 0x21, 0x0a, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x5f, + 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x53, 0x68, 0x69, 0x70, 0x70, 0x65, 0x64, 0x50, 0x75, 0x73, 0x68, + 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, + 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x05, + 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x5a, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x69, 0x64, 0x18, 0x02, @@ -361,25 +442,29 @@ func file_pay_pay_msg_proto_rawDescGZIP() []byte { return file_pay_pay_msg_proto_rawDescData } -var file_pay_pay_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_pay_pay_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_pay_pay_msg_proto_goTypes = []interface{}{ (*PayInfoReq)(nil), // 0: PayInfoReq (*PayInfoResp)(nil), // 1: PayInfoResp (*PayDailyBuyReq)(nil), // 2: PayDailyBuyReq (*PayDailyBuyResp)(nil), // 3: PayDailyBuyResp - (*PayDeliveryReq)(nil), // 4: PayDeliveryReq - (*PayDeliveryResp)(nil), // 5: PayDeliveryResp - (*DBPayDaily)(nil), // 6: DBPayDaily - (ErrorCode)(0), // 7: ErrorCode + (*PayShippedPush)(nil), // 4: PayShippedPush + (*PayDeliveryReq)(nil), // 5: PayDeliveryReq + (*PayDeliveryResp)(nil), // 6: PayDeliveryResp + (*DBPayDaily)(nil), // 7: DBPayDaily + (*UserAssets)(nil), // 8: UserAssets + (ErrorCode)(0), // 9: ErrorCode } var file_pay_pay_msg_proto_depIdxs = []int32{ - 6, // 0: PayInfoResp.info:type_name -> DBPayDaily - 7, // 1: PayDeliveryResp.code:type_name -> ErrorCode - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 7, // 0: PayInfoResp.info:type_name -> DBPayDaily + 8, // 1: PayDailyBuyResp.items:type_name -> UserAssets + 8, // 2: PayShippedPush.items:type_name -> UserAssets + 9, // 3: PayDeliveryResp.code:type_name -> ErrorCode + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_pay_pay_msg_proto_init() } @@ -388,6 +473,7 @@ func file_pay_pay_msg_proto_init() { return } file_pay_pay_db_proto_init() + file_comm_proto_init() file_errorcode_proto_init() if !protoimpl.UnsafeEnabled { file_pay_pay_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -439,7 +525,7 @@ func file_pay_pay_msg_proto_init() { } } file_pay_pay_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PayDeliveryReq); i { + switch v := v.(*PayShippedPush); i { case 0: return &v.state case 1: @@ -451,6 +537,18 @@ func file_pay_pay_msg_proto_init() { } } file_pay_pay_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayDeliveryReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pay_pay_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PayDeliveryResp); i { case 0: return &v.state @@ -469,7 +567,7 @@ func file_pay_pay_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pay_pay_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/worldtask_msg.pb.go b/pb/worldtask_msg.pb.go index 5f2830dc3..d092e388f 100644 --- a/pb/worldtask_msg.pb.go +++ b/pb/worldtask_msg.pb.go @@ -238,29 +238,27 @@ var File_worldtask_worldtask_msg_proto protoreflect.FileDescriptor var file_worldtask_worldtask_msg_proto_rawDesc = []byte{ 0x0a, 0x1d, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x77, 0x6f, 0x72, 0x6c, - 0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x17, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x5f, 0x6d, - 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6c, - 0x64, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, - 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, - 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x18, 0x57, - 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, - 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x22, 0x55, 0x0a, - 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, - 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, - 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, - 0x75, 0x62, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x2b, 0x0a, 0x11, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x12, + 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x61, 0x73, 0x6b, + 0x49, 0x64, 0x22, 0x70, 0x0a, 0x18, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, 0x6b, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x71, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x74, 0x61, 0x73, + 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x74, + 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, + 0x73, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, + 0x73, 0x65, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x19, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x74, 0x61, 0x73, + 0x6b, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x72, + 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x75, 0x62, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -295,7 +293,6 @@ func file_worldtask_worldtask_msg_proto_init() { if File_worldtask_worldtask_msg_proto != nil { return } - file_battle_battle_msg_proto_init() if !protoimpl.UnsafeEnabled { file_worldtask_worldtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WorldtaskStoryReq); i { diff --git a/sys/configure/core.go b/sys/configure/core.go index 4e2854d01..f4c9f5e8a 100644 --- a/sys/configure/core.go +++ b/sys/configure/core.go @@ -54,3 +54,8 @@ func RegisterConfigure(name string, fn interface{}, callback func()) (err error) func GetConfigure(name string) (v interface{}, err error) { return defsys.GetConfigure(name) } + +//当前时间 +func Now() time.Time { + return time.Now() +} diff --git a/sys/configure/options.go b/sys/configure/options.go index b27b0bee4..e95a6e802 100644 --- a/sys/configure/options.go +++ b/sys/configure/options.go @@ -7,16 +7,21 @@ import ( type Option func(*Options) type Options struct { ConfigurePath string //配置中心路径 + TimestampFile string //时间戳配置文件路径 CheckInterval int //配置文件更新检查间隔时间 单位秒 } -func Set_ConfigurePath(v string) Option { +func SetConfigurePath(v string) Option { return func(o *Options) { o.ConfigurePath = v } } - -func Set_CheckInterval(v int) Option { +func SetTimestampFile(v string) Option { + return func(o *Options) { + o.TimestampFile = v + } +} +func SetCheckInterval(v int) Option { return func(o *Options) { o.CheckInterval = v }