2023-03-06 06:32:46 +00:00
|
|
|
oracle GDRouter {
|
|
|
|
function onCreate(arg) {
|
2022-05-20 15:31:40 +00:00
|
|
|
Global.owner = requester;
|
2023-03-06 06:32:46 +00:00
|
|
|
Global.resolver = org.bdware.sc.contractexample.Resolver.main(arg);
|
2022-05-20 15:31:40 +00:00
|
|
|
}
|
|
|
|
export function callHello(arg) {
|
2023-03-06 06:32:46 +00:00
|
|
|
return org.bdware.sc.contractexample.Hello.call() + requester;
|
2022-05-20 15:31:40 +00:00
|
|
|
}
|
|
|
|
export function getOwner() {
|
|
|
|
return Global.owner;
|
2021-11-17 03:28:40 +00:00
|
|
|
}
|
2023-03-06 06:32:46 +00:00
|
|
|
@Description("{}")
|
|
|
|
@ArgSchema({
|
|
|
|
})
|
|
|
|
export function peekDB(arg) {
|
|
|
|
return org.bdware.sc.contractexample.Resolver.peekDB(arg);
|
|
|
|
}
|
|
|
|
@Description("resolve string, {\"token\":\"abc\",\"doid\":\"bdtest.gd/dddd\"}")
|
|
|
|
@ArgSchema({
|
|
|
|
"token" : "string", "doid" : "string"
|
|
|
|
})
|
|
|
|
export function resolve(arg) {
|
|
|
|
if (arg.token != Global.resolver.config.token)
|
|
|
|
YancloudUtil.exceptionReturn({
|
|
|
|
"code" : 3, "msg" : "invalid token"
|
|
|
|
});
|
|
|
|
return org.bdware.sc.contractexample.Resolver.resolve(arg.doid);
|
|
|
|
}
|
2021-11-17 03:28:40 +00:00
|
|
|
}
|