Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / squareOdbc / squareOdbc.rpc.js
index b4f5e50..b5c0b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb557=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSquareOdbc','SquareOdbc','options','where','attributes','include','map','model','lodash','util'];(function(_0x50e323,_0x153666){var _0x22168f=function(_0x2d81df){while(--_0x2d81df){_0x50e323['push'](_0x50e323['shift']());}};_0x22168f(++_0x153666);}(_0xb557,0x11e));var _0x7b55=function(_0x18a12e,_0x55bfa7){_0x18a12e=_0x18a12e-0x0;var _0x58fe93=_0xb557[_0x18a12e];return _0x58fe93;};'use strict';var _=require(_0x7b55('0x0'));var util=require(_0x7b55('0x1'));var moment=require(_0x7b55('0x2'));var BPromise=require(_0x7b55('0x3'));var rs=require(_0x7b55('0x4'));var fs=require('fs');var Redis=require(_0x7b55('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b55('0x6'));var logger=require(_0x7b55('0x7'))(_0x7b55('0x8'));var config=require(_0x7b55('0x9'));var jayson=require(_0x7b55('0xa'));var client=jayson[_0x7b55('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7d91,_0x5099fe,_0x2540c7){return new BPromise(function(_0x5317a0,_0x5696be){return client[_0x7b55('0xc')](_0x4a7d91,_0x2540c7)[_0x7b55('0xd')](function(_0x235421){logger[_0x7b55('0xe')](_0x7b55('0xf'),_0x5099fe,_0x7b55('0x10'));logger[_0x7b55('0x11')](_0x7b55('0x12'),_0x5099fe,_0x7b55('0x10'),JSON[_0x7b55('0x13')](_0x235421));if(_0x235421[_0x7b55('0x14')]){if(_0x235421[_0x7b55('0x14')]['code']===0x1f4){logger[_0x7b55('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5099fe,_0x235421[_0x7b55('0x14')]['message']);return _0x5696be(_0x235421[_0x7b55('0x14')]['message']);}logger[_0x7b55('0x14')](_0x7b55('0xf'),_0x5099fe,_0x235421[_0x7b55('0x14')]['message']);return _0x5317a0(_0x235421['error'][_0x7b55('0x15')]);}else{logger[_0x7b55('0xe')](_0x7b55('0xf'),_0x5099fe,_0x7b55('0x10'));_0x5317a0(_0x235421[_0x7b55('0x16')]['message']);}})[_0x7b55('0x17')](function(_0xb55972){logger[_0x7b55('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x5099fe,_0xb55972);_0x5696be(_0xb55972);});});}exports[_0x7b55('0x18')]=function(_0x2c32f7){var _0x53177f=this;return new Promise(function(_0x4b2988,_0x598481){return db[_0x7b55('0x19')]['find']({'raw':_0x2c32f7[_0x7b55('0x1a')]?_0x2c32f7[_0x7b55('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2c32f7[_0x7b55('0x1a')]?_0x2c32f7[_0x7b55('0x1a')][_0x7b55('0x1b')]||null:null,'attributes':_0x2c32f7[_0x7b55('0x1a')]?_0x2c32f7['options'][_0x7b55('0x1c')]||null:null,'include':_0x2c32f7['options']?_0x2c32f7['options'][_0x7b55('0x1d')]?_[_0x7b55('0x1e')](_0x2c32f7['options']['include'],function(_0x597c70){return{'model':db[_0x597c70['model']],'as':_0x597c70['as'],'attributes':_0x597c70[_0x7b55('0x1c')],'include':_0x597c70[_0x7b55('0x1d')]?_['map'](_0x597c70['include'],function(_0x2c61b7){return{'model':db[_0x2c61b7['model']],'as':_0x2c61b7['as'],'attributes':_0x2c61b7[_0x7b55('0x1c')],'include':_0x2c61b7[_0x7b55('0x1d')]?_[_0x7b55('0x1e')](_0x2c61b7[_0x7b55('0x1d')],function(_0x182e24){return{'model':db[_0x182e24[_0x7b55('0x1f')]],'as':_0x182e24['as'],'attributes':_0x182e24[_0x7b55('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7b55('0xd')](function(_0xe501c4){logger[_0x7b55('0xe')](_0x7b55('0x18'),_0x2c32f7);logger[_0x7b55('0x11')](_0x7b55('0x18'),_0x2c32f7,JSON[_0x7b55('0x13')](_0xe501c4));_0x4b2988(_0xe501c4);})[_0x7b55('0x17')](function(_0x3829ad){logger['error']('ShowSquareOdbc',_0x3829ad[_0x7b55('0x15')],_0x2c32f7);_0x598481(_0x53177f[_0x7b55('0x14')](0x1f4,_0x3829ad[_0x7b55('0x15')]));});});};
\ No newline at end of file
+var _0xc9d2=['code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','raw','where','include','map','attributes','model','info','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x406cdb,_0xbb5ecb){var _0x3965a0=function(_0x503797){while(--_0x503797){_0x406cdb['push'](_0x406cdb['shift']());}};_0x3965a0(++_0xbb5ecb);}(_0xc9d2,0x1af));var _0x2c9d=function(_0xf77944,_0x3c31d2){_0xf77944=_0xf77944-0x0;var _0x386d6c=_0xc9d2[_0xf77944];return _0x386d6c;};'use strict';var _=require(_0x2c9d('0x0'));var util=require(_0x2c9d('0x1'));var moment=require(_0x2c9d('0x2'));var BPromise=require(_0x2c9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c9d('0x4'));var db=require(_0x2c9d('0x5'))['db'];var utils=require(_0x2c9d('0x6'));var logger=require(_0x2c9d('0x7'))(_0x2c9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x2c9d('0x9'));var client=jayson[_0x2c9d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1864,_0x6f8fe1,_0x56be60){return new BPromise(function(_0x4fb204,_0x140bad){return client[_0x2c9d('0xb')](_0x5f1864,_0x56be60)['then'](function(_0x5befd0){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x2c9d('0xc'));logger[_0x2c9d('0xd')](_0x2c9d('0xe'),_0x6f8fe1,_0x2c9d('0xc'),JSON[_0x2c9d('0xf')](_0x5befd0));if(_0x5befd0[_0x2c9d('0x10')]){if(_0x5befd0[_0x2c9d('0x10')][_0x2c9d('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0['error'][_0x2c9d('0x12')]);return _0x140bad(_0x5befd0[_0x2c9d('0x10')]['message']);}logger[_0x2c9d('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x6f8fe1,_0x5befd0[_0x2c9d('0x10')]['message']);return _0x4fb204(_0x5befd0[_0x2c9d('0x10')]['message']);}else{logger['info'](_0x2c9d('0x13'),_0x6f8fe1,'request\x20sent');_0x4fb204(_0x5befd0[_0x2c9d('0x14')][_0x2c9d('0x12')]);}})[_0x2c9d('0x15')](function(_0x150e4e){logger[_0x2c9d('0x10')](_0x2c9d('0x13'),_0x6f8fe1,_0x150e4e);_0x140bad(_0x150e4e);});});}exports[_0x2c9d('0x16')]=function(_0x4d25dc){var _0x486cbb=this;return new Promise(function(_0x1c78b0,_0x3f5627){return db['SquareOdbc'][_0x2c9d('0x17')]({'raw':_0x4d25dc['options']?_0x4d25dc[_0x2c9d('0x18')][_0x2c9d('0x19')]===undefined?!![]:![]:!![],'where':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1a')]||null:null,'attributes':_0x4d25dc[_0x2c9d('0x18')]?_0x4d25dc['options']['attributes']||null:null,'include':_0x4d25dc['options']?_0x4d25dc['options'][_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4d25dc['options'][_0x2c9d('0x1b')],function(_0x25c0e4){return{'model':db[_0x25c0e4['model']],'as':_0x25c0e4['as'],'attributes':_0x25c0e4[_0x2c9d('0x1d')],'include':_0x25c0e4['include']?_[_0x2c9d('0x1c')](_0x25c0e4[_0x2c9d('0x1b')],function(_0x4df7dc){return{'model':db[_0x4df7dc[_0x2c9d('0x1e')]],'as':_0x4df7dc['as'],'attributes':_0x4df7dc['attributes'],'include':_0x4df7dc[_0x2c9d('0x1b')]?_[_0x2c9d('0x1c')](_0x4df7dc['include'],function(_0x28a781){return{'model':db[_0x28a781[_0x2c9d('0x1e')]],'as':_0x28a781['as'],'attributes':_0x28a781[_0x2c9d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd801df){logger[_0x2c9d('0x1f')](_0x2c9d('0x16'),_0x4d25dc);logger['debug'](_0x2c9d('0x16'),_0x4d25dc,JSON[_0x2c9d('0xf')](_0xd801df));_0x1c78b0(_0xd801df);})[_0x2c9d('0x15')](function(_0x71bae6){logger['error'](_0x2c9d('0x16'),_0x71bae6[_0x2c9d('0x12')],_0x4d25dc);_0x3f5627(_0x486cbb[_0x2c9d('0x10')](0x1f4,_0x71bae6['message']));});});};
\ No newline at end of file