Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / squareOdbc / squareOdbc.rpc.js
index b4f5e50..6f4ec67 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 _0xc65a=['rpc','../../config/environment','client','http','request','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','then','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xc65a,0x191));var _0xac65=function(_0x5d8097,_0x1f9fca){_0x5d8097=_0x5d8097-0x0;var _0x4f3d0b=_0xc65a[_0x5d8097];return _0x4f3d0b;};'use strict';var _=require('lodash');var util=require(_0xac65('0x0'));var moment=require(_0xac65('0x1'));var BPromise=require('bluebird');var rs=require(_0xac65('0x2'));var fs=require('fs');var Redis=require(_0xac65('0x3'));var db=require(_0xac65('0x4'))['db'];var utils=require(_0xac65('0x5'));var logger=require(_0xac65('0x6'))(_0xac65('0x7'));var config=require(_0xac65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xac65('0x9')][_0xac65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca524,_0x4c07bb,_0xf38fa3){return new BPromise(function(_0xe8409a,_0x9bf34c){return client[_0xac65('0xb')](_0x1ca524,_0xf38fa3)['then'](function(_0x40f407){logger[_0xac65('0xc')](_0xac65('0xd'),_0x4c07bb,'request\x20sent');logger['debug'](_0xac65('0xe'),_0x4c07bb,_0xac65('0xf'),JSON[_0xac65('0x10')](_0x40f407));if(_0x40f407[_0xac65('0x11')]){if(_0x40f407[_0xac65('0x11')][_0xac65('0x12')]===0x1f4){logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0x9bf34c(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}logger[_0xac65('0x11')](_0xac65('0xd'),_0x4c07bb,_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);return _0xe8409a(_0x40f407[_0xac65('0x11')][_0xac65('0x13')]);}else{logger['info'](_0xac65('0xd'),_0x4c07bb,_0xac65('0xf'));_0xe8409a(_0x40f407[_0xac65('0x14')][_0xac65('0x13')]);}})[_0xac65('0x15')](function(_0x8fdad9){logger[_0xac65('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4c07bb,_0x8fdad9);_0x9bf34c(_0x8fdad9);});});}exports[_0xac65('0x16')]=function(_0x4ada4c){var _0x2f8fb0=this;return new Promise(function(_0x3a05b1,_0x1659a4){return db[_0xac65('0x17')][_0xac65('0x18')]({'raw':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1b')]||null:null,'attributes':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c[_0xac65('0x19')][_0xac65('0x1c')]||null:null,'include':_0x4ada4c[_0xac65('0x19')]?_0x4ada4c['options']['include']?_[_0xac65('0x1d')](_0x4ada4c[_0xac65('0x19')][_0xac65('0x1e')],function(_0x333a6e){return{'model':db[_0x333a6e['model']],'as':_0x333a6e['as'],'attributes':_0x333a6e[_0xac65('0x1c')],'include':_0x333a6e[_0xac65('0x1e')]?_[_0xac65('0x1d')](_0x333a6e['include'],function(_0x314174){return{'model':db[_0x314174[_0xac65('0x1f')]],'as':_0x314174['as'],'attributes':_0x314174['attributes'],'include':_0x314174['include']?_[_0xac65('0x1d')](_0x314174[_0xac65('0x1e')],function(_0x50d12e){return{'model':db[_0x50d12e['model']],'as':_0x50d12e['as'],'attributes':_0x50d12e[_0xac65('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xac65('0x20')](function(_0x4b01bf){logger[_0xac65('0xc')]('ShowSquareOdbc',_0x4ada4c);logger[_0xac65('0x21')](_0xac65('0x16'),_0x4ada4c,JSON[_0xac65('0x10')](_0x4b01bf));_0x3a05b1(_0x4b01bf);})[_0xac65('0x15')](function(_0x4ce806){logger[_0xac65('0x11')](_0xac65('0x16'),_0x4ce806[_0xac65('0x13')],_0x4ada4c);_0x1659a4(_0x2f8fb0[_0xac65('0x11')](0x1f4,_0x4ce806[_0xac65('0x13')]));});});};
\ No newline at end of file