28 lines
661 B
Go
28 lines
661 B
Go
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)
|
|
}
|