mirror of
https://gitee.com/BDWare/contract-java-example.git
synced 2025-01-10 18:04:09 +00:00
29 lines
935 B
Plaintext
29 lines
935 B
Plaintext
oracle GDRouter {
|
|
function onCreate(arg) {
|
|
Global.owner = requester;
|
|
Global.resolver = org.bdware.sc.contractexample.Resolver.main(arg);
|
|
}
|
|
export function callHello(arg) {
|
|
return org.bdware.sc.contractexample.Hello.call() + requester;
|
|
}
|
|
export function getOwner() {
|
|
return Global.owner;
|
|
}
|
|
@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);
|
|
}
|
|
} |