feat: 添加用户关注功能
- 新增 Follow 表和 User.bio 字段 (Prisma schema)
- 创建 follow 模块 (action-service-repository)
- 新增 FollowButton/FollowStats/UserList 组件
- 用户页面显示 bio、粉丝/关注数、关注按钮
- 新增 /users/[username]/followers 和 following 页面
- 添加 en-US/zh-CN i18n 翻译
⚠️ 需要运行: prisma migrate dev --name add_follow_and_bio
This commit is contained in:
51
src/modules/follow/follow-repository-dto.ts
Normal file
51
src/modules/follow/follow-repository-dto.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
export type RepoInputCreateFollow = {
|
||||
followerId: string;
|
||||
followingId: string;
|
||||
};
|
||||
|
||||
export type RepoInputDeleteFollow = {
|
||||
followerId: string;
|
||||
followingId: string;
|
||||
};
|
||||
|
||||
export type RepoInputCheckFollow = {
|
||||
followerId: string;
|
||||
followingId: string;
|
||||
};
|
||||
|
||||
export type RepoInputGetFollowers = {
|
||||
userId: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
export type RepoInputGetFollowing = {
|
||||
userId: string;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
export type RepoOutputFollowUser = {
|
||||
id: string;
|
||||
followerId: string;
|
||||
followingId: string;
|
||||
createdAt: Date;
|
||||
};
|
||||
|
||||
export type RepoOutputFollowWithUser = {
|
||||
id: string;
|
||||
followerId: string;
|
||||
followingId: string;
|
||||
createdAt: Date;
|
||||
user: {
|
||||
id: string;
|
||||
username: string | null;
|
||||
displayUsername: string | null;
|
||||
image: string | null;
|
||||
bio: string | null;
|
||||
};
|
||||
};
|
||||
|
||||
export type RepoOutputFollowerCount = number;
|
||||
export type RepoOutputFollowingCount = number;
|
||||
export type RepoOutputIsFollowing = boolean;
|
||||
Reference in New Issue
Block a user