//#import $owl_create_site_order:services/modelService.jsx
//#import $owl_orgs:services/modelService.jsx
//#import @include/checklogin.jsx
//#import $owl_website:services/modelService.jsx
//#import Util.js

function main(){
    var env = checklogin();
    if(!env){
        $.log("not login.")
        return;
    }
    var uid = env.loginId;
    var params = JSON.parse($body);
    var oid = params.oid;
    var order = owl_create_site_orderService.get(oid);
    if(!order ){
        $.log("order not found.orderId="+oid)
        return;
    }
    if(order.uid!=uid){
        $.log("order.uid!=request.uid, orderId=" + oid + ", order.uid=" + order.uid + ", request.uid="+uid);
        return;
    }
    var ret = {
        state:'ok',
        order:order
    }
    out.print(JSON.stringify(ret));
}

main();