Commit 0411e76f authored by hujiebin's avatar hujiebin

fix:移动一下增加用户天上麦时长位置

parent 796e14c7
......@@ -17,6 +17,7 @@ import (
"hilo-group/domain/model/diamond_m"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/group_m"
"hilo-group/domain/model/mic_m"
"hilo-group/domain/model/msg_m"
"hilo-group/domain/model/task_m"
"hilo-group/domain/model/user_m"
......@@ -521,5 +522,18 @@ func OnMic() {
}
return nil
})
// 用户上麦时长
mic_ev.AddOnMicEventAsync(func(model *domain.Model, e interface{}) error {
event, ok := e.(*mic_ev.OnMicEvent)
if !ok {
model.Log.Errorf("AddOnMicEventSync event type err")
return nil
}
if err := mic_m.IncrUserOnMic(model, event.UserId, event.Timestamp); err != nil {
model.Log.Errorf("cron micIn IncrUserOnMic err:%v", err)
} else {
model.Log.Infof("cron micIn IncrUserOnMic success,userId:%v", event.UserId)
}
return nil
})
}
......@@ -12,7 +12,6 @@ import (
"hilo-group/domain/event/group_ev"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/group_m"
"hilo-group/domain/model/mic_m"
"hilo-group/domain/service/signal_s"
"hilo-group/myerr"
"hilo-group/myerr/bizerr"
......@@ -323,9 +322,5 @@ func (s *GroupMicService) IncrGroupPowerOnMicExpAndTime(groupId string, userId u
if err := groupPower_m.IncrGroupPowerStarOnMic(model, groupPowerId, userId, joinMicTimestamp); err != nil {
model.Log.Errorf("IncrGroupPowerOnMicTime fail:%v", err)
}
// 增加用户天上麦时长
if err := mic_m.IncrUserOnMic(model, userId, joinMicTimestamp); err != nil {
model.Log.Errorf("IncrUserOnMic fail:%v", err)
}
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment