feat: add member URL pool and login tracking
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package queues
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/queue"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
func init() { queue.RegisterConsumer(AppMemberLoginLog) }
|
||||
|
||||
var AppMemberLoginLog = &qAppMemberLoginLog{}
|
||||
|
||||
type qAppMemberLoginLog struct{}
|
||||
|
||||
func (q *qAppMemberLoginLog) GetTopic() string { return consts.QueueAppMemberLoginLogTopic }
|
||||
|
||||
func (q *qAppMemberLoginLog) Handle(ctx context.Context, mqMsg queue.MqMsg) error {
|
||||
var data entity.AppMemberLoginLog
|
||||
if err := json.Unmarshal(mqMsg.Body, &data); err != nil {
|
||||
return err
|
||||
}
|
||||
return service.SysAppMemberLoginLog().RealWrite(ctx, data)
|
||||
}
|
||||
Reference in New Issue
Block a user