update
This commit is contained in:
33
internal/erpserver/model/system/authorize_user.go
Normal file
33
internal/erpserver/model/system/authorize_user.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type AuthorizeUser struct {
|
||||
ID int32 `json:"id"`
|
||||
Uuid uuid.UUID `json:"uuid"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
RoleID int32 `json:"role_id"`
|
||||
RoleName string `json:"role_name"`
|
||||
OS string `json:"os"`
|
||||
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