- 用 Deck 替换 Folder - 用 Note + Card 替换 Pair (双向复习) - 添加 NoteType (卡片模板) - 添加 Revlog (复习历史) - 实现 SM-2 间隔重复算法 - 更新所有前端页面 - 添加数据库迁移
91 lines
1.6 KiB
TypeScript
91 lines
1.6 KiB
TypeScript
import { Visibility } from "../../../generated/prisma/enums";
|
|
|
|
export interface RepoInputCreateDeck {
|
|
name: string;
|
|
desc?: string;
|
|
userId: string;
|
|
visibility?: Visibility;
|
|
}
|
|
|
|
export interface RepoInputUpdateDeck {
|
|
id: number;
|
|
name?: string;
|
|
desc?: string;
|
|
visibility?: Visibility;
|
|
collapsed?: boolean;
|
|
}
|
|
|
|
export interface RepoInputGetDeckById {
|
|
id: number;
|
|
}
|
|
|
|
export interface RepoInputGetDecksByUserId {
|
|
userId: string;
|
|
}
|
|
|
|
export interface RepoInputGetPublicDecks {
|
|
limit?: number;
|
|
offset?: number;
|
|
orderBy?: "createdAt" | "name";
|
|
}
|
|
|
|
export interface RepoInputDeleteDeck {
|
|
id: number;
|
|
}
|
|
|
|
export type RepoOutputDeck = {
|
|
id: number;
|
|
name: string;
|
|
desc: string;
|
|
userId: string;
|
|
visibility: Visibility;
|
|
collapsed: boolean;
|
|
conf: unknown;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
cardCount?: number;
|
|
};
|
|
|
|
export type RepoOutputPublicDeck = RepoOutputDeck & {
|
|
userName: string | null;
|
|
userUsername: string | null;
|
|
favoriteCount: number;
|
|
};
|
|
|
|
export type RepoOutputDeckOwnership = {
|
|
userId: string;
|
|
};
|
|
|
|
export interface RepoInputToggleDeckFavorite {
|
|
deckId: number;
|
|
userId: string;
|
|
}
|
|
|
|
export interface RepoInputCheckDeckFavorite {
|
|
deckId: number;
|
|
userId: string;
|
|
}
|
|
|
|
export interface RepoInputSearchPublicDecks {
|
|
query: string;
|
|
limit?: number;
|
|
offset?: number;
|
|
}
|
|
|
|
export interface RepoInputGetPublicDeckById {
|
|
deckId: number;
|
|
}
|
|
|
|
export type RepoOutputDeckFavorite = {
|
|
isFavorited: boolean;
|
|
favoriteCount: number;
|
|
};
|
|
|
|
export interface RepoInputGetUserFavoriteDecks {
|
|
userId: string;
|
|
}
|
|
|
|
export type RepoOutputUserFavoriteDeck = RepoOutputPublicDeck & {
|
|
favoritedAt: Date;
|
|
};
|