ControlProxy/control-proxy-backend/yjs/ShanxiRegistry.yjs
2023-11-20 11:58:54 +08:00

86 lines
3.5 KiB
Plaintext

module ShanxiRegistry{
export function getAllRepoCount() {
return executeContract("ShanxiRegistry","getAllRepoCount","").result;
}
export function getAllDoCount() {
return executeContract("ShanxiRegistry","getAllDoCount","").result;
}
export function getAllSearchCount() {
return executeContract("ShanxiRegistry","getAllSearchCount","").result;
}
export function getIndexStatistics() {
return executeContract("ShanxiRegistry","getIndexStatistics","").result;
}
export function getRepoList() {
return executeContract("ShanxiRegistry","getRepoList","").result;
}
export function pingRepo(arg) {
return executeContract("ShanxiRegistry","pingRepo",arg).result;
}
export function addRepoToRegistry(arg) {
return executeContract("ShanxiRegistry","addRepoToRegistry",arg).result;
}
export function updateRepoInRegistry(arg) {
return executeContract("ShanxiRegistry","updateRepoInRegistry",arg).result;
}
export function deleteRepoList(arg) {
return executeContract("ShanxiRegistry","deleteRepoList",arg).result;
}
export function listDataRequirement() {
return executeContract("ShanxiRegistry","listDataRequirement",arg).result;
}
export function getDataRequirementIssueList() {
return executeContract("ShanxiRegistry","getDataRequirementIssueList",arg).result;
}
export function createDataRequirement() {
return executeContract("ShanxiRegistry","createDataRequirement",arg).result;
}
export function issueDataRequirement() {
return executeContract("ShanxiRegistry","issueDataRequirement",arg).result;
}
export function updateDataRequirement() {
return executeContract("ShanxiRegistry","updateDataRequirement",arg).result;
}
export function getDataRequirement(arg) {
return executeContract("ShanxiRegistry","getDataRequirement",arg).result;
}
export function deleteDataRequirement() {
return executeContract("ShanxiRegistry","deleteDataRequirement",arg).result;
}
export function getDoCount(arg) {
var ret = executeContract("ShanxiRegistry", "getDoCount", arg);
if (arg.indexOf("shanxi/Repository") != - 1)
ret.result.data.push({
"doId" : "shanxi/Repository", "count" : 3
});
return ret.result;
}
export function addSubRegistry() {
return executeContract("ShanxiRegistry","addSubRegistry",arg).result;
}
export function deleteSubRegistry() {
return executeContract("ShanxiRegistry","deleteSubRegistry",arg).result;
}
export function listSubRegistry() {
return executeContract("ShanxiRegistry","listSubRegistry",arg).result;
}
export function getRelationInfo() {
return executeContract("ShanxiRegistry","getRelationInfo",arg).result;
}
@ArgSchema({
"!searchCondition" : [{
"!type" : "string", "!value" : "integer"
}], "count" : "integer", "offset" : "integer"
})
export function search(arg) {
arg = convertArgToJson(arg);
var req = {"id":"","attributes":{},"body":""};
for (var i=0;i<arg.searchCondition.length;i++){
req.attributes[arg.searchCondition[i].type] = arg.searchCondition[i].value;
}
req.attributes["offset"] = arg.offset;
req.attributes["count"] = arg.count;
var res = executeContract("ShanxiRegistry", "search", arg);
return res.result;
}
}