Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / intDeskAccount / intDeskAccount.rpc.js
index c667ab6..4a55e3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7267=['ShowDeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','DeskAccount,\x20%s,\x20%s','message','catch','DeskAccount','options','raw','limit','include','model','attributes','map','GetDeskAccount','stringify','find','where'];(function(_0x2533d4,_0x2afa20){var _0x113f30=function(_0x228e6b){while(--_0x228e6b){_0x2533d4['push'](_0x2533d4['shift']());}};_0x113f30(++_0x2afa20);}(_0x7267,0x16c));var _0x7726=function(_0x2f3030,_0x4ba9e1){_0x2f3030=_0x2f3030-0x0;var _0x31f77b=_0x7267[_0x2f3030];return _0x31f77b;};'use strict';var _=require(_0x7726('0x0'));var util=require(_0x7726('0x1'));var moment=require('moment');var BPromise=require(_0x7726('0x2'));var rs=require(_0x7726('0x3'));var fs=require('fs');var Redis=require(_0x7726('0x4'));var db=require(_0x7726('0x5'))['db'];var utils=require(_0x7726('0x6'));var logger=require(_0x7726('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7726('0x8'));var client=jayson[_0x7726('0x9')][_0x7726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a5ae0,_0x8cfddf,_0x170571){return new BPromise(function(_0x74cbf7,_0x22eff8){return client['request'](_0x1a5ae0,_0x170571)[_0x7726('0xb')](function(_0xebce49){logger[_0x7726('0xc')]('DeskAccount,\x20%s,\x20%s',_0x8cfddf,_0x7726('0xd'));logger[_0x7726('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x8cfddf,'request\x20sent',JSON['stringify'](_0xebce49));if(_0xebce49[_0x7726('0xf')]){if(_0xebce49[_0x7726('0xf')][_0x7726('0x10')]===0x1f4){logger['error'](_0x7726('0x11'),_0x8cfddf,_0xebce49['error'][_0x7726('0x12')]);return _0x22eff8(_0xebce49['error']['message']);}logger['error'](_0x7726('0x11'),_0x8cfddf,_0xebce49[_0x7726('0xf')][_0x7726('0x12')]);return _0x74cbf7(_0xebce49['error']['message']);}else{logger[_0x7726('0xc')](_0x7726('0x11'),_0x8cfddf,_0x7726('0xd'));_0x74cbf7(_0xebce49['result']['message']);}})[_0x7726('0x13')](function(_0xaef3cc){logger[_0x7726('0xf')](_0x7726('0x11'),_0x8cfddf,_0xaef3cc);_0x22eff8(_0xaef3cc);});});}exports['GetDeskAccount']=function(_0x1cdac){var _0xe4fd7=this;return new Promise(function(_0x9b3fb7,_0x2ddfd1){return db[_0x7726('0x14')]['findAll']({'raw':_0x1cdac[_0x7726('0x15')]?_0x1cdac[_0x7726('0x15')][_0x7726('0x16')]===undefined?!![]:![]:!![],'where':_0x1cdac[_0x7726('0x15')]?_0x1cdac[_0x7726('0x15')]['where']||null:null,'attributes':_0x1cdac[_0x7726('0x15')]?_0x1cdac[_0x7726('0x15')]['attributes']||null:null,'limit':_0x1cdac[_0x7726('0x15')]?_0x1cdac['options'][_0x7726('0x17')]||null:null,'include':_0x1cdac['options']?_0x1cdac['options'][_0x7726('0x18')]?_['map'](_0x1cdac[_0x7726('0x15')][_0x7726('0x18')],function(_0x1c9add){return{'model':db[_0x1c9add[_0x7726('0x19')]],'as':_0x1c9add['as'],'attributes':_0x1c9add[_0x7726('0x1a')],'include':_0x1c9add['include']?_[_0x7726('0x1b')](_0x1c9add[_0x7726('0x18')],function(_0x5f04cb){return{'model':db[_0x5f04cb[_0x7726('0x19')]],'as':_0x5f04cb['as'],'attributes':_0x5f04cb[_0x7726('0x1a')],'include':_0x5f04cb['include']?_[_0x7726('0x1b')](_0x5f04cb[_0x7726('0x18')],function(_0x251614){return{'model':db[_0x251614[_0x7726('0x19')]],'as':_0x251614['as'],'attributes':_0x251614['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x134441){logger[_0x7726('0xc')](_0x7726('0x1c'),_0x1cdac);logger['debug'](_0x7726('0x1c'),_0x1cdac,JSON[_0x7726('0x1d')](_0x134441));_0x9b3fb7(_0x134441);})[_0x7726('0x13')](function(_0x243c9a){logger[_0x7726('0xf')](_0x7726('0x1c'),_0x243c9a[_0x7726('0x12')],_0x1cdac);_0x2ddfd1(_0xe4fd7[_0x7726('0xf')](0x1f4,_0x243c9a['message']));});});};exports['ShowDeskAccount']=function(_0x2967f1){var _0x5f1cdd=this;return new Promise(function(_0x38c542,_0x246782){return db[_0x7726('0x14')][_0x7726('0x1e')]({'raw':_0x2967f1['options']?_0x2967f1[_0x7726('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2967f1[_0x7726('0x15')]?_0x2967f1['options'][_0x7726('0x1f')]||null:null,'attributes':_0x2967f1[_0x7726('0x15')]?_0x2967f1[_0x7726('0x15')][_0x7726('0x1a')]||null:null,'include':_0x2967f1[_0x7726('0x15')]?_0x2967f1[_0x7726('0x15')][_0x7726('0x18')]?_[_0x7726('0x1b')](_0x2967f1[_0x7726('0x15')][_0x7726('0x18')],function(_0x4df883){return{'model':db[_0x4df883['model']],'as':_0x4df883['as'],'attributes':_0x4df883[_0x7726('0x1a')],'include':_0x4df883[_0x7726('0x18')]?_[_0x7726('0x1b')](_0x4df883['include'],function(_0x345991){return{'model':db[_0x345991[_0x7726('0x19')]],'as':_0x345991['as'],'attributes':_0x345991[_0x7726('0x1a')],'include':_0x345991[_0x7726('0x18')]?_['map'](_0x345991[_0x7726('0x18')],function(_0x540b31){return{'model':db[_0x540b31['model']],'as':_0x540b31['as'],'attributes':_0x540b31['attributes']};}):[]};}):[]};}):[]:[]})[_0x7726('0xb')](function(_0x187db8){logger[_0x7726('0xc')](_0x7726('0x20'),_0x2967f1);logger['debug'](_0x7726('0x20'),_0x2967f1,JSON[_0x7726('0x1d')](_0x187db8));_0x38c542(_0x187db8);})[_0x7726('0x13')](function(_0x29e0d3){logger[_0x7726('0xf')]('ShowDeskAccount',_0x29e0d3[_0x7726('0x12')],_0x2967f1);_0x246782(_0x5f1cdd[_0x7726('0xf')](0x1f4,_0x29e0d3[_0x7726('0x12')]));});});};
\ No newline at end of file
+var _0x8bb5=['rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','catch','DeskAccount','find','ShowDeskAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x27a5fe,_0x15e2a1){var _0x128c1d=function(_0x3e7576){while(--_0x3e7576){_0x27a5fe['push'](_0x27a5fe['shift']());}};_0x128c1d(++_0x15e2a1);}(_0x8bb5,0x86));var _0x58bb=function(_0x221432,_0x596f70){_0x221432=_0x221432-0x0;var _0x11a8a2=_0x8bb5[_0x221432];return _0x11a8a2;};'use strict';var _=require(_0x58bb('0x0'));var util=require(_0x58bb('0x1'));var moment=require(_0x58bb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58bb('0x3'));var db=require(_0x58bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x58bb('0x5'))(_0x58bb('0x6'));var config=require(_0x58bb('0x7'));var jayson=require(_0x58bb('0x8'));var client=jayson['client'][_0x58bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b2794,_0x266031,_0x1a9724){return new BPromise(function(_0x3afc6e,_0x1c4220){return client[_0x58bb('0xa')](_0x4b2794,_0x1a9724)[_0x58bb('0xb')](function(_0x39eafa){logger[_0x58bb('0xc')](_0x58bb('0xd'),_0x266031,_0x58bb('0xe'));logger[_0x58bb('0xf')](_0x58bb('0x10'),_0x266031,_0x58bb('0xe'),JSON[_0x58bb('0x11')](_0x39eafa));if(_0x39eafa[_0x58bb('0x12')]){if(_0x39eafa['error']['code']===0x1f4){logger['error'](_0x58bb('0xd'),_0x266031,_0x39eafa['error'][_0x58bb('0x13')]);return _0x1c4220(_0x39eafa[_0x58bb('0x12')][_0x58bb('0x13')]);}logger[_0x58bb('0x12')]('DeskAccount,\x20%s,\x20%s',_0x266031,_0x39eafa[_0x58bb('0x12')][_0x58bb('0x13')]);return _0x3afc6e(_0x39eafa[_0x58bb('0x12')]['message']);}else{logger[_0x58bb('0xc')]('DeskAccount,\x20%s,\x20%s',_0x266031,_0x58bb('0xe'));_0x3afc6e(_0x39eafa[_0x58bb('0x14')][_0x58bb('0x13')]);}})['catch'](function(_0x262176){logger[_0x58bb('0x12')](_0x58bb('0xd'),_0x266031,_0x262176);_0x1c4220(_0x262176);});});}exports['GetDeskAccount']=function(_0x509f4f){var _0x5cc620=this;return new Promise(function(_0x576586,_0x263be3){return db['DeskAccount'][_0x58bb('0x15')]({'raw':_0x509f4f[_0x58bb('0x16')]?_0x509f4f[_0x58bb('0x16')][_0x58bb('0x17')]===undefined?!![]:![]:!![],'where':_0x509f4f[_0x58bb('0x16')]?_0x509f4f[_0x58bb('0x16')][_0x58bb('0x18')]||null:null,'attributes':_0x509f4f[_0x58bb('0x16')]?_0x509f4f['options'][_0x58bb('0x19')]||null:null,'limit':_0x509f4f[_0x58bb('0x16')]?_0x509f4f['options'][_0x58bb('0x1a')]||null:null,'include':_0x509f4f[_0x58bb('0x16')]?_0x509f4f[_0x58bb('0x16')][_0x58bb('0x1b')]?_[_0x58bb('0x1c')](_0x509f4f['options']['include'],function(_0x40f13e){return{'model':db[_0x40f13e[_0x58bb('0x1d')]],'as':_0x40f13e['as'],'attributes':_0x40f13e['attributes'],'include':_0x40f13e[_0x58bb('0x1b')]?_[_0x58bb('0x1c')](_0x40f13e['include'],function(_0x327810){return{'model':db[_0x327810[_0x58bb('0x1d')]],'as':_0x327810['as'],'attributes':_0x327810[_0x58bb('0x19')],'include':_0x327810[_0x58bb('0x1b')]?_[_0x58bb('0x1c')](_0x327810[_0x58bb('0x1b')],function(_0x1e0a47){return{'model':db[_0x1e0a47['model']],'as':_0x1e0a47['as'],'attributes':_0x1e0a47[_0x58bb('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x262703){logger['info'](_0x58bb('0x1e'),_0x509f4f);logger[_0x58bb('0xf')]('GetDeskAccount',_0x509f4f,JSON['stringify'](_0x262703));_0x576586(_0x262703);})[_0x58bb('0x1f')](function(_0x1e6529){logger[_0x58bb('0x12')](_0x58bb('0x1e'),_0x1e6529[_0x58bb('0x13')],_0x509f4f);_0x263be3(_0x5cc620[_0x58bb('0x12')](0x1f4,_0x1e6529[_0x58bb('0x13')]));});});};exports['ShowDeskAccount']=function(_0x4d8706){var _0x35b508=this;return new Promise(function(_0x1eb42a,_0x472495){return db[_0x58bb('0x20')][_0x58bb('0x21')]({'raw':_0x4d8706[_0x58bb('0x16')]?_0x4d8706[_0x58bb('0x16')][_0x58bb('0x17')]===undefined?!![]:![]:!![],'where':_0x4d8706[_0x58bb('0x16')]?_0x4d8706['options']['where']||null:null,'attributes':_0x4d8706[_0x58bb('0x16')]?_0x4d8706['options'][_0x58bb('0x19')]||null:null,'include':_0x4d8706['options']?_0x4d8706[_0x58bb('0x16')][_0x58bb('0x1b')]?_[_0x58bb('0x1c')](_0x4d8706[_0x58bb('0x16')][_0x58bb('0x1b')],function(_0x1513a4){return{'model':db[_0x1513a4[_0x58bb('0x1d')]],'as':_0x1513a4['as'],'attributes':_0x1513a4['attributes'],'include':_0x1513a4[_0x58bb('0x1b')]?_[_0x58bb('0x1c')](_0x1513a4['include'],function(_0x77730e){return{'model':db[_0x77730e[_0x58bb('0x1d')]],'as':_0x77730e['as'],'attributes':_0x77730e['attributes'],'include':_0x77730e['include']?_[_0x58bb('0x1c')](_0x77730e[_0x58bb('0x1b')],function(_0x5e227d){return{'model':db[_0x5e227d[_0x58bb('0x1d')]],'as':_0x5e227d['as'],'attributes':_0x5e227d['attributes']};}):[]};}):[]};}):[]:[]})[_0x58bb('0xb')](function(_0x4ed358){logger[_0x58bb('0xc')](_0x58bb('0x22'),_0x4d8706);logger[_0x58bb('0xf')](_0x58bb('0x22'),_0x4d8706,JSON[_0x58bb('0x11')](_0x4ed358));_0x1eb42a(_0x4ed358);})[_0x58bb('0x1f')](function(_0x36733c){logger['error'](_0x58bb('0x22'),_0x36733c[_0x58bb('0x13')],_0x4d8706);_0x472495(_0x35b508[_0x58bb('0x12')](0x1f4,_0x36733c[_0x58bb('0x13')]));});});};
\ No newline at end of file