@lcap/asl
Version:
NetEase Application Specific Language
102 lines (100 loc) • 2.58 kB
JavaScript
import { createPreServiceType, postServiceType } from '../common/preprocess';
export default {
loadList: {
url: {
path: '/proxy/graph/api/v1/graph/entities/list',
method: 'get',
},
config: {
postprocess: (result) => {
result.forEach((item) => {
Object.assign(item, item.definition);
delete item.definition;
postServiceType(item);
});
return result;
},
},
},
loadDetail: {
url: {
path: '/proxy/graph/api/v1/graph/entities/get',
method: 'get',
},
config: {
preprocess: createPreServiceType('body'),
},
},
create: {
url: {
path: '/proxy/graph/api/v1/graph/entities/add',
method: 'post',
},
config: {
preprocess: (info) => createPreServiceType('body')(info),
},
},
update: {
url: {
path: '/proxy/graph/api/v1/graph/entities/update',
method: 'post',
},
config: {
preprocess: (info) => createPreServiceType('body')(info),
},
},
delete: {
url: {
path: '/proxy/graph/api/v1/graph/entities/delete',
method: 'delete',
},
},
addProperty: {
url: {
path: '/proxy/graph/api/v1/graph/entities/field/add',
method: 'post',
},
},
updateProperty: {
url: {
path: '/proxy/graph/api/v1/graph/entities/field/update',
method: 'post',
},
},
deleteProperty: {
url: {
path: '/proxy/graph/api/v1/graph/entities/field/delete',
method: 'delete',
},
},
moveProperty: {
url: {
path: '/proxy/graph/api/v1/graph/entities/field/move',
method: 'post',
},
},
addIndex: {
url: {
path: '/proxy/graph/api/v1/graph/entities/index/add',
method: 'post',
},
},
updateIndex: {
url: {
path: '/proxy/graph/api/v1/graph/entities/index/update',
method: 'post',
},
},
deleteIndex: {
url: {
path: '/proxy/graph/api/v1/graph/entities/index/delete',
method: 'delete',
},
},
moveIndex: {
url: {
path: '/proxy/graph/api/v1/graph/entities/index/move',
method: 'post',
},
},
};