项目功能开发
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
54
src/services/cms/project.ts
Normal file
54
src/services/cms/project.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
// 查询项目列表
|
||||
export async function getProjectList(params?: API.Project.ListParams) {
|
||||
return request<API.Project.ProjectResult>('/api/cms/project/list', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取项目详情
|
||||
export async function getProjectDetail(id: number | string) {
|
||||
return request<API.Project.ProjectDetailResult>(`/api/cms/project/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 新增项目
|
||||
export async function addProject(data: Partial<API.Project.ProjectItem>) {
|
||||
return request<API.Result>('/api/cms/project', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改项目
|
||||
export async function updateProject(data: Partial<API.Project.ProjectItem>) {
|
||||
return request<API.Result>('/api/cms/project', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除项目
|
||||
export async function deleteProject(ids: string) {
|
||||
return request<API.Result>(`/api/cms/project/${ids}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取项目评论列表
|
||||
export async function getProjectComments(projectId: number | string) {
|
||||
return request<API.Result>(`/api/cms/project/comments/${projectId}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 回复评论
|
||||
export async function replyComment(data: { commentId: number; reply: string }) {
|
||||
return request<API.Result>('/api/cms/project/comment/reply', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user