Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / squareOdbc / squareOdbc.rpc.js
index 42a07aa..4d783b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x3a5454,_0x41f2b2){var _0x593b97=function(_0x478356){while(--_0x478356){_0x3a5454['push'](_0x3a5454['shift']());}};_0x593b97(++_0x41f2b2);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});};
\ No newline at end of file
+var _0xb08c=['SquareOdbc','find','options','raw','where','attributes','include','model','map','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowSquareOdbc'];(function(_0x54eeef,_0x37b502){var _0x323505=function(_0xc61a41){while(--_0xc61a41){_0x54eeef['push'](_0x54eeef['shift']());}};_0x323505(++_0x37b502);}(_0xb08c,0x17e));var _0xcb08=function(_0x3cf9d4,_0x4605c0){_0x3cf9d4=_0x3cf9d4-0x0;var _0x2a7cdf=_0xb08c[_0x3cf9d4];return _0x2a7cdf;};'use strict';var _=require('lodash');var util=require(_0xcb08('0x0'));var moment=require(_0xcb08('0x1'));var BPromise=require(_0xcb08('0x2'));var rs=require(_0xcb08('0x3'));var fs=require('fs');var Redis=require(_0xcb08('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb08('0x5'));var logger=require('../../config/logger')(_0xcb08('0x6'));var config=require('../../config/environment');var jayson=require(_0xcb08('0x7'));var client=jayson['client'][_0xcb08('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x506b12,_0x5ae72c,_0x28b178){return new BPromise(function(_0x244d44,_0x46eab9){return client[_0xcb08('0x9')](_0x506b12,_0x28b178)[_0xcb08('0xa')](function(_0x1c7305){logger[_0xcb08('0xb')](_0xcb08('0xc'),_0x5ae72c,_0xcb08('0xd'));logger[_0xcb08('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x5ae72c,_0xcb08('0xd'),JSON[_0xcb08('0xf')](_0x1c7305));if(_0x1c7305[_0xcb08('0x10')]){if(_0x1c7305[_0xcb08('0x10')][_0xcb08('0x11')]===0x1f4){logger[_0xcb08('0x10')](_0xcb08('0xc'),_0x5ae72c,_0x1c7305[_0xcb08('0x10')][_0xcb08('0x12')]);return _0x46eab9(_0x1c7305[_0xcb08('0x10')]['message']);}logger[_0xcb08('0x10')](_0xcb08('0xc'),_0x5ae72c,_0x1c7305['error'][_0xcb08('0x12')]);return _0x244d44(_0x1c7305[_0xcb08('0x10')][_0xcb08('0x12')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x5ae72c,_0xcb08('0xd'));_0x244d44(_0x1c7305[_0xcb08('0x13')][_0xcb08('0x12')]);}})['catch'](function(_0x810dcb){logger[_0xcb08('0x10')](_0xcb08('0xc'),_0x5ae72c,_0x810dcb);_0x46eab9(_0x810dcb);});});}exports[_0xcb08('0x14')]=function(_0x30f8af){var _0x43908a=this;return new Promise(function(_0xf146a9,_0x2ab0d3){return db[_0xcb08('0x15')][_0xcb08('0x16')]({'raw':_0x30f8af['options']?_0x30f8af[_0xcb08('0x17')][_0xcb08('0x18')]===undefined?!![]:![]:!![],'where':_0x30f8af[_0xcb08('0x17')]?_0x30f8af[_0xcb08('0x17')][_0xcb08('0x19')]||null:null,'attributes':_0x30f8af[_0xcb08('0x17')]?_0x30f8af[_0xcb08('0x17')][_0xcb08('0x1a')]||null:null,'include':_0x30f8af[_0xcb08('0x17')]?_0x30f8af['options'][_0xcb08('0x1b')]?_['map'](_0x30f8af[_0xcb08('0x17')][_0xcb08('0x1b')],function(_0x2ad336){return{'model':db[_0x2ad336[_0xcb08('0x1c')]],'as':_0x2ad336['as'],'attributes':_0x2ad336[_0xcb08('0x1a')],'include':_0x2ad336[_0xcb08('0x1b')]?_['map'](_0x2ad336[_0xcb08('0x1b')],function(_0x34e7c9){return{'model':db[_0x34e7c9[_0xcb08('0x1c')]],'as':_0x34e7c9['as'],'attributes':_0x34e7c9[_0xcb08('0x1a')],'include':_0x34e7c9[_0xcb08('0x1b')]?_[_0xcb08('0x1d')](_0x34e7c9[_0xcb08('0x1b')],function(_0x340856){return{'model':db[_0x340856[_0xcb08('0x1c')]],'as':_0x340856['as'],'attributes':_0x340856[_0xcb08('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcb08('0xa')](function(_0x1f04db){logger[_0xcb08('0xb')](_0xcb08('0x14'),_0x30f8af);logger[_0xcb08('0xe')](_0xcb08('0x14'),_0x30f8af,JSON[_0xcb08('0xf')](_0x1f04db));_0xf146a9(_0x1f04db);})[_0xcb08('0x1e')](function(_0x5e6578){logger[_0xcb08('0x10')](_0xcb08('0x14'),_0x5e6578[_0xcb08('0x12')],_0x30f8af);_0x2ab0d3(_0x43908a['error'](0x1f4,_0x5e6578['message']));});});};
\ No newline at end of file