contract-java-example/backend/yjs/main.yjs

29 lines
935 B
Plaintext
Raw Normal View History

2023-03-06 06:32:46 +00:00
oracle GDRouter {
function onCreate(arg) {
Global.owner = requester;
2023-03-06 06:32:46 +00:00
Global.resolver = org.bdware.sc.contractexample.Resolver.main(arg);
}
export function callHello(arg) {
2023-03-06 06:32:46 +00:00
return org.bdware.sc.contractexample.Hello.call() + requester;
}
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
}