You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
270 lines
7.3 KiB
270 lines
7.3 KiB
'use strict';
|
|
|
|
import { basicAction } from '@peace/utils'
|
|
import { ApiTable } from '$utils'
|
|
|
|
export function getResourceCatalog(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_RESOURCE_CATALOG',
|
|
url: ApiTable.getResourceCatalog,
|
|
msg: { error: '获取资源目录失败' },
|
|
reducer: { name: 'resourceCatalog' }
|
|
});
|
|
}
|
|
|
|
export function postResourceCatalog(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_RESOURCE_CATALOG',
|
|
url: ApiTable.postResourceCatalog,
|
|
msg: { option: '新建资源目录' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
|
|
export function putResourceCatalog(id, data) {
|
|
return dispatch => basicAction({
|
|
type: 'put',
|
|
data: data,
|
|
dispatch,
|
|
actionType: 'PUT_RESOURCE_CATALOG',
|
|
url: ApiTable.putResourceCatalog.replace('{id}', id),
|
|
msg: {
|
|
option: '修改资源目录',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function delResourceCatalog(id) {
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DELETE_RESOURCE_CATALOG',
|
|
url: ApiTable.delResourceCatalog.replace('{id}', id),
|
|
msg: {
|
|
option: '删除资源目录',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function getMetadataDatabases(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_METADATA_DATABASES_LIST',
|
|
url: ApiTable.getMetadataDatabases,
|
|
msg: { error: '获取库表元数据列表失败' },
|
|
reducer: { name: 'metadataDatabases' }
|
|
});
|
|
}
|
|
|
|
export function getMetadataFiles(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_METADATA_FILES_LIST',
|
|
url: ApiTable.getMetadataFiles,
|
|
msg: { error: '获取文件元数据列表失败' },
|
|
reducer: { name: 'metadataFiles' }
|
|
});
|
|
}
|
|
|
|
export function getMetadataRestapis(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_METADATA_RESTAPIS_LIST',
|
|
url: ApiTable.getMetadataRestapis,
|
|
msg: { error: '获取接口元数据列表失败' },
|
|
reducer: { name: 'metadataRestapis' }
|
|
});
|
|
}
|
|
|
|
export function getMetadataModels(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_METADATA_MODELS_LIST',
|
|
url: ApiTable.getMetadataModels,
|
|
msg: { error: '获取元数据模型失败' },
|
|
reducer: { name: 'metadataModels' }
|
|
});
|
|
}
|
|
|
|
export function postMetadataDatabases(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_METADATA_DATABASES',
|
|
url: ApiTable.postMetadataDatabases,
|
|
msg: { option: '新建元数据' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
|
|
export function putMetadataDatabases(id, data) {
|
|
return dispatch => basicAction({
|
|
type: 'put',
|
|
data: data,
|
|
dispatch,
|
|
actionType: 'PUT_METADATA_DATABASES',
|
|
url: ApiTable.putMetadataDatabases.replace('{id}', id),
|
|
msg: {
|
|
option: '修改元数据',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function delMetadataDatabases(id) {
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DELETE_METADATA_DATABASES',
|
|
url: ApiTable.delMetadataDatabases.replace('{id}', id),
|
|
msg: {
|
|
option: '删除元数据',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function getMetadataDatabasesById(id) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'GET_METADATA_DATABASES_Info',
|
|
url: ApiTable.getMetadataDatabasesById.replace('{id}', id),
|
|
msg: { error: '获取元数据基本信息失败' },
|
|
reducer: { name: 'metadataDatabasesInfo' }
|
|
});
|
|
}
|
|
|
|
|
|
export function postTagMetadata(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_TAG_METADATA',
|
|
url: ApiTable.postTagMetadata,
|
|
msg: { option: '打标元数据' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
export function getTagMetadata(id, type) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'GET_TAG_METADATA',
|
|
url: ApiTable.getTagMetadata.replace('{id}', id) + `?type=${type}`,
|
|
msg: { error: '获取元数据已打标数据失败' },
|
|
reducer: { name: 'tagMetadata' }
|
|
});
|
|
}
|
|
|
|
export function postMetadataResourceApplications(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_METADATA_RESOURCE_APPLICATIONS',
|
|
url: ApiTable.postMetadataResourceApplications,
|
|
msg: { option: '申请资源' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
|
|
export function getMetadataResourceApplications(params) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
query: params,
|
|
actionType: 'GET_TAG_METADATA',
|
|
url: ApiTable.getMetadataResourceApplications,
|
|
msg: { error: '获取元数据资源申请记录失败' },
|
|
reducer: { name: 'metadataResourceApplications' }
|
|
});
|
|
}
|
|
|
|
export function postMetadataFiles(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_METADATA_FILES',
|
|
url: ApiTable.postMetadataFiles,
|
|
msg: { option: '新建元数据' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
|
|
export function putMetadataFiles(id, data, updateFileName) {
|
|
return dispatch => basicAction({
|
|
type: 'put',
|
|
data: data,
|
|
dispatch,
|
|
actionType: 'PUT_METADATA_FILES',
|
|
url: ApiTable.putMetadataFiles.replace('{id}', id) + `?updateFileName=${updateFileName || ''}`,
|
|
msg: {
|
|
option: updateFileName ? '' : '修改元数据',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function delMetadataFiles(id) {
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DELETE_METADATA_FILES',
|
|
url: ApiTable.delMetadataFiles.replace('{id}', id),
|
|
msg: {
|
|
option: '删除元数据',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function postMetadataRestapis(data) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data: data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_METADATA_RESTAPIS',
|
|
url: ApiTable.postMetadataRestapis,
|
|
msg: { option: '新建元数据' },
|
|
reducer: {}
|
|
});
|
|
}
|
|
|
|
export function putMetadataRestapis(id, data) {
|
|
return dispatch => basicAction({
|
|
type: 'put',
|
|
data: data,
|
|
dispatch,
|
|
actionType: 'PUT_METADATA_RESTAPIS',
|
|
url: ApiTable.putMetadataRestapis.replace('{id}', id),
|
|
msg: {
|
|
option: '修改元数据',
|
|
}
|
|
});
|
|
}
|
|
|
|
export function delMetadataRestapis(id) {
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DELETE_METADATA_RESTAPIS',
|
|
url: ApiTable.delMetadataRestapis.replace('{id}', id),
|
|
msg: {
|
|
option: '删除元数据',
|
|
}
|
|
});
|
|
}
|
|
|