feat(image): 新建 knowai-core:1.0.0 镜像并完成推送
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
- 搭建 api、auth、utils 等逻辑模块 - 通过 tsc、eslint、vitest 测试验证 BREAKING CHANGE: 新镜像分支
This commit is contained in:
52
types/user/base.d.ts
vendored
Normal file
52
types/user/base.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
import { NotificationType } from './enum';
|
||||
|
||||
// 最小用户信息
|
||||
export interface User{
|
||||
id: string;
|
||||
username: string;
|
||||
}
|
||||
|
||||
// 认证
|
||||
export interface LoginRequest{
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse{
|
||||
user: User;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface RegisterRequest {
|
||||
username: string;
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface RegisterResponse {
|
||||
user: User;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface ChangePasswordRequest { // 暂时用不到
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface RefreshTokenRequest {
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export interface RefreshTokenResponse {
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
// 用户通知
|
||||
export interface UserNotification { // 暂时用不到
|
||||
id: string;
|
||||
userId: string;
|
||||
type: NotificationType;
|
||||
content: string;
|
||||
isRead: boolean;
|
||||
createdAt: Date;
|
||||
}
|
||||
8
types/user/enum.d.ts
vendored
Normal file
8
types/user/enum.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// 通知类型枚举
|
||||
export enum NotificationType {
|
||||
LIKE = 'like',
|
||||
COMMENT = 'comment',
|
||||
FOLLOW = 'follow',
|
||||
MENTION = 'mention'
|
||||
}
|
||||
|
||||
4
types/user/index.d.ts
vendored
Normal file
4
types/user/index.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './base';
|
||||
export * from './profile';
|
||||
export * from './search';
|
||||
export * from './enum';
|
||||
36
types/user/profile.d.ts
vendored
Normal file
36
types/user/profile.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { User } from './base';
|
||||
|
||||
// 用户档案以及更新
|
||||
export interface UserProfile{
|
||||
user: User;
|
||||
avatar: string;
|
||||
introduction: string;
|
||||
level: string;
|
||||
}
|
||||
|
||||
export interface UserProfileUpdateRequest {
|
||||
avatar?: string;
|
||||
introduction?: string;
|
||||
level?: string;
|
||||
}
|
||||
|
||||
export interface UserProfileUpdateResponse {
|
||||
profile: UserProfile;
|
||||
}
|
||||
|
||||
// 用户关系
|
||||
export interface UserRelation {
|
||||
id: string;
|
||||
followerId: string[];
|
||||
followingId: string[];
|
||||
}
|
||||
|
||||
export interface UserFollowRequest {
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export interface UserFollowResponse {
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
|
||||
12
types/user/search.d.ts
vendored
Normal file
12
types/user/search.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { UserProfile } from './profile';
|
||||
|
||||
// 用户搜索结果
|
||||
export interface UserSearchRequest {
|
||||
keyword: string;
|
||||
}
|
||||
|
||||
export interface UserSearchResponse {
|
||||
users: Array<UserProfile>
|
||||
total: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user