Skip to content

Commit 823e010

Browse files
committed
feat: add status and user_id fields to LogoutToken; implement token management methods in UserUsecase
1 parent d719dd9 commit 823e010

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

domain/logout_token.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ type (
88
Token string `gorm:"type:varchar(255);not null;unique" json:"token"`
99
ExpiredAt time.Time `json:"expired_at"`
1010
CreatedAt time.Time `json:"created_at"`
11+
Status int `json:"status"`
12+
UserId int `json:"user_id"`
13+
1114
}
1215
)
1316

domain/user.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ type (
1919
GetUsersGenericConditions(ctx context.Context, filter GetUserBy) (users []User, err error)
2020
ResetPassword(ctx context.Context, email, password, token string) error
2121
ForgotPassword(ctx context.Context, token string, expiredAt time.Time, user User) error
22+
StoreToken(ctx context.Context, token string, expiredAt time.Time, uid int) error
23+
UnactivateTokenByUser(ctx context.Context, uid int) error
24+
CheckActiveToken(ctx context.Context, token string) (logoutToken LogoutToken, err error)
2225
}
2326
UserUsecase interface {
2427
GetUsers(ctx context.Context) (users []User, err error)

0 commit comments

Comments
 (0)