update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package dto
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
@@ -16,3 +16,18 @@ type AuthorizeUser struct {
|
||||
IP string `json:"ip"`
|
||||
Browser string `json:"browser"`
|
||||
}
|
||||
|
||||
func NewAuthorizeUser(user *User, ip, os, browser string) AuthorizeUser {
|
||||
return AuthorizeUser{
|
||||
ID: user.ID,
|
||||
Uuid: user.Uuid,
|
||||
Email: user.Email,
|
||||
Username: user.Username,
|
||||
Avatar: user.Avatar,
|
||||
RoleID: user.Role.ID,
|
||||
RoleName: user.Role.DisplayName,
|
||||
OS: os,
|
||||
IP: ip,
|
||||
Browser: browser,
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ type LoginLogRepository interface {
|
||||
GetLatest(ctx context.Context, email string) ([]*LoginLog, error)
|
||||
Count(ctx context.Context, filter dto.SearchDto) (int64, error)
|
||||
List(ctx context.Context, filter dto.SearchDto) ([]*LoginLog, error)
|
||||
HistoricalLogin(ctx context.Context, email string, createdAt time.Time) ([]*LoginLog, error)
|
||||
}
|
||||
|
||||
type LoginLog struct {
|
||||
|
||||
Reference in New Issue
Block a user