feat: 增强令牌管理与客户端仓库集成
新增 ClientRepository 接口,用于管理客户端相关操作。 更新 Token 模型,加入版本号和过期时间字段,以提升令牌管理能力。 将 ClientRepo 集成到容器中,支持依赖注入。 重构 TokenService,采用 JWT 以增强安全性。 更新 Docker 配置,并清理多个文件中的空白字符。
This commit is contained in:
@@ -83,5 +83,14 @@ type YggdrasilRepository interface {
|
||||
ResetPassword(id int64, password string) error
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ClientRepository Client仓储接口
|
||||
type ClientRepository interface {
|
||||
Create(client *model.Client) error
|
||||
FindByClientToken(clientToken string) (*model.Client, error)
|
||||
FindByUUID(uuid string) (*model.Client, error)
|
||||
FindByUserID(userID int64) ([]*model.Client, error)
|
||||
Update(client *model.Client) error
|
||||
IncrementVersion(clientUUID string) error
|
||||
DeleteByClientToken(clientToken string) error
|
||||
DeleteByUserID(userID int64) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user