Refactor code structure and remove redundant changes
This commit is contained in:
118
api/drawe-detail/index.ts
Normal file
118
api/drawe-detail/index.ts
Normal file
@ -0,0 +1,118 @@
|
||||
import { get, post, Delete } from '@/utils/axios'
|
||||
import { ProjectRespVO, PageResultProjectCommentResVO, ProjectDrawPageRespVO, UserExtendSimpleRespDTO, ProjectDrawMemberRespVO } from './types'
|
||||
|
||||
/**
|
||||
* 获取图纸详情
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const getDetail = (params: { id?: number | string }) => {
|
||||
return get<IResponse<ProjectRespVO>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/preview',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评论列表
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const getCommentList = (params: { relationId?: number | string; pageNum?: number; pageSize?: number }) => {
|
||||
return get<IResponse<PageResultProjectCommentResVO>>({
|
||||
url: '/prod-api/app-api/business/app/project-comment/page',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 发表评论
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const createComment = (params: { relationId?: number | string; content?: string; projectId?: number | string }) => {
|
||||
return post<IResponse<boolean>>({
|
||||
url: '/prod-api/app-api/business/app/project-comment/create',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前类型top数据
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const getRelationRecommend = (params: { type?: number | string; projectType?: number | string }) => {
|
||||
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/top-list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 举报
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const report = (params: { id?: number | string; title?: string; comments?: string; files?: any; projectId: any; drawId: any }) => {
|
||||
return post<IResponse<boolean>>({
|
||||
url: '/prod-api/app-api/business/project-report/create',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图纸发布人信息
|
||||
* @return {Promise}
|
||||
*/
|
||||
export const getUserInfo = (params: { id?: number | string }) => {
|
||||
return get<IResponse<UserExtendSimpleRespDTO>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/preview-user-info',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户的主要作品内容
|
||||
*/
|
||||
export const getMainWork = (params: { id?: number | string; limit: number; memberId?: number | string }) => {
|
||||
return get<IResponse<ProjectDrawMemberRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/preview-user-projects',
|
||||
params,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 创建内容信息
|
||||
*/
|
||||
export const createContent = (params: { projectId: any; drawId: any }) => {
|
||||
return post<IResponse<boolean>>({
|
||||
url: '/prod-api/app-api/business/project-member-favorites/create',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建用户项目、工具箱下载
|
||||
*/
|
||||
export const createUserProject = (params: { relationId: any; type: any }) => {
|
||||
return post<IResponse<string>>({
|
||||
url: '/prod-api/app-api/business/project-member-file/create',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 删除项目订单用户收藏信息
|
||||
*/
|
||||
export const deleteProject = (params: { id: any }) => {
|
||||
return Delete<IResponse<boolean>>({
|
||||
url: '/prod-api/app-api/business/project-member-favorites/delete',
|
||||
data: params,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工具箱信息
|
||||
*/
|
||||
export const deleteTool = (params: { id: any }) => {
|
||||
return Delete<IResponse<boolean>>({
|
||||
url: '/prod-api/app-api/business/project-resource/delete',
|
||||
data: params,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user