add 红包历史记录

This commit is contained in:
sk 2025-01-10 10:54:44 +08:00
parent c885055c71
commit 72778de447
10 changed files with 820 additions and 81 deletions

View File

@ -0,0 +1,283 @@
// --------------------------------------------------------------------------------------------
// The following code is automatically generated by the mongo-dao-generator tool.
// Please do not modify this code manually to avoid being overwritten in the next generation.
// For more tool details, please click the link to view https://github.com/dobyte/mongo-dao-generator
// --------------------------------------------------------------------------------------------
package internal
import (
"context"
"errors"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
modelpkg "mongo.games.com/game/model"
)
type RedPacketHistoryFilterFunc func(cols *RedPacketHistoryColumns) interface{}
type RedPacketHistoryUpdateFunc func(cols *RedPacketHistoryColumns) interface{}
type RedPacketHistoryPipelineFunc func(cols *RedPacketHistoryColumns) interface{}
type RedPacketHistoryCountOptionsFunc func(cols *RedPacketHistoryColumns) *options.CountOptions
type RedPacketHistoryAggregateOptionsFunc func(cols *RedPacketHistoryColumns) *options.AggregateOptions
type RedPacketHistoryFindOneOptionsFunc func(cols *RedPacketHistoryColumns) *options.FindOneOptions
type RedPacketHistoryFindManyOptionsFunc func(cols *RedPacketHistoryColumns) *options.FindOptions
type RedPacketHistoryUpdateOptionsFunc func(cols *RedPacketHistoryColumns) *options.UpdateOptions
type RedPacketHistoryDeleteOptionsFunc func(cols *RedPacketHistoryColumns) *options.DeleteOptions
type RedPacketHistoryInsertOneOptionsFunc func(cols *RedPacketHistoryColumns) *options.InsertOneOptions
type RedPacketHistoryInsertManyOptionsFunc func(cols *RedPacketHistoryColumns) *options.InsertManyOptions
type RedPacketHistory struct {
Columns *RedPacketHistoryColumns
Database *mongo.Database
Collection *mongo.Collection
}
type RedPacketHistoryColumns struct {
Platform string // 平台
ID string
Cid string // 红包活动id
Snid string // 玩家id
Ts string // 时间戳
ItemId string // 道具id
ItemNum string // 道具数量
}
var redPacketHistoryColumns = &RedPacketHistoryColumns{
Platform: "-", // 平台
ID: "_id",
Cid: "Cid", // 红包活动id
Snid: "Snid", // 玩家id
Ts: "Ts", // 时间戳
ItemId: "ItemId", // 道具id
ItemNum: "ItemNum",// 道具数量
}
func NewRedPacketHistory() *RedPacketHistory {
return &RedPacketHistory{
Columns: redPacketHistoryColumns,
}
}
// Count returns the number of documents in the collection.
func (dao *RedPacketHistory) Count(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryCountOptionsFunc) (int64, error) {
var (
opts *options.CountOptions
filter = filterFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.CountDocuments(ctx, filter, opts)
}
// Aggregate executes an aggregate command against the collection and returns a cursor over the resulting documents.
func (dao *RedPacketHistory) Aggregate(ctx context.Context, pipelineFunc RedPacketHistoryPipelineFunc, optionsFunc ...RedPacketHistoryAggregateOptionsFunc) (*mongo.Cursor, error) {
var (
opts *options.AggregateOptions
pipeline = pipelineFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.Aggregate(ctx, pipeline, opts)
}
// InsertOne executes an insert command to insert a single document into the collection.
func (dao *RedPacketHistory) InsertOne(ctx context.Context, model *modelpkg.RedPacketHistory, optionsFunc ...RedPacketHistoryInsertOneOptionsFunc) (*mongo.InsertOneResult, error) {
if model == nil {
return nil, errors.New("model is nil")
}
if err := dao.autofill(ctx, model); err != nil {
return nil, err
}
var opts *options.InsertOneOptions
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.InsertOne(ctx, model, opts)
}
// InsertMany executes an insert command to insert multiple documents into the collection.
func (dao *RedPacketHistory) InsertMany(ctx context.Context, models []*modelpkg.RedPacketHistory, optionsFunc ...RedPacketHistoryInsertManyOptionsFunc) (*mongo.InsertManyResult, error) {
if len(models) == 0 {
return nil, errors.New("models is empty")
}
documents := make([]interface{}, 0, len(models))
for i := range models {
model := models[i]
if err := dao.autofill(ctx, model); err != nil {
return nil, err
}
documents = append(documents, model)
}
var opts *options.InsertManyOptions
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.InsertMany(ctx, documents, opts)
}
// UpdateOne executes an update command to update at most one document in the collection.
func (dao *RedPacketHistory) UpdateOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
var (
opts *options.UpdateOptions
filter = filterFunc(dao.Columns)
update = updateFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.UpdateOne(ctx, filter, update, opts)
}
// UpdateOneByID executes an update command to update at most one document in the collection.
func (dao *RedPacketHistory) UpdateOneByID(ctx context.Context, id string, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
objectID, err := primitive.ObjectIDFromHex(id)
if err != nil {
return nil, err
}
return dao.UpdateOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
return bson.M{"_id": objectID}
}, updateFunc, optionsFunc...)
}
// UpdateMany executes an update command to update documents in the collection.
func (dao *RedPacketHistory) UpdateMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
var (
opts *options.UpdateOptions
filter = filterFunc(dao.Columns)
update = updateFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.UpdateMany(ctx, filter, update, opts)
}
// FindOne executes a find command and returns a model for one document in the collection.
func (dao *RedPacketHistory) FindOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryFindOneOptionsFunc) (*modelpkg.RedPacketHistory, error) {
var (
opts *options.FindOneOptions
model = &modelpkg.RedPacketHistory{}
filter = filterFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
err := dao.Collection.FindOne(ctx, filter, opts).Decode(model)
if err != nil {
if err == mongo.ErrNoDocuments {
return nil, nil
}
return nil, err
}
return model, nil
}
// FindOneByID executes a find command and returns a model for one document in the collection.
func (dao *RedPacketHistory) FindOneByID(ctx context.Context, id string, optionsFunc ...RedPacketHistoryFindOneOptionsFunc) (*modelpkg.RedPacketHistory, error) {
objectID, err := primitive.ObjectIDFromHex(id)
if err != nil {
return nil, err
}
return dao.FindOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
return bson.M{"_id": objectID}
}, optionsFunc...)
}
// FindMany executes a find command and returns many models the matching documents in the collection.
func (dao *RedPacketHistory) FindMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryFindManyOptionsFunc) ([]*modelpkg.RedPacketHistory, error) {
var (
opts *options.FindOptions
filter = filterFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
cur, err := dao.Collection.Find(ctx, filter, opts)
if err != nil {
return nil, err
}
models := make([]*modelpkg.RedPacketHistory, 0)
if err = cur.All(ctx, &models); err != nil {
return nil, err
}
return models, nil
}
// DeleteOne executes a delete command to delete at most one document from the collection.
func (dao *RedPacketHistory) DeleteOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
var (
opts *options.DeleteOptions
filter = filterFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.DeleteOne(ctx, filter, opts)
}
// DeleteOneByID executes a delete command to delete at most one document from the collection.
func (dao *RedPacketHistory) DeleteOneByID(ctx context.Context, id string, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
objectID, err := primitive.ObjectIDFromHex(id)
if err != nil {
return nil, err
}
return dao.DeleteOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
return bson.M{"_id": objectID}
}, optionsFunc...)
}
// DeleteMany executes a delete command to delete documents from the collection.
func (dao *RedPacketHistory) DeleteMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
var (
opts *options.DeleteOptions
filter = filterFunc(dao.Columns)
)
if len(optionsFunc) > 0 {
opts = optionsFunc[0](dao.Columns)
}
return dao.Collection.DeleteMany(ctx, filter, opts)
}
// autofill when inserting data
func (dao *RedPacketHistory) autofill(ctx context.Context, model *modelpkg.RedPacketHistory) error {
if model.ID.IsZero() {
model.ID = primitive.NewObjectID()
}
return nil
}

