u
This commit is contained in:
1 parent
bcc4722efc
commit
f48536774f
403 files changed
+34776
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import { httpPostJson, httpGet } from "@/utils/http";
|
||||
|
||||
export interface ForumPostAddParams {
|
||||
fatherId?: string;
|
||||
postId: string;
|
||||
companyId: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export const addForumCommentApi = (params: ForumPostAddParams) => {
|
||||
return httpPostJson<ForumCommentReuslt>("/forum/post/comment/add", params);
|
||||
};
|
||||
|
||||
export interface ForumCommentReuslt {
|
||||
commentId: string;
|
||||
postId: string;
|
||||
content: string;
|
||||
createTime: string;
|
||||
fatherId?: string;
|
||||
|
||||
publishCompany: Company;
|
||||
replyCompany: Company;
|
||||
|
||||
children?: ForumCommentReuslt[];
|
||||
}
|
||||
|
||||
interface Company {
|
||||
companyId: string;
|
||||
name: string;
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
export const getForumCommentListApi = (forumPostId: string) => {
|
||||
return httpGet<ForumCommentReuslt[]>(`/forum/post/comment/list?forumPostId=${forumPostId}`);
|
||||
};
|
||||
|
||||
export const deleteForumCommentApi = (forumCommentId: string) => {
|
||||
return httpPostJson<void>(`/forum/post/comment/delete/${forumCommentId}`);
|
||||
};
|
||||
@@ -0,0 +1,152 @@
|
||||
import { httpGet, httpPostJson } from "@/utils/http";
|
||||
|
||||
// 添加帖子
|
||||
export interface ForumPostAddParams {
|
||||
title: string;
|
||||
content: string;
|
||||
summary: string;
|
||||
cover?: string;
|
||||
tags: string[];
|
||||
companyId: string;
|
||||
}
|
||||
|
||||
export const addForumPostApi = (params: ForumPostAddParams) => {
|
||||
return httpPostJson<ForumPostDetailResult>("/forum/post/add", params);
|
||||
};
|
||||
|
||||
// 更新帖子
|
||||
export interface ForumPostUpdateParams {
|
||||
forumPostId: string; // 帖子 ID
|
||||
title: string;
|
||||
content: string;
|
||||
summary: string;
|
||||
cover?: string;
|
||||
tags?: string[];
|
||||
companyId: string;
|
||||
}
|
||||
export const updateForumPostApi = (params: ForumPostUpdateParams) => {
|
||||
return httpPostJson<ForumPostDetailResult>("/forum/post/update", params);
|
||||
};
|
||||
|
||||
// 删除帖子
|
||||
export interface ForumPostDeleteParams {
|
||||
forumPostId: string;
|
||||
}
|
||||
export const deleteForumPostApi = (params: ForumPostDeleteParams) => {
|
||||
return httpPostJson<void>("/forum/post/delete", params);
|
||||
};
|
||||
|
||||
export interface ForumPostPageParams extends BasePageParams {
|
||||
companyId?: string;
|
||||
postTitle?: string;
|
||||
status?: number | undefined;
|
||||
}
|
||||
|
||||
export interface ForumPostPageResult {
|
||||
forumPostId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
summary: string;
|
||||
cover: string;
|
||||
tags: string[];
|
||||
publishTime: string;
|
||||
companyName: string;
|
||||
|
||||
viewCount: number;
|
||||
likeCount: number;
|
||||
favoriteCount: number;
|
||||
commentCount: number;
|
||||
}
|
||||
|
||||
export const getCompanyPostPageApi = (params: ForumPostPageParams) => {
|
||||
return httpPostJson<BasePageResult<ForumPostPageResult>>("/forum/post/page", params);
|
||||
};
|
||||
|
||||
export interface ForumPostDetailResult {
|
||||
forumPostId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
summary: string;
|
||||
cover: string;
|
||||
tags: string[];
|
||||
publishTime: string;
|
||||
companyId: string;
|
||||
status?: number;
|
||||
companyName?: string;
|
||||
viewCount?: number;
|
||||
likeCount?: number;
|
||||
favoriteCount?: number;
|
||||
commentCount?: number;
|
||||
isLike?: boolean;
|
||||
isFavorite?: boolean;
|
||||
}
|
||||
|
||||
export interface ForumPostDetailParams {
|
||||
forumPostId: string;
|
||||
companyId?: string;
|
||||
}
|
||||
|
||||
export const getForumPostDetailApi = (params: ForumPostDetailParams) => {
|
||||
return httpPostJson<ForumPostDetailResult>(`/forum/post/detail`, params);
|
||||
};
|
||||
|
||||
export const getForumPostRecommendApi = () => {
|
||||
return httpGet<ForumPostPageResult[]>(`/forum/post/getRecommendList`);
|
||||
};
|
||||
|
||||
export const getHotList = () => {
|
||||
return httpGet<ForumPostPageResult[]>(`/forum/post/getHotList`);
|
||||
};
|
||||
|
||||
export const likePostApi = (postId: string) => {
|
||||
return httpPostJson(`/forum/post/like/${postId}`);
|
||||
};
|
||||
|
||||
export const favoritePostApi = (postId: string) => {
|
||||
return httpPostJson(`/forum/post/favorite/${postId}`);
|
||||
};
|
||||
|
||||
export interface ForumPostStatusCountResult {
|
||||
all: number;
|
||||
draft: number;
|
||||
normal: number;
|
||||
}
|
||||
|
||||
export const getPostStatusCountApi = () => {
|
||||
return httpGet<ForumPostStatusCountResult>(`/forum/post/getPostStatusCount`);
|
||||
};
|
||||
export const addForumPostViewApi = (postId: string) => {
|
||||
return httpPostJson(`/forum/post/view/${postId}`);
|
||||
};
|
||||
|
||||
export interface ForumPostDashboardResult {
|
||||
postCount: number;
|
||||
viewCount: number;
|
||||
likeCount: number;
|
||||
favoriteCount: number;
|
||||
}
|
||||
export const getFourmPostDashboardApi = () => {
|
||||
return httpGet<ForumPostDashboardResult>("/forum/post/getDashboardData");
|
||||
};
|
||||
export interface ForumPostChartViewResult {
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
export const getForumPostChartViewApi = () => {
|
||||
return httpGet<ForumPostChartViewResult[]>("/forum/post/getChartView");
|
||||
};
|
||||
export interface ForumPostChartNumberResult {
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
export const getForumPostChartNumberApi = () => {
|
||||
return httpGet<ForumPostChartNumberResult[]>("/forum/post/getChartNumber");
|
||||
};
|
||||
|
||||
export interface ForumPostChartViewResult {
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
export const getForumPostChartTypeApi = () => {
|
||||
return httpGet<ForumPostChartViewResult[]>("/forum/post/getChartType");
|
||||
};
|
||||
Reference in new issue
Block a user