This commit is contained in:
oneao committed 2025-06-18 16:30:01 +08:00
1 parent bcc4722efc
commit f48536774f
403 files changed
+34776

No files matched your search

@@ -0,0 +1,11 @@
import { httpGet } from "@/utils/http";
export interface AreaResult {
label: string;
value: number;
children?: AreaResult[];
}
export const getAreaListApi = () => {
return httpGet<AreaResult[]>(`/webArea/list`);
};
@@ -0,0 +1,36 @@
import { httpPostJson } from "@/utils/http";
interface loginApiParams {
loginCredential: string;
password: string;
}
interface loginApiResult {
id: string;
account: string;
name: string;
email: string;
token: string;
}
export const loginApi = (params: loginApiParams) => {
return httpPostJson<loginApiResult>(`/auth/login`, params);
};
interface registerApiParams {
account: string;
name: string;
email: string;
password: string;
}
export const registerApi = (params: registerApiParams) => {
return httpPostJson<null>(`/auth/register`, params);
};
export interface forgetApiParams {
forgetCredential: string;
}
export const forgetApi = (params: forgetApiParams) => {
return httpPostJson<null>(`/auth/forget`, params);
};
@@ -0,0 +1,93 @@
import { httpGet, httpPostJson } from "@/utils/http";
export interface CompanyPageResult {
companyId: string;
avatar: string;
name: string;
createTime: string;
profile: string;
address: string[];
industry: string[];
establishedDate: string;
}
interface CompanyPageParams extends BasePageParams {
loginCompanyId: string;
industry: string[];
area: string[];
name: string;
}
export const getCompanyPageApi = (params: CompanyPageParams) => {
return httpPostJson<BasePageResult<CompanyPageResult>>(`/company/getCompanyPage`, params);
};
export interface CompanyDetailType {
companyId: string;
name: string;
account: string;
password: string;
phone: string;
email: string;
address: string[];
industry: string[];
establishedDate: string;
profile: string;
avatar: string;
description: string;
shortName: string;
}
export const getCompanyPrivateDetailApi = () => {
return httpGet<CompanyDetailType>(`/company/getPrivateDetail`);
};
interface GetCompanyPublicDetailParams {
companyId: string;
}
export interface CompanyPublicDetailResult {
companyId: string;
avatar: string;
name: string;
email: string;
profile: string;
description: string;
phone: string;
establishedDate: string;
address: string[];
industry: string[];
shortName: string;
}
export const getCompanyPublicDetailApi = (params: GetCompanyPublicDetailParams) => {
return httpPostJson<CompanyPublicDetailResult>(`/company/getPublicDetail`, params);
};
export const updateCompanyApi = (params: CompanyDetailType) => {
return httpPostJson<null>(`/company/update`, params);
};
interface CompanyInfo {
id: string; // 公司ID
name: string; // 公司名称
color: string;
}
export interface CompanyRecommendResult {
shengName: string; // 省名称
shiName: string; // 市名称
companies: CompanyInfo[]; // 公司信息列表
}
export const getCompanyRecommendApi = () => {
return httpGet<CompanyRecommendResult[]>(`/company/getRecommendList`);
};
export interface CompanyRecommendRightResult {
companyId: string;
name: string;
color: string;
}
export const getCompanyRecommendRightApi = () => {
return httpGet<CompanyRecommendRightResult[]>(`/company/getRecommendRightList`);
};
@@ -0,0 +1,24 @@
import { httpPostJson } from "@/utils/http";
export interface AliyunKeyResult {
accessid: string;
policy: string;
signature: string;
dir: string;
host: string;
expire: string;
callback: string;
}
export const getAliyunKeyApi = () => {
return httpPostJson<AliyunKeyResult>(`/file/getAliyunKey`);
};
interface InsertFileParams {
fileName: string;
fileSize: string;
fileMapName: string;
}
export const insertFileApi = (params: InsertFileParams) => {
return httpPostJson<null>(`/file/insert`, params);
};
@@ -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");
};
@@ -0,0 +1,49 @@
import { httpPostJson } from "@/utils/http";
export interface GetChatsResult {
messageId?: string;
lastMessageTime?: string;
companyId: string;
companyName: string;
companyAvatar?: string;
isRollback?: number; // 0 正常,1撤回
noReadNumber?: number; // 0 未读 1已读
lastContent?: string;
lastContentType?: string;
}
export const getChatsApi = () => {
return httpPostJson<GetChatsResult[]>(`/imMessage/chats`);
};
export interface GetHistoryParams {
chatCompanyId: string;
}
export interface GetHistoryResult {
messageId: string;
sendId: string;
acceptId: string;
messageContent: string;
messageContentType: string;
isRollback: number;
quoteMessageId: string;
sendMessageTime: string;
}
export const getHistoryApi = (params: GetHistoryParams) => {
return httpPostJson<GetHistoryResult[]>(`/imMessage/history`, params);
};
export interface UpdateIsReadParams {
companyId: string;
}
export const updateIsReadApi = (params: UpdateIsReadParams) => {
return httpPostJson<null>(`/imMessage/updateIsRead`, params);
};
export interface GetAllNoReadNumberParams {}
export interface GetAllNoReadNumberResult {
noReadNumber: number;
}
export const getAllNoReadNumberApi = (params: GetAllNoReadNumberParams) => {
return httpPostJson<GetAllNoReadNumberResult>(`/imMessage/getAllNoReadNumber`, params);
};
@@ -0,0 +1,33 @@
import { httpPostJson } from "@/utils/http";
export interface NotificationResult {
notificationId: string;
content: string;
createTime: string;
type: number;
sendCompany: {
companyId: string;
name: string;
avatar: string;
};
postDetail: {
postId: string;
title: string;
};
}
export const getLikeAndFavoritePageApi = (params: BasePageParams) => {
return httpPostJson<BasePageResult<NotificationResult>>("/notification/likeAndFavorite", params);
};
export const deleteNotificationApi = (notificationId: string) => {
return httpPostJson<void>(`/notification/delete/${notificationId}`);
};
export const deleteLikeAndFavoriteAllApi = () => {
return httpPostJson<void>(`/notification/likeAndFavorite/deleteAll`);
};
export const getCommentPageApi = (params: BasePageParams) => {
return httpPostJson<BasePageResult<NotificationResult>>("/notification/comment", params);
};
export const deleteCommentAllApi = () => {
return httpPostJson<void>(`/notification/comment/deleteAll`);
};
@@ -0,0 +1,10 @@
import { httpGet } from "@/utils/http";
export interface PropertyResult {
label: string;
value: string;
}
export const getPropertyListApi = () => {
return httpGet<PropertyResult[]>(`/webProperty/list`);
};