2022-06-25 03:11:03 +00:00
|
|
|
|
module unions {
|
|
|
|
|
@Descripton("无参数")
|
|
|
|
|
export function getUnionMembers(arg) {
|
|
|
|
|
if (!checkPermission(requester)) {
|
|
|
|
|
YancloudUtil.exceptionReturn({
|
|
|
|
|
"msg":"no permission", "code":1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var ret = {
|
|
|
|
|
};
|
|
|
|
|
ret.code = 0;
|
|
|
|
|
if (Global.unions==undefined){
|
|
|
|
|
ret.data = [];
|
|
|
|
|
} else {
|
|
|
|
|
ret.data = Global.unions;
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
export function resetUnionConfig() {
|
|
|
|
|
Global.unions = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Descripton("参数为,{\"date\": 1642467459759,\"name\": \"Repo1\",\"doId\": \"bdwaretest.loccall/Repo1\",\"version\": \"2.1\",\"address\": \"tcp://127.0.0.1:21042\",\"status\": \"已审核\",\"protocol\": \"DOIP\",\"pubKey\": \"04d1924329f72ced148f6f333fb985ccbaa31b1e3aacf10be5f43d4a4ff5ad88899a005e79e37fc06993e1d66ada8cf8b711cb36f59538bb7d3e39e70fa9360ddd\"}")
|
|
|
|
|
@ArgSchema({
|
|
|
|
|
"!unionName": "string", "!orgName":"string", "!email": "string", "!contact":"string"
|
|
|
|
|
})
|
|
|
|
|
export function createUnion(arg) {
|
|
|
|
|
if (!checkPermission(requester)) {
|
|
|
|
|
YancloudUtil.exceptionReturn({
|
|
|
|
|
"msg":"no permission", "code":1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
Global.unions = [];
|
|
|
|
|
Global.unions.push({
|
|
|
|
|
"name":"北大", "address":"ws://39.106.6.6:18010", "status":"在线", "contact":"网管1号", "email":"abc@pku.edu.cn"
|
|
|
|
|
});
|
|
|
|
|
Global.unions.push({
|
2023-02-15 16:17:58 +00:00
|
|
|
|
"name":"南大", "address":"ws://39.106.6.9:18010", "status":"在线", "contact":"网管1号", "email":"abc@pku.edu.cn"
|
2022-06-25 03:11:03 +00:00
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
"code":0
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
export function getUnionConfig() {
|
|
|
|
|
if (!checkPermission(requester)) {
|
|
|
|
|
YancloudUtil.exceptionReturn({
|
|
|
|
|
"msg":"no permission", "code":1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var ret = {
|
|
|
|
|
};
|
|
|
|
|
ret.controlAddress = "ws://192.168.1.1:18000";
|
|
|
|
|
ret.apiKey = "dafdsafdsa";
|
|
|
|
|
ret.unionName = "高校联盟";
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
@ArgSchema({
|
|
|
|
|
"!controlAddress": "string", "!apiKey": "string"
|
|
|
|
|
})
|
|
|
|
|
export function joinUnion(arg) {
|
|
|
|
|
if (!checkPermission(requester)) {
|
|
|
|
|
YancloudUtil.exceptionReturn({
|
|
|
|
|
"msg":"no permission", "code":1
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
var ret = {
|
|
|
|
|
};
|
|
|
|
|
ret.controlAddress = "ws://192.168.1.1:18000";
|
|
|
|
|
ret.apiKey = "dafdsafdsa";
|
|
|
|
|
ret.unionName = "高校联盟";
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
}
|