refactor: Remove Token management and integrate Redis for authentication
- Deleted the Token model and its repository, transitioning to a Redis-based token management system. - Updated the service layer to utilize Redis for token storage, enhancing performance and scalability. - Refactored the container to remove TokenRepository and integrate the new token service. - Cleaned up the Dockerfile and other files by removing unnecessary whitespace and comments. - Enhanced error handling and logging for Redis initialization and usage.
This commit is contained in:
@@ -67,18 +67,6 @@ type TextureRepository interface {
|
||||
CountByUploaderID(ctx context.Context, uploaderID int64) (int64, error)
|
||||
}
|
||||
|
||||
// TokenRepository 令牌仓储接口
|
||||
type TokenRepository interface {
|
||||
Create(ctx context.Context, token *model.Token) error
|
||||
FindByAccessToken(ctx context.Context, accessToken string) (*model.Token, error)
|
||||
GetByUserID(ctx context.Context, userId int64) ([]*model.Token, error)
|
||||
GetUUIDByAccessToken(ctx context.Context, accessToken string) (string, error)
|
||||
GetUserIDByAccessToken(ctx context.Context, accessToken string) (int64, error)
|
||||
DeleteByAccessToken(ctx context.Context, accessToken string) error
|
||||
DeleteByUserID(ctx context.Context, userId int64) error
|
||||
BatchDelete(ctx context.Context, accessTokens []string) (int64, error)
|
||||
}
|
||||
|
||||
// SystemConfigRepository 系统配置仓储接口
|
||||
type SystemConfigRepository interface {
|
||||
GetByKey(ctx context.Context, key string) (*model.SystemConfig, error)
|
||||
|
||||
Reference in New Issue
Block a user