forked from Gitlink/forgeplus-react
298 lines
5.6 KiB
JavaScript
298 lines
5.6 KiB
JavaScript
|
|
import fetch from './fetch';
|
|
|
|
/**入口页接口***/
|
|
export function getMainInfos(deptId, params) {
|
|
return fetch({
|
|
url: `/zone/open/zoneKey/${deptId}`,
|
|
method: 'get',
|
|
params
|
|
});
|
|
}
|
|
|
|
export function getCheckZoneRole(id) {
|
|
return fetch({
|
|
url: `/zone/open/zone/${id}/checkZoneRole`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
export function getCurrentRole(id) {
|
|
return fetch({
|
|
url: `/zone/zoneFront/${id}/checkCurrentRole`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
/********首页接口******/
|
|
export function getHomePageList(id) {
|
|
return fetch({
|
|
url: `/zone/open/${id}/member/homePageList`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
|
|
export function gethomePageDocList(id) {
|
|
return fetch({
|
|
url: `/cms/doc/open/zone/${id}/homePageDocList`,
|
|
method: 'get',
|
|
});
|
|
}
|
|
export function getAllList(id,params){
|
|
return fetch({
|
|
url:`/zone/open/${id}/project/list`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getPartnerList(id){
|
|
return fetch({
|
|
url:`/zone/open/${id}/partners/list`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
/**领域资讯 */
|
|
export function getNewsAllList(id,params){
|
|
return fetch({
|
|
url:`/cms/doc/open/zone/${id}/docOverviewList`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
export function getNewsHotList(id,params){
|
|
return fetch({
|
|
url:`/cms/doc/open/zone/${id}/hotDocList`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
export function getNewsDetail(id){
|
|
return fetch({
|
|
url:`/cms/doc/open/${id}`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
export function getNewsMyList(id,params){
|
|
return fetch({
|
|
url:`/cms/doc/zone/${id}/myDocList`,
|
|
method:"get",
|
|
params
|
|
})
|
|
}
|
|
export function delNewsMyList(id){
|
|
return fetch({
|
|
url:`/cms/doc/${id}`,
|
|
method:"delete"
|
|
})
|
|
}
|
|
|
|
/**开源项目 */
|
|
export function getProjectsLists(id,params){
|
|
return fetch({
|
|
url:`/zone/open/${id}/project/list`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
export function getProjectsTypeLists(id){
|
|
return fetch({
|
|
url:`/zone/open/${id}/projectType/list`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
/**专区会员 */
|
|
export function getVIPLists(id, params){
|
|
return fetch({
|
|
url:`/zone/open/${id}/member/overviewList`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
|
|
/**会员申请状态 */
|
|
export function getAuditStatus(id){
|
|
return fetch({
|
|
url:`/zone/member/zone/${id}/auditStatus`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
/**会员申请状态 */
|
|
export function applyJoin(id,data) {
|
|
return fetch({
|
|
url: `/zone/member/applyToJoin/zone/${id}`,
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 资源模块
|
|
export function addResource(data) {
|
|
return fetch({
|
|
url: `/zone/zoneFront/addResource`,
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
export function getSourceTypeList(id){
|
|
return fetch({
|
|
url:`/zone/open/${id}/resourceType/list`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
export function getSourceZoneList(id){
|
|
return fetch({
|
|
url:`/zone/open/${id}/resourceDomain/list`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
export function getSourceList(params){
|
|
return fetch({
|
|
url:`/zone/open/${params.id}/resource/list`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
export function getSourceDetail(id){
|
|
return fetch({
|
|
url:`/zone/open/resource/detail/${id}`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
export function getSourceMyList(params){
|
|
return fetch({
|
|
url:`/zone/zoneFront/myResourceList`,
|
|
method:"get",
|
|
params
|
|
})
|
|
}
|
|
export function delSourceMyList(id){
|
|
return fetch({
|
|
url:`/zone/zoneFront/removeResource/${id}`,
|
|
method:"delete"
|
|
})
|
|
}
|
|
|
|
// 创建专区
|
|
export function postCreateZone(data) {
|
|
return fetch({
|
|
url: `/zone/application`,
|
|
method: 'post',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 根据文件id获取专区下资源类别
|
|
export function getTypeByFileId(zoneId, fileId){
|
|
return fetch({
|
|
url:`/zone/resourceType/zone/${zoneId}/getResourceTypeByFileId/${fileId}`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 新增领域
|
|
export function addSourceType(data) {
|
|
return fetch({
|
|
url: `/zone/resourceType`,
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 修改当前文件对应的资源类别
|
|
export function updateResourceTypeByFileId(data) {
|
|
return fetch({
|
|
url: '/zone/resourceType/updateResourceTypeByFileId',
|
|
method: 'PUT',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 获取文章领域列表
|
|
export function getDirListById(id){
|
|
return fetch({
|
|
url:`/cms/doc/open/zone/${id}/dirList`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
// 新增文章
|
|
export function addNewsByDirId(dirId, data) {
|
|
return fetch({
|
|
url: `/cms/doc/dir/${dirId}`,
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 获取文章详细信息(需要用户权限)
|
|
export function getNewsDetailByAu(id){
|
|
return fetch({
|
|
url:`/cms/doc/${id}`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
// 修改文章详细信息(需要用户权限)
|
|
export function updateDoc(id, data) {
|
|
return fetch({
|
|
url: `/cms/doc/${id}`,
|
|
method: 'PUT',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 获取资源详细信息(需要用户权限)
|
|
export function getSourceDetailByAu(id){
|
|
return fetch({
|
|
url:`/zone/zoneFront/myResource/${id}`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
// 修改资源详细信息(需要用户权限)
|
|
export function updateMyResource(data) {
|
|
return fetch({
|
|
url: `/zone/zoneFront/editResource`,
|
|
method: 'PUT',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 评论相关
|
|
// 评论列表
|
|
export function getCommentList(id, params) {
|
|
return fetch({
|
|
url: `cms/doc/open/${ id }/journalList`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
// 新增评论
|
|
export function addComment(id, data) {
|
|
return fetch({
|
|
url: `cms/docComment/${ id }`,
|
|
method: 'POST',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 编辑评论
|
|
export function editComment(id, data) {
|
|
return fetch({
|
|
url: `cms/docComment/${ id }/${ data.id }`,
|
|
method: 'PUT',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 删除评论
|
|
export function deleteComment(docId, id) {
|
|
return fetch({
|
|
url: `cms/docComment/${ docId }/${ id }`,
|
|
method: 'DELETE',
|
|
})
|
|
} |