|
@ -43,12 +43,17 @@ func (t *LotteryDrawCtl) Start() { |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStart, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "开始抽奖", |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStart, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "开始抽奖", |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
@ -79,14 +84,19 @@ func (t *LotteryDrawCtl) StartRoll() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStart, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"desc": "开始滚动", |
|
|
|
|
|
"number": num, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStart, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"desc": "开始滚动", |
|
|
|
|
|
"number": num, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
@ -112,14 +122,19 @@ func (t *LotteryDrawCtl) StopRoll() { |
|
|
} |
|
|
} |
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStop, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"desc": "停止滚动", |
|
|
|
|
|
"number": num, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStop, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"desc": "停止滚动", |
|
|
|
|
|
"number": num, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
@ -152,12 +167,17 @@ func (t *LotteryDrawCtl) Stop() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStop, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "结束抽奖", |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStop, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "结束抽奖", |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
t.SUCCESS("操作成功") |
|
|
t.SUCCESS("操作成功") |
|
|
} |
|
|
} |
|
@ -343,14 +363,19 @@ func (t *LotteryDrawCtl) Lottery() { |
|
|
|
|
|
|
|
|
// 通知直播开始抽奖
|
|
|
// 通知直播开始抽奖
|
|
|
if activity.RehearsalId == 0 { |
|
|
if activity.RehearsalId == 0 { |
|
|
im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawResult, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"winners": winners, |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "抽奖结果", |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
live := new(models.LiveConfig) |
|
|
|
|
|
exist, err := live.GetByActivityId(activity.Id) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
if exist && live.HaveModule(define.MODULE_LOTTERY) { |
|
|
|
|
|
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawResult, |
|
|
|
|
|
map[string]interface{}{ |
|
|
|
|
|
"lottery_draw_ladder_id": ladder.Id, |
|
|
|
|
|
"winners": winners, |
|
|
|
|
|
"roll_num": ladder.RollNum, |
|
|
|
|
|
"timestamp": time.Now().Unix(), |
|
|
|
|
|
"desc": "抽奖结果", |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
t.JSON(winners) |
|
|
t.JSON(winners) |
|
|