88
dao/red_packet_history.go Normal file
View File

@ -0,0 +1,88 @@
package dao
import (
"context"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/mongox"
"mongo.games.com/game/dao/internal"
modelpkg "mongo.games.com/game/model"
)
var (
_ = context.Background()
_ = logger.Logger
_ = bson.M{}
_ = mongo.Database{}
)
type RedPacketHistoryColumns = internal.RedPacketHistoryColumns
type RedPacketHistory struct {
*internal.RedPacketHistory
}
func GetRedPacketHistory(key string) (*RedPacketHistory, error) {
return mongox.GetDao(key, NewRedPacketHistory)
}
func NewRedPacketHistory(db *mongo.Database, c *mongo.Collection) (*RedPacketHistory, any) {
if db == nil || c == nil {
return &RedPacketHistory{}, &modelpkg.RedPacketHistory{}
}
v := internal.NewRedPacketHistory()
v.Database = db
v.Collection = c
c.Indexes().CreateMany(context.Background(), []mongo.IndexModel{
{
Keys: bson.D{{"snid", 1}, {"cid", 1}, {"ts", -1}}, // 1 表示升序,-1 表示降序
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
},
{
Keys: bson.D{{"cid", 1}}, // 1 表示升序,-1 表示降序
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
},
{
Keys: bson.D{{"ts", 1}}, // 1 表示升序,-1 表示降序
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
},
{
Keys: bson.D{{"itemid", -1}}, // 1 表示升序,-1 表示降序
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
},
{
Keys: bson.D{{"itemnum", -1}}, // 1 表示升序,-1 表示降序
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
},
})
return &RedPacketHistory{RedPacketHistory: v}, &modelpkg.RedPacketHistory{}
}
func (r *RedPacketHistory) GetHistory(snid int32, cid int64) ([]*modelpkg.RedPacketHistory, error) {
res, err := r.FindMany(context.Background(), func(cols *internal.RedPacketHistoryColumns) interface{} {
return bson.M{cols.Snid: snid, cols.Cid: cid}
}, func(cols *internal.RedPacketHistoryColumns) *options.FindOptions {
return options.Find().SetSort(bson.D{{cols.Ts, -1}}).SetLimit(30)
})
if err != nil {
logger.Logger.Error("RedPacketHistory.GetHistory ", err)
return nil, err
}
return res, err
}
func (r *RedPacketHistory) Save(history *modelpkg.RedPacketHistory) error {
_, err := r.InsertOne(context.Background(), history)
if err != nil {
logger.Logger.Error("RedPacketHistory.Insert ", err)
return err
}
return nil
}

