add 红包活动测试代码

This commit is contained in:
sk 2025-01-02 11:47:00 +08:00
parent b88ccb664d
commit 7876fa34f9
1 changed files with 93 additions and 0 deletions

View File

@ -112,6 +112,99 @@ func init() {
etcd.Register(etcd.ETCDKEY_PigBankProp, webapi.GamePigBankPropConfig{}, platformConfigEvent)
// 红包配置
etcd.Register(etcd.ETCDKEY_REDPACKET, webapi.RedPacketConfig{}, platformConfigEvent)
WelfareMgrSington.UpdateRedPacket(&webapi.RedPacketConfig{
Platform: "1",
List: []*webapi.RedPacketInfo{
{
Id: 1,
On: 1,
StartHMS: 90000,
EndHMS: 100000,
StayTs: 0,
MaxCount: 100,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 2,
On: 1,
StartHMS: 100000,
EndHMS: 120000,
StayTs: 30,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 3,
On: 1,
StartHMS: 120000,
EndHMS: 180000,
StayTs: 0,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
},
}, false)
}
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {