Built motion from commit 39adb707.|2.6.14
[motion2.git] / server / api / intDeskAccount / intDeskAccount.rpc.js
index e8d15a1..a72c07b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb857=['request\x20sent','debug','stringify','error','message','info','catch','GetDeskAccount','DeskAccount','findAll','options','where','attributes','include','map','model','find','raw','ShowDeskAccount','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','DeskAccount,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb857,0x6d));var _0x7b85=function(_0x4e448b,_0x37e0f7){_0x4e448b=_0x4e448b-0x0;var _0x342c6c=_0xb857[_0x4e448b];return _0x342c6c;};'use strict';var _=require('lodash');var util=require(_0x7b85('0x0'));var moment=require('moment');var BPromise=require(_0x7b85('0x1'));var rs=require(_0x7b85('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b85('0x3'))['db'];var utils=require(_0x7b85('0x4'));var logger=require(_0x7b85('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7b85('0x6'));var client=jayson['client'][_0x7b85('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19b03d,_0x36f993,_0x36e7e3){return new BPromise(function(_0x17b8da,_0x3681dd){return client[_0x7b85('0x8')](_0x19b03d,_0x36e7e3)[_0x7b85('0x9')](function(_0x242f70){logger['info'](_0x7b85('0xa'),_0x36f993,_0x7b85('0xb'));logger[_0x7b85('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x36f993,'request\x20sent',JSON[_0x7b85('0xd')](_0x242f70));if(_0x242f70['error']){if(_0x242f70['error']['code']===0x1f4){logger['error'](_0x7b85('0xa'),_0x36f993,_0x242f70[_0x7b85('0xe')][_0x7b85('0xf')]);return _0x3681dd(_0x242f70[_0x7b85('0xe')][_0x7b85('0xf')]);}logger[_0x7b85('0xe')](_0x7b85('0xa'),_0x36f993,_0x242f70[_0x7b85('0xe')][_0x7b85('0xf')]);return _0x17b8da(_0x242f70['error'][_0x7b85('0xf')]);}else{logger[_0x7b85('0x10')](_0x7b85('0xa'),_0x36f993,'request\x20sent');_0x17b8da(_0x242f70['result']['message']);}})[_0x7b85('0x11')](function(_0x7675d2){logger['error']('DeskAccount,\x20%s,\x20%s',_0x36f993,_0x7675d2);_0x3681dd(_0x7675d2);});});}exports[_0x7b85('0x12')]=function(_0x3aad49){var _0x424a25=this;return new Promise(function(_0x489321,_0xa687d7){return db[_0x7b85('0x13')][_0x7b85('0x14')]({'raw':_0x3aad49[_0x7b85('0x15')]?_0x3aad49[_0x7b85('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3aad49['options']?_0x3aad49[_0x7b85('0x15')][_0x7b85('0x16')]||null:null,'attributes':_0x3aad49['options']?_0x3aad49['options'][_0x7b85('0x17')]||null:null,'limit':_0x3aad49[_0x7b85('0x15')]?_0x3aad49[_0x7b85('0x15')]['limit']||null:null,'include':_0x3aad49[_0x7b85('0x15')]?_0x3aad49[_0x7b85('0x15')][_0x7b85('0x18')]?_[_0x7b85('0x19')](_0x3aad49['options'][_0x7b85('0x18')],function(_0x24aeb4){return{'model':db[_0x24aeb4[_0x7b85('0x1a')]],'as':_0x24aeb4['as'],'attributes':_0x24aeb4['attributes'],'include':_0x24aeb4[_0x7b85('0x18')]?_['map'](_0x24aeb4['include'],function(_0x575943){return{'model':db[_0x575943[_0x7b85('0x1a')]],'as':_0x575943['as'],'attributes':_0x575943[_0x7b85('0x17')],'include':_0x575943[_0x7b85('0x18')]?_[_0x7b85('0x19')](_0x575943[_0x7b85('0x18')],function(_0x2ff82e){return{'model':db[_0x2ff82e[_0x7b85('0x1a')]],'as':_0x2ff82e['as'],'attributes':_0x2ff82e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b85('0x9')](function(_0x3ecb43){logger[_0x7b85('0x10')](_0x7b85('0x12'),_0x3aad49);logger[_0x7b85('0xc')](_0x7b85('0x12'),_0x3aad49,JSON[_0x7b85('0xd')](_0x3ecb43));_0x489321(_0x3ecb43);})[_0x7b85('0x11')](function(_0x2b2c6a){logger[_0x7b85('0xe')](_0x7b85('0x12'),_0x2b2c6a[_0x7b85('0xf')],_0x3aad49);_0xa687d7(_0x424a25[_0x7b85('0xe')](0x1f4,_0x2b2c6a[_0x7b85('0xf')]));});});};exports['ShowDeskAccount']=function(_0x40ebb5){var _0x50b1cd=this;return new Promise(function(_0x538eac,_0x1a33f0){return db[_0x7b85('0x13')][_0x7b85('0x1b')]({'raw':_0x40ebb5[_0x7b85('0x15')]?_0x40ebb5[_0x7b85('0x15')][_0x7b85('0x1c')]===undefined?!![]:![]:!![],'where':_0x40ebb5['options']?_0x40ebb5['options']['where']||null:null,'attributes':_0x40ebb5[_0x7b85('0x15')]?_0x40ebb5[_0x7b85('0x15')][_0x7b85('0x17')]||null:null,'include':_0x40ebb5[_0x7b85('0x15')]?_0x40ebb5[_0x7b85('0x15')][_0x7b85('0x18')]?_[_0x7b85('0x19')](_0x40ebb5[_0x7b85('0x15')][_0x7b85('0x18')],function(_0x30533e){return{'model':db[_0x30533e[_0x7b85('0x1a')]],'as':_0x30533e['as'],'attributes':_0x30533e[_0x7b85('0x17')],'include':_0x30533e[_0x7b85('0x18')]?_['map'](_0x30533e['include'],function(_0x2b58e0){return{'model':db[_0x2b58e0[_0x7b85('0x1a')]],'as':_0x2b58e0['as'],'attributes':_0x2b58e0[_0x7b85('0x17')],'include':_0x2b58e0[_0x7b85('0x18')]?_['map'](_0x2b58e0['include'],function(_0x495f3c){return{'model':db[_0x495f3c[_0x7b85('0x1a')]],'as':_0x495f3c['as'],'attributes':_0x495f3c[_0x7b85('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7b85('0x9')](function(_0x2a39a4){logger[_0x7b85('0x10')](_0x7b85('0x1d'),_0x40ebb5);logger['debug']('ShowDeskAccount',_0x40ebb5,JSON[_0x7b85('0xd')](_0x2a39a4));_0x538eac(_0x2a39a4);})[_0x7b85('0x11')](function(_0x270c64){logger[_0x7b85('0xe')](_0x7b85('0x1d'),_0x270c64[_0x7b85('0xf')],_0x40ebb5);_0x1a33f0(_0x50b1cd[_0x7b85('0xe')](0x1f4,_0x270c64[_0x7b85('0xf')]));});});};
\ No newline at end of file
+var _0xa816=['model','GetDeskAccount','ShowDeskAccount','where','ioredis','../../mysqldb','../../config/environment','jayson/promise','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','DeskAccount','findAll','options','raw','attributes','limit','include','map'];(function(_0x573389,_0x5c0fa7){var _0x20df2f=function(_0x9f0945){while(--_0x9f0945){_0x573389['push'](_0x573389['shift']());}};_0x20df2f(++_0x5c0fa7);}(_0xa816,0x17d));var _0x6a81=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0xa816[_0xcfeff4];return _0xb2fadc;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a81('0x0'));var db=require(_0x6a81('0x1'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6a81('0x2'));var jayson=require(_0x6a81('0x3'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb458,_0x49d205,_0x4e9452){return new BPromise(function(_0xa4e928,_0x53c140){return client[_0x6a81('0x4')](_0x2bb458,_0x4e9452)[_0x6a81('0x5')](function(_0x251e87){logger['info'](_0x6a81('0x6'),_0x49d205,_0x6a81('0x7'));logger[_0x6a81('0x8')](_0x6a81('0x9'),_0x49d205,_0x6a81('0x7'),JSON[_0x6a81('0xa')](_0x251e87));if(_0x251e87[_0x6a81('0xb')]){if(_0x251e87[_0x6a81('0xb')][_0x6a81('0xc')]===0x1f4){logger[_0x6a81('0xb')]('DeskAccount,\x20%s,\x20%s',_0x49d205,_0x251e87['error']['message']);return _0x53c140(_0x251e87[_0x6a81('0xb')][_0x6a81('0xd')]);}logger[_0x6a81('0xb')]('DeskAccount,\x20%s,\x20%s',_0x49d205,_0x251e87[_0x6a81('0xb')][_0x6a81('0xd')]);return _0xa4e928(_0x251e87[_0x6a81('0xb')][_0x6a81('0xd')]);}else{logger[_0x6a81('0xe')](_0x6a81('0x6'),_0x49d205,_0x6a81('0x7'));_0xa4e928(_0x251e87[_0x6a81('0xf')]['message']);}})[_0x6a81('0x10')](function(_0x5e0196){logger[_0x6a81('0xb')](_0x6a81('0x6'),_0x49d205,_0x5e0196);_0x53c140(_0x5e0196);});});}exports['GetDeskAccount']=function(_0x431859){var _0x33975e=this;return new Promise(function(_0x4e46dc,_0x43e161){return db[_0x6a81('0x11')][_0x6a81('0x12')]({'raw':_0x431859[_0x6a81('0x13')]?_0x431859[_0x6a81('0x13')][_0x6a81('0x14')]===undefined?!![]:![]:!![],'where':_0x431859[_0x6a81('0x13')]?_0x431859[_0x6a81('0x13')]['where']||null:null,'attributes':_0x431859[_0x6a81('0x13')]?_0x431859[_0x6a81('0x13')][_0x6a81('0x15')]||null:null,'limit':_0x431859[_0x6a81('0x13')]?_0x431859[_0x6a81('0x13')][_0x6a81('0x16')]||null:null,'include':_0x431859[_0x6a81('0x13')]?_0x431859[_0x6a81('0x13')][_0x6a81('0x17')]?_[_0x6a81('0x18')](_0x431859['options']['include'],function(_0x51e1dd){return{'model':db[_0x51e1dd[_0x6a81('0x19')]],'as':_0x51e1dd['as'],'attributes':_0x51e1dd[_0x6a81('0x15')],'include':_0x51e1dd['include']?_[_0x6a81('0x18')](_0x51e1dd[_0x6a81('0x17')],function(_0xaca4cf){return{'model':db[_0xaca4cf[_0x6a81('0x19')]],'as':_0xaca4cf['as'],'attributes':_0xaca4cf['attributes'],'include':_0xaca4cf[_0x6a81('0x17')]?_[_0x6a81('0x18')](_0xaca4cf['include'],function(_0x252149){return{'model':db[_0x252149[_0x6a81('0x19')]],'as':_0x252149['as'],'attributes':_0x252149[_0x6a81('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6a81('0x5')](function(_0x23cb67){logger[_0x6a81('0xe')](_0x6a81('0x1a'),_0x431859);logger[_0x6a81('0x8')](_0x6a81('0x1a'),_0x431859,JSON[_0x6a81('0xa')](_0x23cb67));_0x4e46dc(_0x23cb67);})[_0x6a81('0x10')](function(_0x19fdc9){logger['error'](_0x6a81('0x1a'),_0x19fdc9[_0x6a81('0xd')],_0x431859);_0x43e161(_0x33975e['error'](0x1f4,_0x19fdc9['message']));});});};exports[_0x6a81('0x1b')]=function(_0x54e87f){var _0x131cb3=this;return new Promise(function(_0x5e1e93,_0x4477c8){return db['DeskAccount']['find']({'raw':_0x54e87f['options']?_0x54e87f[_0x6a81('0x13')][_0x6a81('0x14')]===undefined?!![]:![]:!![],'where':_0x54e87f['options']?_0x54e87f[_0x6a81('0x13')][_0x6a81('0x1c')]||null:null,'attributes':_0x54e87f[_0x6a81('0x13')]?_0x54e87f[_0x6a81('0x13')][_0x6a81('0x15')]||null:null,'include':_0x54e87f['options']?_0x54e87f[_0x6a81('0x13')][_0x6a81('0x17')]?_['map'](_0x54e87f[_0x6a81('0x13')][_0x6a81('0x17')],function(_0x1b26a5){return{'model':db[_0x1b26a5[_0x6a81('0x19')]],'as':_0x1b26a5['as'],'attributes':_0x1b26a5[_0x6a81('0x15')],'include':_0x1b26a5['include']?_[_0x6a81('0x18')](_0x1b26a5[_0x6a81('0x17')],function(_0x27f933){return{'model':db[_0x27f933[_0x6a81('0x19')]],'as':_0x27f933['as'],'attributes':_0x27f933[_0x6a81('0x15')],'include':_0x27f933[_0x6a81('0x17')]?_[_0x6a81('0x18')](_0x27f933[_0x6a81('0x17')],function(_0x33c54e){return{'model':db[_0x33c54e[_0x6a81('0x19')]],'as':_0x33c54e['as'],'attributes':_0x33c54e[_0x6a81('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19631b){logger['info']('ShowDeskAccount',_0x54e87f);logger['debug'](_0x6a81('0x1b'),_0x54e87f,JSON[_0x6a81('0xa')](_0x19631b));_0x5e1e93(_0x19631b);})[_0x6a81('0x10')](function(_0x319285){logger['error'](_0x6a81('0x1b'),_0x319285[_0x6a81('0xd')],_0x54e87f);_0x4477c8(_0x131cb3[_0x6a81('0xb')](0x1f4,_0x319285[_0x6a81('0xd')]));});});};
\ No newline at end of file