refactor: separate backend domains and storage adapters

This commit is contained in:
2026-08-14 01:37:56 +08:00
parent e6775f0966
commit 8c4c6ba661
102 changed files with 6644 additions and 5735 deletions
+28
View File
@@ -0,0 +1,28 @@
package biz
import (
"context"
"time"
)
type APIToken struct {
ID uint
CreatedAt time.Time
UpdatedAt time.Time
UserID uint
AuthorityID uint
Token string
Status bool
ExpiresAt time.Time
Remark string
User *User
}
type APITokenRepo interface {
UserHasAuthority(context.Context, uint, uint) (*User, bool, error)
CreateAPIToken(context.Context, *APIToken) error
ListAPITokens(context.Context, int, int, uint, *bool) ([]*APIToken, int64, error)
DisableAPIToken(context.Context, uint) (string, error)
BlacklistToken(context.Context, string) error
IsTokenDisabled(context.Context, string) (bool, error)
}