Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / squareOdbc / squareOdbc.rpc.js
index 612e536..6f4ec67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07fe=['jayson/promise','client','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','include','model','attributes','map','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x508c67,_0x3884b0){var _0x5be42c=function(_0x5047b7){while(--_0x5047b7){_0x508c67['push'](_0x508c67['shift']());}};_0x5be42c(++_0x3884b0);}(_0x07fe,0xb8));var _0xe07f=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x07fe[_0xda464c];return _0x19e222;};'use strict';var _=require(_0xe07f('0x0'));var util=require(_0xe07f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe07f('0x2'));var fs=require('fs');var Redis=require(_0xe07f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe07f('0x4'));var logger=require(_0xe07f('0x5'))(_0xe07f('0x6'));var config=require(_0xe07f('0x7'));var jayson=require(_0xe07f('0x8'));var client=jayson[_0xe07f('0x9')][_0xe07f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x416a51,_0x28f73a,_0x57c973){return new BPromise(function(_0x31c171,_0x2965c9){return client[_0xe07f('0xb')](_0x416a51,_0x57c973)[_0xe07f('0xc')](function(_0x2391df){logger[_0xe07f('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x28f73a,'request\x20sent');logger[_0xe07f('0xe')](_0xe07f('0xf'),_0x28f73a,_0xe07f('0x10'),JSON[_0xe07f('0x11')](_0x2391df));if(_0x2391df[_0xe07f('0x12')]){if(_0x2391df[_0xe07f('0x12')]['code']===0x1f4){logger[_0xe07f('0x12')](_0xe07f('0x13'),_0x28f73a,_0x2391df[_0xe07f('0x12')][_0xe07f('0x14')]);return _0x2965c9(_0x2391df[_0xe07f('0x12')][_0xe07f('0x14')]);}logger[_0xe07f('0x12')](_0xe07f('0x13'),_0x28f73a,_0x2391df[_0xe07f('0x12')]['message']);return _0x31c171(_0x2391df[_0xe07f('0x12')][_0xe07f('0x14')]);}else{logger[_0xe07f('0xd')](_0xe07f('0x13'),_0x28f73a,_0xe07f('0x10'));_0x31c171(_0x2391df[_0xe07f('0x15')][_0xe07f('0x14')]);}})[_0xe07f('0x16')](function(_0x5e5a70){logger[_0xe07f('0x12')](_0xe07f('0x13'),_0x28f73a,_0x5e5a70);_0x2965c9(_0x5e5a70);});});}exports[_0xe07f('0x17')]=function(_0x56c65d){var _0x556826=this;return new Promise(function(_0x4c89e1,_0x227afc){return db['SquareOdbc'][_0xe07f('0x18')]({'raw':_0x56c65d[_0xe07f('0x19')]?_0x56c65d[_0xe07f('0x19')][_0xe07f('0x1a')]===undefined?!![]:![]:!![],'where':_0x56c65d[_0xe07f('0x19')]?_0x56c65d[_0xe07f('0x19')][_0xe07f('0x1b')]||null:null,'attributes':_0x56c65d[_0xe07f('0x19')]?_0x56c65d[_0xe07f('0x19')]['attributes']||null:null,'include':_0x56c65d[_0xe07f('0x19')]?_0x56c65d['options'][_0xe07f('0x1c')]?_['map'](_0x56c65d['options'][_0xe07f('0x1c')],function(_0x180a4e){return{'model':db[_0x180a4e[_0xe07f('0x1d')]],'as':_0x180a4e['as'],'attributes':_0x180a4e[_0xe07f('0x1e')],'include':_0x180a4e[_0xe07f('0x1c')]?_['map'](_0x180a4e[_0xe07f('0x1c')],function(_0x39ed8a){return{'model':db[_0x39ed8a[_0xe07f('0x1d')]],'as':_0x39ed8a['as'],'attributes':_0x39ed8a[_0xe07f('0x1e')],'include':_0x39ed8a[_0xe07f('0x1c')]?_[_0xe07f('0x1f')](_0x39ed8a[_0xe07f('0x1c')],function(_0x23d5f5){return{'model':db[_0x23d5f5[_0xe07f('0x1d')]],'as':_0x23d5f5['as'],'attributes':_0x23d5f5[_0xe07f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe07f('0xc')](function(_0x3b5e66){logger[_0xe07f('0xd')](_0xe07f('0x17'),_0x56c65d);logger[_0xe07f('0xe')](_0xe07f('0x17'),_0x56c65d,JSON[_0xe07f('0x11')](_0x3b5e66));_0x4c89e1(_0x3b5e66);})[_0xe07f('0x16')](function(_0x398f58){logger[_0xe07f('0x12')]('ShowSquareOdbc',_0x398f58[_0xe07f('0x14')],_0x56c65d);_0x227afc(_0x556826['error'](0x1f4,_0x398f58[_0xe07f('0x14')]));});});};
\ 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