Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / intDeskAccount / intDeskAccount.rpc.js
index 1fb3899..858e5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00ff=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','findAll','options','where','attributes','limit','include','map','model','catch','DeskAccount','find','raw','info','ShowDeskAccount','lodash','util','moment','bluebird'];(function(_0x15f43a,_0x57c8b5){var _0x2369bc=function(_0x46c265){while(--_0x46c265){_0x15f43a['push'](_0x15f43a['shift']());}};_0x2369bc(++_0x57c8b5);}(_0x00ff,0xf8));var _0xf00f=function(_0x51f037,_0xdfa1e9){_0x51f037=_0x51f037-0x0;var _0x35faaa=_0x00ff[_0x51f037];return _0x35faaa;};'use strict';var _=require(_0xf00f('0x0'));var util=require(_0xf00f('0x1'));var moment=require(_0xf00f('0x2'));var BPromise=require(_0xf00f('0x3'));var rs=require(_0xf00f('0x4'));var fs=require('fs');var Redis=require(_0xf00f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf00f('0x6'))(_0xf00f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf00f('0x8'));var client=jayson[_0xf00f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459553,_0x26a631,_0x5895f1){return new BPromise(function(_0x39afff,_0x41dd8c){return client[_0xf00f('0xa')](_0x459553,_0x5895f1)[_0xf00f('0xb')](function(_0x58173a){logger['info'](_0xf00f('0xc'),_0x26a631,_0xf00f('0xd'));logger[_0xf00f('0xe')](_0xf00f('0xf'),_0x26a631,'request\x20sent',JSON[_0xf00f('0x10')](_0x58173a));if(_0x58173a[_0xf00f('0x11')]){if(_0x58173a[_0xf00f('0x11')][_0xf00f('0x12')]===0x1f4){logger[_0xf00f('0x11')](_0xf00f('0xc'),_0x26a631,_0x58173a['error'][_0xf00f('0x13')]);return _0x41dd8c(_0x58173a[_0xf00f('0x11')][_0xf00f('0x13')]);}logger[_0xf00f('0x11')](_0xf00f('0xc'),_0x26a631,_0x58173a[_0xf00f('0x11')][_0xf00f('0x13')]);return _0x39afff(_0x58173a[_0xf00f('0x11')][_0xf00f('0x13')]);}else{logger['info'](_0xf00f('0xc'),_0x26a631,_0xf00f('0xd'));_0x39afff(_0x58173a[_0xf00f('0x14')]['message']);}})['catch'](function(_0x5caa54){logger[_0xf00f('0x11')](_0xf00f('0xc'),_0x26a631,_0x5caa54);_0x41dd8c(_0x5caa54);});});}exports[_0xf00f('0x15')]=function(_0xedd1ee){var _0x5b75e2=this;return new Promise(function(_0x525162,_0x2488ed){return db['DeskAccount'][_0xf00f('0x16')]({'raw':_0xedd1ee[_0xf00f('0x17')]?_0xedd1ee[_0xf00f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xedd1ee[_0xf00f('0x17')]?_0xedd1ee['options'][_0xf00f('0x18')]||null:null,'attributes':_0xedd1ee[_0xf00f('0x17')]?_0xedd1ee['options'][_0xf00f('0x19')]||null:null,'limit':_0xedd1ee[_0xf00f('0x17')]?_0xedd1ee[_0xf00f('0x17')][_0xf00f('0x1a')]||null:null,'include':_0xedd1ee['options']?_0xedd1ee[_0xf00f('0x17')][_0xf00f('0x1b')]?_[_0xf00f('0x1c')](_0xedd1ee[_0xf00f('0x17')]['include'],function(_0x34bed4){return{'model':db[_0x34bed4['model']],'as':_0x34bed4['as'],'attributes':_0x34bed4['attributes'],'include':_0x34bed4[_0xf00f('0x1b')]?_[_0xf00f('0x1c')](_0x34bed4[_0xf00f('0x1b')],function(_0x3d067f){return{'model':db[_0x3d067f[_0xf00f('0x1d')]],'as':_0x3d067f['as'],'attributes':_0x3d067f['attributes'],'include':_0x3d067f['include']?_[_0xf00f('0x1c')](_0x3d067f['include'],function(_0x3b9509){return{'model':db[_0x3b9509['model']],'as':_0x3b9509['as'],'attributes':_0x3b9509[_0xf00f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23b26b){logger['info'](_0xf00f('0x15'),_0xedd1ee);logger[_0xf00f('0xe')](_0xf00f('0x15'),_0xedd1ee,JSON[_0xf00f('0x10')](_0x23b26b));_0x525162(_0x23b26b);})[_0xf00f('0x1e')](function(_0x3f9427){logger[_0xf00f('0x11')](_0xf00f('0x15'),_0x3f9427[_0xf00f('0x13')],_0xedd1ee);_0x2488ed(_0x5b75e2[_0xf00f('0x11')](0x1f4,_0x3f9427[_0xf00f('0x13')]));});});};exports['ShowDeskAccount']=function(_0x454e7b){var _0x1602ab=this;return new Promise(function(_0x294ab3,_0x466101){return db[_0xf00f('0x1f')][_0xf00f('0x20')]({'raw':_0x454e7b['options']?_0x454e7b['options'][_0xf00f('0x21')]===undefined?!![]:![]:!![],'where':_0x454e7b['options']?_0x454e7b[_0xf00f('0x17')]['where']||null:null,'attributes':_0x454e7b['options']?_0x454e7b[_0xf00f('0x17')][_0xf00f('0x19')]||null:null,'include':_0x454e7b[_0xf00f('0x17')]?_0x454e7b[_0xf00f('0x17')][_0xf00f('0x1b')]?_[_0xf00f('0x1c')](_0x454e7b[_0xf00f('0x17')]['include'],function(_0x1495ea){return{'model':db[_0x1495ea[_0xf00f('0x1d')]],'as':_0x1495ea['as'],'attributes':_0x1495ea[_0xf00f('0x19')],'include':_0x1495ea[_0xf00f('0x1b')]?_[_0xf00f('0x1c')](_0x1495ea['include'],function(_0x5c3e5e){return{'model':db[_0x5c3e5e[_0xf00f('0x1d')]],'as':_0x5c3e5e['as'],'attributes':_0x5c3e5e[_0xf00f('0x19')],'include':_0x5c3e5e['include']?_[_0xf00f('0x1c')](_0x5c3e5e['include'],function(_0x560c32){return{'model':db[_0x560c32['model']],'as':_0x560c32['as'],'attributes':_0x560c32[_0xf00f('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf00f('0xb')](function(_0x43db31){logger[_0xf00f('0x22')](_0xf00f('0x23'),_0x454e7b);logger['debug']('ShowDeskAccount',_0x454e7b,JSON[_0xf00f('0x10')](_0x43db31));_0x294ab3(_0x43db31);})[_0xf00f('0x1e')](function(_0x547c2b){logger['error']('ShowDeskAccount',_0x547c2b[_0xf00f('0x13')],_0x454e7b);_0x466101(_0x1602ab[_0xf00f('0x11')](0x1f4,_0x547c2b[_0xf00f('0x13')]));});});};
\ No newline at end of file
+var _0x5d42=['raw','where','attributes','limit','include','model','map','ShowDeskAccount','DeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','findAll','options'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x5d42,0x13a));var _0x25d4=function(_0x2305b7,_0x3d4f96){_0x2305b7=_0x2305b7-0x0;var _0x316594=_0x5d42[_0x2305b7];return _0x316594;};'use strict';var _=require(_0x25d4('0x0'));var util=require(_0x25d4('0x1'));var moment=require('moment');var BPromise=require(_0x25d4('0x2'));var rs=require(_0x25d4('0x3'));var fs=require('fs');var Redis=require(_0x25d4('0x4'));var db=require(_0x25d4('0x5'))['db'];var utils=require(_0x25d4('0x6'));var logger=require(_0x25d4('0x7'))(_0x25d4('0x8'));var config=require(_0x25d4('0x9'));var jayson=require(_0x25d4('0xa'));var client=jayson[_0x25d4('0xb')][_0x25d4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bfb73,_0x13056f,_0x4d2fba){return new BPromise(function(_0x2bd6b9,_0x42d055){return client[_0x25d4('0xd')](_0x1bfb73,_0x4d2fba)[_0x25d4('0xe')](function(_0x4b8396){logger[_0x25d4('0xf')](_0x25d4('0x10'),_0x13056f,_0x25d4('0x11'));logger[_0x25d4('0x12')](_0x25d4('0x13'),_0x13056f,_0x25d4('0x11'),JSON[_0x25d4('0x14')](_0x4b8396));if(_0x4b8396['error']){if(_0x4b8396[_0x25d4('0x15')][_0x25d4('0x16')]===0x1f4){logger[_0x25d4('0x15')](_0x25d4('0x10'),_0x13056f,_0x4b8396[_0x25d4('0x15')][_0x25d4('0x17')]);return _0x42d055(_0x4b8396['error']['message']);}logger[_0x25d4('0x15')](_0x25d4('0x10'),_0x13056f,_0x4b8396['error']['message']);return _0x2bd6b9(_0x4b8396[_0x25d4('0x15')][_0x25d4('0x17')]);}else{logger['info'](_0x25d4('0x10'),_0x13056f,_0x25d4('0x11'));_0x2bd6b9(_0x4b8396['result'][_0x25d4('0x17')]);}})[_0x25d4('0x18')](function(_0x51377b){logger[_0x25d4('0x15')](_0x25d4('0x10'),_0x13056f,_0x51377b);_0x42d055(_0x51377b);});});}exports[_0x25d4('0x19')]=function(_0x507313){var _0xf01a80=this;return new Promise(function(_0x2076d7,_0xcc3c68){return db['DeskAccount'][_0x25d4('0x1a')]({'raw':_0x507313[_0x25d4('0x1b')]?_0x507313[_0x25d4('0x1b')][_0x25d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x507313[_0x25d4('0x1b')]?_0x507313[_0x25d4('0x1b')][_0x25d4('0x1d')]||null:null,'attributes':_0x507313['options']?_0x507313['options'][_0x25d4('0x1e')]||null:null,'limit':_0x507313[_0x25d4('0x1b')]?_0x507313[_0x25d4('0x1b')][_0x25d4('0x1f')]||null:null,'include':_0x507313[_0x25d4('0x1b')]?_0x507313['options'][_0x25d4('0x20')]?_['map'](_0x507313['options'][_0x25d4('0x20')],function(_0x1a16ce){return{'model':db[_0x1a16ce[_0x25d4('0x21')]],'as':_0x1a16ce['as'],'attributes':_0x1a16ce[_0x25d4('0x1e')],'include':_0x1a16ce['include']?_[_0x25d4('0x22')](_0x1a16ce[_0x25d4('0x20')],function(_0x215e51){return{'model':db[_0x215e51['model']],'as':_0x215e51['as'],'attributes':_0x215e51['attributes'],'include':_0x215e51[_0x25d4('0x20')]?_[_0x25d4('0x22')](_0x215e51[_0x25d4('0x20')],function(_0x29de0e){return{'model':db[_0x29de0e[_0x25d4('0x21')]],'as':_0x29de0e['as'],'attributes':_0x29de0e[_0x25d4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25d4('0xe')](function(_0x49eb0f){logger['info'](_0x25d4('0x19'),_0x507313);logger[_0x25d4('0x12')](_0x25d4('0x19'),_0x507313,JSON[_0x25d4('0x14')](_0x49eb0f));_0x2076d7(_0x49eb0f);})[_0x25d4('0x18')](function(_0x2660a3){logger['error']('GetDeskAccount',_0x2660a3[_0x25d4('0x17')],_0x507313);_0xcc3c68(_0xf01a80['error'](0x1f4,_0x2660a3[_0x25d4('0x17')]));});});};exports[_0x25d4('0x23')]=function(_0x381a67){var _0x1f81b9=this;return new Promise(function(_0x4baa4b,_0x8a6e60){return db[_0x25d4('0x24')][_0x25d4('0x25')]({'raw':_0x381a67[_0x25d4('0x1b')]?_0x381a67[_0x25d4('0x1b')][_0x25d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x381a67[_0x25d4('0x1b')]?_0x381a67[_0x25d4('0x1b')][_0x25d4('0x1d')]||null:null,'attributes':_0x381a67[_0x25d4('0x1b')]?_0x381a67['options']['attributes']||null:null,'include':_0x381a67['options']?_0x381a67['options'][_0x25d4('0x20')]?_[_0x25d4('0x22')](_0x381a67[_0x25d4('0x1b')][_0x25d4('0x20')],function(_0x3dac17){return{'model':db[_0x3dac17[_0x25d4('0x21')]],'as':_0x3dac17['as'],'attributes':_0x3dac17[_0x25d4('0x1e')],'include':_0x3dac17['include']?_[_0x25d4('0x22')](_0x3dac17['include'],function(_0xc5389f){return{'model':db[_0xc5389f[_0x25d4('0x21')]],'as':_0xc5389f['as'],'attributes':_0xc5389f[_0x25d4('0x1e')],'include':_0xc5389f[_0x25d4('0x20')]?_[_0x25d4('0x22')](_0xc5389f[_0x25d4('0x20')],function(_0x1a19c0){return{'model':db[_0x1a19c0[_0x25d4('0x21')]],'as':_0x1a19c0['as'],'attributes':_0x1a19c0[_0x25d4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x25d4('0xe')](function(_0x4ea244){logger[_0x25d4('0xf')](_0x25d4('0x23'),_0x381a67);logger['debug'](_0x25d4('0x23'),_0x381a67,JSON[_0x25d4('0x14')](_0x4ea244));_0x4baa4b(_0x4ea244);})[_0x25d4('0x18')](function(_0x374bbd){logger[_0x25d4('0x15')](_0x25d4('0x23'),_0x374bbd[_0x25d4('0x17')],_0x381a67);_0x8a6e60(_0x1f81b9[_0x25d4('0x15')](0x1f4,_0x374bbd['message']));});});};
\ No newline at end of file