抽奖活动开奖剩余时间

This commit is contained in:
sk 2024-10-31 09:12:09 +08:00
parent 3e02f7ba03
commit 5747ad0380
3 changed files with 16 additions and 2 deletions

View File

@ -4186,6 +4186,7 @@ type LotteryInfo struct {
// 玩家数据
CostRoomCard int64 `protobuf:"varint,17,opt,name=CostRoomCard,proto3" json:"CostRoomCard,omitempty"` // 消耗房卡
Codes []string `protobuf:"bytes,18,rep,name=Codes,proto3" json:"Codes,omitempty"` // 本期获得号码
RemainTime int64 `protobuf:"varint,19,opt,name=RemainTime,proto3" json:"RemainTime,omitempty"` // 剩余时间,单位秒
}
func (x *LotteryInfo) Reset() {
@ -4346,6 +4347,13 @@ func (x *LotteryInfo) GetCodes() []string {
return nil
}
func (x *LotteryInfo) GetRemainTime() int64 {
if x != nil {
return x.RemainTime
}
return 0
}
//PACKET_SCLotteryInfo
type SCLotteryInfo struct {
state protoimpl.MessageState
@ -4918,7 +4926,7 @@ var file_welfare_proto_rawDesc = []byte{
0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75,
0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x53, 0x4c, 0x6f,
0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe0, 0x03, 0x0a, 0x0b, 0x4c, 0x6f,
0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x80, 0x04, 0x0a, 0x0b, 0x4c, 0x6f,
0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x74, 0x61,
0x72, 0x74, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x53, 0x74, 0x61, 0x72,
@ -4948,7 +4956,9 @@ var file_welfare_proto_rawDesc = []byte{
0x52, 0x4c, 0x12, 0x22, 0x0a, 0x0c, 0x43, 0x6f, 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x43, 0x61,
0x72, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x43, 0x6f, 0x73, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18,
0x12, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x63, 0x0a, 0x0d,
0x12, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a,
0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x0d,
0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a,
0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65,
0x6c, 0x66, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66,

View File

@ -530,6 +530,7 @@ message LotteryInfo {
//
int64 CostRoomCard = 17; //
repeated string Codes = 18; //
int64 RemainTime = 19; // ,
}
//PACKET_SCLotteryInfo

View File

@ -626,6 +626,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo {
}
state := 1
remainTime := int64(0)
switch {
case d.WinTs <= now.Unix():
state = common.LotteryStateOver // 已结束
@ -633,6 +634,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo {
state = common.LotteryStateNoStart // 未开始
default:
state = common.LotteryStateRun // 进行中
remainTime = d.WinTs - now.Unix()
}
info := &welfare.LotteryInfo{
@ -652,6 +654,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo {
Price: d.Price,
NeedRoomCard: LotteryRoomCard,
ImageURL: d.ImageURL,
RemainTime: remainTime,
}
if d.WinTs > 0 && d.WinTs > now.Unix() {