View File

@ -3,6 +3,7 @@ package mq
import (
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/dao"
"mongo.games.com/game/dbproxy/svc"
"mongo.games.com/game/model"
"mongo.games.com/game/mq"
@ -27,4 +28,28 @@ func init() {
return
},
})
mq.RegisterHandler(&mq.RegisterHandlerParam{
Name: mq.DBRedPacket,
Data: &model.RedPacketHistory{},
Handler: func(data interface{}) (err error) {
log, ok := data.(*model.RedPacketHistory)
if !ok {
return
}
d, err := dao.GetRedPacketHistory(log.Platform)
if err != nil {
logger.Logger.Errorf("get RedPacketHistory failed: %v", err)
return err
}
err = d.Save(log)
if err != nil {
logger.Logger.Errorf("Save RedPacketHistory failed: %v", err)
return err
}
return nil
},
})
}

View File

@ -52,3 +52,20 @@ func (r *RedPacketService) UpdateAll(req *model.UpdateRedPacketAllReq, res *bool
return nil
}
func (r *RedPacketService) GetHistory(req *model.GetRedPacketHistoryReq, res *[]*model.RedPacketHistory) error {
d, err := dao.GetRedPacketHistory(req.Plt)
if err != nil {
return err
}
list, err := d.GetHistory(req.Snid, req.Cid)
if err != nil {
logger.Logger.Errorf("RedPacketService.GetHistory error: %v", err)
return err
}
*res = list
return nil
}

View File

