430 lines
8.4 KiB
JavaScript
430 lines
8.4 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 getDocList(id){
|
|
return fetch({
|
|
url:`/cms/doc/open/zone/${id}/dirList`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
// 获取文章列表
|
|
export function getSubDocList(id,params){
|
|
return fetch({
|
|
url:`/cms/doc/open/dir/${id}/docList`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
// 获取文章列表(带内容)
|
|
export function getDocAndContentList(id,params){
|
|
return fetch({
|
|
url:`/cms/doc/open/dir/${id}/docContentList`,
|
|
method: 'get',
|
|
params
|
|
})
|
|
}
|
|
// 专区会员
|
|
export function getVIPAllList(id){
|
|
return fetch({
|
|
url:`/zone/open/${id}/member/overviewList`,
|
|
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',
|
|
})
|
|
}
|
|
|
|
// 数据集
|
|
export function getDataSet(params) {
|
|
return fetch({
|
|
url: `/zone/open/${params.id}/dataSet/projectList`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
// /open/dataSet/{projectId}
|
|
export function getDataSetdetail(datasetId,params) {
|
|
return fetch({
|
|
url: `/zone/open/dataSet/${datasetId}`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getSpecialProjectTypeList(id,params) {
|
|
return fetch({
|
|
url: `/zone/open/${id}/specialProjectType/list`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getSpecialProjectList(id, specialProjectTypeId,params) {
|
|
return fetch({
|
|
url: `/zone/open/${id}/specialProjectType/${specialProjectTypeId}/specialProjectList`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
export function getSpecialProjectDetail(specialProjectId,params) {
|
|
return fetch({
|
|
url: `/zone/open/specialProject/${specialProjectId}/specialProjectRelevancyList`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
// 专区统计数据
|
|
export function getZoneStatistics(id) {
|
|
return fetch({
|
|
url: `/zone/open/${id}/statistics`,
|
|
method: 'GET',
|
|
})
|
|
}
|
|
|
|
// 专区项目列表(带活跃度)
|
|
export function getProjectListByScore(id,params) {
|
|
return fetch({
|
|
url: `/zone/open/${id}/projectByScore/list`,
|
|
method: 'GET',
|
|
params
|
|
})
|
|
}
|
|
|
|
// 获取已开通企业的组织列表
|
|
export function getOrzCompanyList(){
|
|
return fetch({
|
|
url:`/pms/pmsEnterprise/myList`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
// 查询组织是否开通企业
|
|
export function checkOpenedEnterprise(orgId){
|
|
return fetch({
|
|
url:`/pms/pmsEnterprise/${orgId}/workbenchUrl`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
// 组织升级为企业
|
|
export function createEnterpriseByGitlinkOrgId(orgId, data) {
|
|
return fetch({
|
|
url: `/pms/pmsEnterprise/createByGitlinkOrgId/${orgId}`,
|
|
method: 'POST',
|
|
data: data
|
|
})
|
|
}
|
|
|
|
// 可选角色列表
|
|
export function getRoleList(){
|
|
return fetch({
|
|
url:`/pms/pmsEnterprise/roleList`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
// 获取工作台初始用户列表
|
|
export function getUserList(orgId){
|
|
return fetch({
|
|
url:`/pms/pmsEnterprise/gitlinkUserList/${orgId}`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|