@ -75,3 +75,42 @@ type BackRedPacket struct {
ItemNum int64 // 道具数量
Ts int64 // 时间戳
}
//go:generate mongoctl -model-dir=. -model-names=RedPacketHistory -dao-dir=../dao/
type RedPacketHistory struct {
Platform string `bson:"-"` // 平台
ID primitive.ObjectID `bson:"_id" gen:"autoFill"`
Cid int64 // 红包活动id
Snid int32 // 玩家id
Ts int64 // 时间戳
ItemId int32 // 道具id
ItemNum int64 // 道具数量
}
type GetRedPacketHistoryReq struct {
Plt string
Snid int32
Cid int64
}
func GetRedPacketHistory(plt string, snid int32, cid int64) (res []*RedPacketHistory, err error) {
if rpcCli == nil {
logger.Logger.Error("model.GetRedPacketHistory rpcCli == nil")
return nil, errors.New("rpc client is nil")
}
req := &GetRedPacketHistoryReq{
Plt: plt,
Snid: snid,
Cid: cid,
}
res = make([]*RedPacketHistory, 0)
err = rpcCli.CallWithTimeout("RedPacketService.GetHistory", req, &res, time.Second*30)
if err != nil {
logger.Logger.Errorf("GetRedPacketHistory error: %v", err)
return nil, err
}
return res, nil
}

View File

@ -46,8 +46,9 @@ const (
DBInvite = "db_invite"
DBAPILog = "db_apilog"
DBGiveLog = "db_givelog"
DBLotteryCode = "db_lotterycode" // 玩家抽奖码
DBLotteryLog = "db_lotterylog" // 中奖记录
DBLotteryCode = "db_lotterycode" // 玩家抽奖码
DBLotteryLog = "db_lotterylog" // 中奖记录
DBRedPacket = "db_redpackethistory" // 红包记录
)
// ranksrv 消息

View File

@ -55,6 +55,9 @@ const (
//年兽排行榜
Rank_PACKET_RANK_CSNian Rank = 10019
Rank_PACKET_RANK_SCNian Rank = 10020
// 红包抽奖记录
Rank_PACKET_CSRedPacketHistory Rank = 10021
Rank_PACKET_SCRedPacketHistory Rank = 10022
)
// Enum value maps for Rank.
@ -82,30 +85,34 @@ var (
10018: "PACKET_SCLotteryHistory",
10019: "PACKET_RANK_CSNian",
10020: "PACKET_RANK_SCNian",
10021: "PACKET_CSRedPacketHistory",
10022: "PACKET_SCRedPacketHistory",
}
Rank_value = map[string]int32{
"PACKET_RANK_ZERO": 0,
"PACKET_RANK_CSRankMatch": 10000,
"PACKET_RANK_SCRankMatch": 10001,
"PACKET_RANK_CSCoin": 10002,
"PACKET_RANK_SCCoin": 10003,
"PACKET_RANK_CSInvite": 10004,
"PACKET_RANK_SCInvite": 10005,
"PACKET_CSInviteLog": 10006,
"PACKET_SCInviteLog": 10007,
"PACKET_RANK_CSWinCoin": 10008,
"PACKET_RANK_SCWinCoin": 10009,
"PACKET_RANK_CSLevel": 10010,
"PACKET_RANK_SCLevel": 10011,
"PACKET_RANK_CSPermit": 10012,
"PACKET_RANK_SCPermit": 10013,
"PACKET_CSRoomAward": 10014,
"PACKET_SCRoomAward": 10015,
"PACKET_SCRoomAwardOne": 10016,
"PACKET_CSLotteryHistory": 10017,
"PACKET_SCLotteryHistory": 10018,
"PACKET_RANK_CSNian": 10019,
"PACKET_RANK_SCNian": 10020,
"PACKET_RANK_ZERO": 0,
"PACKET_RANK_CSRankMatch": 10000,
"PACKET_RANK_SCRankMatch": 10001,
"PACKET_RANK_CSCoin": 10002,
"PACKET_RANK_SCCoin": 10003,
"PACKET_RANK_CSInvite": 10004,
"PACKET_RANK_SCInvite": 10005,
"PACKET_CSInviteLog": 10006,
"PACKET_SCInviteLog": 10007,
"PACKET_RANK_CSWinCoin": 10008,
"PACKET_RANK_SCWinCoin": 10009,
"PACKET_RANK_CSLevel": 10010,
"PACKET_RANK_SCLevel": 10011,
"PACKET_RANK_CSPermit": 10012,
"PACKET_RANK_SCPermit": 10013,
"PACKET_CSRoomAward": 10014,
"PACKET_SCRoomAward": 10015,
"PACKET_SCRoomAwardOne": 10016,
"PACKET_CSLotteryHistory": 10017,
"PACKET_SCLotteryHistory": 10018,
"PACKET_RANK_CSNian": 10019,
"PACKET_RANK_SCNian": 10020,
"PACKET_CSRedPacketHistory": 10021,
"PACKET_SCRedPacketHistory": 10022,
}
)
@ -2569,6 +2576,165 @@ func (x *SCNian) GetTypeId() int32 {
return 0
}
// 红包抽奖记录
// PACKET_CSRedPacketHistory
type CSRedPacketHistory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 红包活动id
}
func (x *CSRedPacketHistory) Reset() {
*x = CSRedPacketHistory{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_rank_rank_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSRedPacketHistory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSRedPacketHistory) ProtoMessage() {}
func (x *CSRedPacketHistory) ProtoReflect() protoreflect.Message {
mi := &file_protocol_rank_rank_proto_msgTypes[33]
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 CSRedPacketHistory.ProtoReflect.Descriptor instead.
func (*CSRedPacketHistory) Descriptor() ([]byte, []int) {
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{33}
}
func (x *CSRedPacketHistory) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
type RedPacketHistory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Ts int64 `protobuf:"varint,1,opt,name=Ts,proto3" json:"Ts,omitempty"` // 时间戳
ItemId int32 `protobuf:"varint,5,opt,name=ItemId,proto3" json:"ItemId,omitempty"` // 道具id
ItemNum int64 `protobuf:"varint,6,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` // 道具数量
}
func (x *RedPacketHistory) Reset() {
*x = RedPacketHistory{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_rank_rank_proto_msgTypes[34]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedPacketHistory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedPacketHistory) ProtoMessage() {}
func (x *RedPacketHistory) ProtoReflect() protoreflect.Message {
mi := &file_protocol_rank_rank_proto_msgTypes[34]
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 RedPacketHistory.ProtoReflect.Descriptor instead.
func (*RedPacketHistory) Descriptor() ([]byte, []int) {
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{34}
}
func (x *RedPacketHistory) GetTs() int64 {
if x != nil {
return x.Ts
}
return 0
}
func (x *RedPacketHistory) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *RedPacketHistory) GetItemNum() int64 {
if x != nil {
return x.ItemNum
}
return 0
}
type SCRedPacketHistory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
List []*RedPacketHistory `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"`
}
func (x *SCRedPacketHistory) Reset() {
*x = SCRedPacketHistory{}
if protoimpl.UnsafeEnabled {
mi := &file_protocol_rank_rank_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCRedPacketHistory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCRedPacketHistory) ProtoMessage() {}
func (x *SCRedPacketHistory) ProtoReflect() protoreflect.Message {
mi := &file_protocol_rank_rank_proto_msgTypes[35]
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 SCRedPacketHistory.ProtoReflect.Descriptor instead.
func (*SCRedPacketHistory) Descriptor() ([]byte, []int) {
return file_protocol_rank_rank_proto_rawDescGZIP(), []int{35}
}
func (x *SCRedPacketHistory) GetList() []*RedPacketHistory {
if x != nil {
return x.List
}
return nil
}
var File_protocol_rank_rank_proto protoreflect.FileDescriptor
var file_protocol_rank_rank_proto_rawDesc = []byte{
@ -2805,56 +2971,72 @@ var file_protocol_rank_rank_proto_rawDesc = []byte{
0x28, 0x05, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05,
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x6f, 0x74,
0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x2a, 0xd0, 0x04, 0x0a, 0x04, 0x52,
0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41,
0x4e, 0x4b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d,
0x61, 0x74, 0x63, 0x68, 0x10, 0x90, 0x4e, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x10, 0x91, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17,
0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43,
0x43, 0x6f, 0x69, 0x6e, 0x10, 0x93, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10,
0x94, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e,
0x4b, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a,
0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
0x4c, 0x6f, 0x67, 0x10, 0x96, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12,
0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43,
0x53, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x98, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e,
0x43, 0x6f, 0x69, 0x6e, 0x10, 0x99, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a,
0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b,
0x5f, 0x53, 0x43, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9b, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x50, 0x65, 0x72,
0x6d, 0x69, 0x74, 0x10, 0x9c, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9d,
0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x52, 0x6f,
0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x9e, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64,
0x10, 0x9f, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4f, 0x6e, 0x65, 0x10, 0xa0, 0x4e, 0x12,
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x4c, 0x6f, 0x74, 0x74,
0x65, 0x72, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa1, 0x4e, 0x12, 0x1c, 0x0a,
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72,
0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa2, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4e, 0x69, 0x61,
0x6e, 0x10, 0xa3, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x4e, 0x69, 0x61, 0x6e, 0x10, 0xa4, 0x4e, 0x2a, 0x8d, 0x01,
0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f,
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e, 0x6f, 0x6e, 0x65, 0x10,
0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f,
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74,
0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10,
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6f, 0x6e, 0x74, 0x68,
0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65,
0x5f, 0x55, 0x70, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x76,
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10, 0x05, 0x42, 0x24, 0x5a,
0x22, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72,
0x61, 0x6e, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x22, 0x24, 0x0a, 0x12, 0x43, 0x53,
0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64,
0x22, 0x54, 0x0a, 0x10, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x69, 0x73,
0x74, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
0x52, 0x02, 0x54, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x05,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x49,
0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0x40, 0x0a, 0x12, 0x53, 0x43, 0x52, 0x65, 0x64, 0x50,
0x61, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x2a, 0x0a, 0x04,
0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x61, 0x6e,
0x6b, 0x2e, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f,
0x72, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x90, 0x05, 0x0a, 0x04, 0x52, 0x61, 0x6e,
0x6b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b,
0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74,
0x63, 0x68, 0x10, 0x90, 0x4e, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68,
0x10, 0x91, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41,
0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17, 0x0a, 0x12,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x43, 0x6f,
0x69, 0x6e, 0x10, 0x93, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x94, 0x4e,
0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f,
0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f,
0x67, 0x10, 0x96, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12, 0x1a, 0x0a,
0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x57,
0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x98, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e, 0x43, 0x6f,
0x69, 0x6e, 0x10, 0x99, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a, 0x4e, 0x12,
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53,
0x43, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9b, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x50, 0x65, 0x72, 0x6d, 0x69,
0x74, 0x10, 0x9c, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9d, 0x4e, 0x12,
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x52, 0x6f, 0x6f, 0x6d,
0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x9e, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x9f,
0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x6f,
0x6f, 0x6d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4f, 0x6e, 0x65, 0x10, 0xa0, 0x4e, 0x12, 0x1c, 0x0a,
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72,
0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa1, 0x4e, 0x12, 0x1c, 0x0a, 0x17, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x48,
0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa2, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4e, 0x69, 0x61, 0x6e, 0x10,
0xa3, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e,
0x4b, 0x5f, 0x53, 0x43, 0x4e, 0x69, 0x61, 0x6e, 0x10, 0xa4, 0x4e, 0x12, 0x1e, 0x0a, 0x19, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65,
0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa5, 0x4e, 0x12, 0x1e, 0x0a, 0x19, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65,
0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x10, 0xa6, 0x4e, 0x2a, 0x8d, 0x01, 0x0a, 0x0a,
0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e,
0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12,
0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x6f,
0x74, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54,
0x79, 0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e,
0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x10, 0x03,
0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x55,
0x70, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74,
0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10, 0x05, 0x42, 0x24, 0x5a, 0x22, 0x6d,
0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67,
0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x61, 0x6e,
0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -2870,7 +3052,7 @@ func file_protocol_rank_rank_proto_rawDescGZIP() []byte {
}
var file_protocol_rank_rank_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_protocol_rank_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 33)
var file_protocol_rank_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 36)
var file_protocol_rank_rank_proto_goTypes = []interface{}{
(Rank)(0), // 0: rank.Rank
(RankInvite)(0), // 1: rank.RankInvite
@ -2907,6 +3089,9 @@ var file_protocol_rank_rank_proto_goTypes = []interface{}{
(*CSNian)(nil), // 32: rank.CSNian
(*NianRankData)(nil), // 33: rank.NianRankData
(*SCNian)(nil), // 34: rank.SCNian
(*CSRedPacketHistory)(nil), // 35: rank.CSRedPacketHistory
(*RedPacketHistory)(nil), // 36: rank.RedPacketHistory
(*SCRedPacketHistory)(nil), // 37: rank.SCRedPacketHistory
}
var file_protocol_rank_rank_proto_depIdxs = []int32{
3, // 0: rank.SCRankMatch.Ranks:type_name -> rank.SeasonRank
@ -2929,11 +3114,12 @@ var file_protocol_rank_rank_proto_depIdxs = []int32{
30, // 17: rank.SCLotteryHistory.List:type_name -> rank.LotteryHistory
33, // 18: rank.SCNian.Ranks:type_name -> rank.NianRankData
33, // 19: rank.SCNian.Me:type_name -> rank.NianRankData
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
20, // [20:20] is the sub-list for extension extendee
0, // [0:20] is the sub-list for field type_name
36, // 20: rank.SCRedPacketHistory.List:type_name -> rank.RedPacketHistory
21, // [21:21] is the sub-list for method output_type
21, // [21:21] is the sub-list for method input_type
21, // [21:21] is the sub-list for extension type_name
21, // [21:21] is the sub-list for extension extendee
0, // [0:21] is the sub-list for field type_name
}
func init() { file_protocol_rank_rank_proto_init() }
@ -3338,6 +3524,42 @@ func file_protocol_rank_rank_proto_init() {
return nil
}
}
file_protocol_rank_rank_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSRedPacketHistory); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protocol_rank_rank_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedPacketHistory); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protocol_rank_rank_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCRedPacketHistory); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -3345,7 +3567,7 @@ func file_protocol_rank_rank_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protocol_rank_rank_proto_rawDesc,
NumEnums: 2,
NumMessages: 33,
NumMessages: 36,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -36,6 +36,9 @@ enum Rank{
//
PACKET_RANK_CSNian = 10019;
PACKET_RANK_SCNian = 10020;
//
PACKET_CSRedPacketHistory = 10021;
PACKET_SCRedPacketHistory = 10022;
}
//
@ -299,3 +302,17 @@ message SCNian{
int32 Total = 5; //
int32 TypeId = 6;
}
//
// PACKET_CSRedPacketHistory
message CSRedPacketHistory{
int64 Id = 1; // id
}
message RedPacketHistory{
int64 Ts = 1; //
int32 ItemId = 5; // id
int64 ItemNum = 6; //
}
message SCRedPacketHistory{
repeated RedPacketHistory List = 1;
}

View File

@ -34,6 +34,8 @@ func init() {
com.Register(int(rankproto.Rank_PACKET_CSLotteryHistory), rankproto.CSLotteryHistory{}, CSLotteryHistory)
//年兽排行榜
com.Register(int(rankproto.Rank_PACKET_RANK_CSNian), rankproto.CSNian{}, CSNian)
// 红包历史记录
com.Register(int(rankproto.Rank_PACKET_CSRedPacketHistory), rankproto.CSRedPacketHistory{}, CSRedPacketHistory)
}
func CSRankMatch(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
@ -648,6 +650,7 @@ func CSLotteryHistory(s *netlib.Session, d *rankproto.GateTransmit, packetId int
})
return nil
}
func CSNian(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
logger.Logger.Trace("CSNian data:", data)
msg, ok := data.(*rankproto.CSNian)
@ -783,3 +786,36 @@ func CSNian(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data int
}
return nil
}
func CSRedPacketHistory(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
logger.Logger.Trace("CSRedPacketHistory data:", data)
msg, ok := data.(*rankproto.CSRedPacketHistory)
if !ok {
return nil
}
pack := &rankproto.SCRedPacketHistory{}
var list []*model.RedPacketHistory
var err error
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
list, err = model.GetRedPacketHistory(d.Platform, d.Snid, msg.GetId())
if err != nil {
logger.Logger.Errorf("GetRedPacketHistory error: %v", err)
}
return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
if err == nil {
for _, v := range list {
pack.List = append(pack.List, &rankproto.RedPacketHistory{
Ts: v.Ts,
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
}
}
common.SendToGate(sid, int(rankproto.Rank_PACKET_SCRedPacketHistory), pack, s)
}), "CSRedPacketHistory").Start()
return nil
}

View File

@ -8,6 +8,7 @@ import (
"sort"
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/module"
@ -2474,6 +2475,16 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr
Ts: now,
}, mq.BackRedPacket)
mq.Write(&model.RedPacketHistory{
Platform: p.Platform,
ID: primitive.NewObjectID(),
Cid: id,
Snid: p.SnId,
Ts: time.Now().Unix(),
ItemId: cfg.GetItemId(),
ItemNum: reward,
}, mq.DBRedPacket)
_, pack.RemainCount = RedPacketMgrInst.GetRemainTimesByConfig(p, cfg)
Send(welfare.OpResultCode_OPRC_Sucess)
return pack