Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 2fbb7b5..a237d3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd8d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowSmsQueue','util','bluebird','randomstring'];(function(_0x1b2857,_0x53cc73){var _0x45102d=function(_0x2d0429){while(--_0x2d0429){_0x1b2857['push'](_0x1b2857['shift']());}};_0x45102d(++_0x53cc73);}(_0xcd8d,0x1c0));var _0xdcd8=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xcd8d[_0x55abd9];return _0x3e5669;};'use strict';var _=require('lodash');var util=require(_0xdcd8('0x0'));var moment=require('moment');var BPromise=require(_0xdcd8('0x1'));var rs=require(_0xdcd8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcd8('0x3'))['db'];var utils=require(_0xdcd8('0x4'));var logger=require(_0xdcd8('0x5'))(_0xdcd8('0x6'));var config=require(_0xdcd8('0x7'));var jayson=require(_0xdcd8('0x8'));var client=jayson[_0xdcd8('0x9')][_0xdcd8('0xa')]({'port':0x232a});config[_0xdcd8('0xb')]=_[_0xdcd8('0xc')](config[_0xdcd8('0xb')],{'host':_0xdcd8('0xd'),'port':0x18eb});var socket=require(_0xdcd8('0xe'))(new Redis(config[_0xdcd8('0xb')]));require(_0xdcd8('0xf'))[_0xdcd8('0x10')](socket);function respondWithRpcPromise(_0x2d4d1f,_0x383ab5,_0x1ba71d){return new BPromise(function(_0x21dcd0,_0x34aba7){return client[_0xdcd8('0x11')](_0x2d4d1f,_0x1ba71d)[_0xdcd8('0x12')](function(_0x849599){logger['info'](_0xdcd8('0x13'),_0x383ab5,_0xdcd8('0x14'));logger[_0xdcd8('0x15')](_0xdcd8('0x16'),_0x383ab5,_0xdcd8('0x14'),JSON[_0xdcd8('0x17')](_0x849599));if(_0x849599[_0xdcd8('0x18')]){if(_0x849599[_0xdcd8('0x18')]['code']===0x1f4){logger[_0xdcd8('0x18')](_0xdcd8('0x13'),_0x383ab5,_0x849599[_0xdcd8('0x18')]['message']);return _0x34aba7(_0x849599[_0xdcd8('0x18')][_0xdcd8('0x19')]);}logger[_0xdcd8('0x18')]('SmsQueue,\x20%s,\x20%s',_0x383ab5,_0x849599[_0xdcd8('0x18')]['message']);return _0x21dcd0(_0x849599[_0xdcd8('0x18')][_0xdcd8('0x19')]);}else{logger[_0xdcd8('0x1a')]('SmsQueue,\x20%s,\x20%s',_0x383ab5,'request\x20sent');_0x21dcd0(_0x849599[_0xdcd8('0x1b')][_0xdcd8('0x19')]);}})[_0xdcd8('0x1c')](function(_0x4f9120){logger[_0xdcd8('0x18')]('SmsQueue,\x20%s,\x20%s',_0x383ab5,_0x4f9120);_0x34aba7(_0x4f9120);});});}exports[_0xdcd8('0x1d')]=function(_0x398c83){var _0x3c918d=this;return new Promise(function(_0x76f05,_0x378573){return db['SmsQueue'][_0xdcd8('0x1e')]({'raw':_0x398c83[_0xdcd8('0x1f')]?_0x398c83['options'][_0xdcd8('0x20')]===undefined?!![]:![]:!![],'where':_0x398c83[_0xdcd8('0x1f')]?_0x398c83[_0xdcd8('0x1f')][_0xdcd8('0x21')]||null:null,'attributes':_0x398c83['options']?_0x398c83['options'][_0xdcd8('0x22')]||null:null,'limit':_0x398c83[_0xdcd8('0x1f')]?_0x398c83[_0xdcd8('0x1f')][_0xdcd8('0x23')]||null:null,'include':_0x398c83['options']?_0x398c83[_0xdcd8('0x1f')][_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0x398c83[_0xdcd8('0x1f')][_0xdcd8('0x24')],function(_0xeffa9c){return{'model':db[_0xeffa9c['model']],'as':_0xeffa9c['as'],'attributes':_0xeffa9c['attributes'],'include':_0xeffa9c[_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0xeffa9c[_0xdcd8('0x24')],function(_0x4a624a){return{'model':db[_0x4a624a[_0xdcd8('0x26')]],'as':_0x4a624a['as'],'attributes':_0x4a624a['attributes'],'include':_0x4a624a[_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0x4a624a['include'],function(_0x412a6c){return{'model':db[_0x412a6c['model']],'as':_0x412a6c['as'],'attributes':_0x412a6c['attributes']};}):[]};}):[]};}):[]:[]})[_0xdcd8('0x12')](function(_0x3a5564){logger['info'](_0xdcd8('0x1d'),_0x398c83);logger[_0xdcd8('0x15')](_0xdcd8('0x1d'),_0x398c83,JSON[_0xdcd8('0x17')](_0x3a5564));_0x76f05(_0x3a5564);})['catch'](function(_0x216d55){logger[_0xdcd8('0x18')]('GetSmsQueue',_0x216d55[_0xdcd8('0x19')],_0x398c83);_0x378573(_0x3c918d[_0xdcd8('0x18')](0x1f4,_0x216d55[_0xdcd8('0x19')]));});});};exports['ShowSmsQueue']=function(_0x516e7c){var _0x288368=this;return new Promise(function(_0x273b25,_0x367f19){return db['SmsQueue'][_0xdcd8('0x27')]({'raw':_0x516e7c[_0xdcd8('0x1f')]?_0x516e7c['options'][_0xdcd8('0x20')]===undefined?!![]:![]:!![],'where':_0x516e7c[_0xdcd8('0x1f')]?_0x516e7c[_0xdcd8('0x1f')]['where']||null:null,'attributes':_0x516e7c[_0xdcd8('0x1f')]?_0x516e7c[_0xdcd8('0x1f')][_0xdcd8('0x22')]||null:null,'include':_0x516e7c[_0xdcd8('0x1f')]?_0x516e7c[_0xdcd8('0x1f')][_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0x516e7c[_0xdcd8('0x1f')][_0xdcd8('0x24')],function(_0x64808d){return{'model':db[_0x64808d[_0xdcd8('0x26')]],'as':_0x64808d['as'],'attributes':_0x64808d[_0xdcd8('0x22')],'include':_0x64808d[_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0x64808d[_0xdcd8('0x24')],function(_0x526ff1){return{'model':db[_0x526ff1[_0xdcd8('0x26')]],'as':_0x526ff1['as'],'attributes':_0x526ff1['attributes'],'include':_0x526ff1[_0xdcd8('0x24')]?_[_0xdcd8('0x25')](_0x526ff1[_0xdcd8('0x24')],function(_0x197dc5){return{'model':db[_0x197dc5[_0xdcd8('0x26')]],'as':_0x197dc5['as'],'attributes':_0x197dc5[_0xdcd8('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdcd8('0x12')](function(_0x4a80be){logger[_0xdcd8('0x1a')](_0xdcd8('0x28'),_0x516e7c);logger[_0xdcd8('0x15')]('ShowSmsQueue',_0x516e7c,JSON['stringify'](_0x4a80be));_0x273b25(_0x4a80be);})[_0xdcd8('0x1c')](function(_0x1ab500){logger[_0xdcd8('0x18')]('ShowSmsQueue',_0x1ab500['message'],_0x516e7c);_0x367f19(_0x288368[_0xdcd8('0x18')](0x1f4,_0x1ab500[_0xdcd8('0x19')]));});});};
\ No newline at end of file
+var _0xb5b3=['raw','where','attributes','limit','include','model','debug','stringify','ShowSmsQueue','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','code','error','message','catch','GetSmsQueue','SmsQueue','findAll','options'];(function(_0x596fea,_0x5d7c58){var _0x1b9187=function(_0x59c6ec){while(--_0x59c6ec){_0x596fea['push'](_0x596fea['shift']());}};_0x1b9187(++_0x5d7c58);}(_0xb5b3,0x15b));var _0x3b5b=function(_0xcc32ac,_0x57c211){_0xcc32ac=_0xcc32ac-0x0;var _0x557786=_0xb5b3[_0xcc32ac];return _0x557786;};'use strict';var _=require(_0x3b5b('0x0'));var util=require(_0x3b5b('0x1'));var moment=require(_0x3b5b('0x2'));var BPromise=require(_0x3b5b('0x3'));var rs=require(_0x3b5b('0x4'));var fs=require('fs');var Redis=require(_0x3b5b('0x5'));var db=require(_0x3b5b('0x6'))['db'];var utils=require(_0x3b5b('0x7'));var logger=require(_0x3b5b('0x8'))(_0x3b5b('0x9'));var config=require(_0x3b5b('0xa'));var jayson=require(_0x3b5b('0xb'));var client=jayson[_0x3b5b('0xc')][_0x3b5b('0xd')]({'port':0x232a});config[_0x3b5b('0xe')]=_[_0x3b5b('0xf')](config[_0x3b5b('0xe')],{'host':_0x3b5b('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b5b('0xe')]));require(_0x3b5b('0x11'))[_0x3b5b('0x12')](socket);function respondWithRpcPromise(_0x47a12b,_0x31970a,_0x482858){return new BPromise(function(_0x34bd30,_0x408e0f){return client['request'](_0x47a12b,_0x482858)[_0x3b5b('0x13')](function(_0x3b887b){logger[_0x3b5b('0x14')](_0x3b5b('0x15'),_0x31970a,_0x3b5b('0x16'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x31970a,'request\x20sent',JSON['stringify'](_0x3b887b));if(_0x3b887b['error']){if(_0x3b887b['error'][_0x3b5b('0x17')]===0x1f4){logger[_0x3b5b('0x18')]('SmsQueue,\x20%s,\x20%s',_0x31970a,_0x3b887b[_0x3b5b('0x18')]['message']);return _0x408e0f(_0x3b887b[_0x3b5b('0x18')][_0x3b5b('0x19')]);}logger[_0x3b5b('0x18')](_0x3b5b('0x15'),_0x31970a,_0x3b887b[_0x3b5b('0x18')]['message']);return _0x34bd30(_0x3b887b['error'][_0x3b5b('0x19')]);}else{logger[_0x3b5b('0x14')](_0x3b5b('0x15'),_0x31970a,'request\x20sent');_0x34bd30(_0x3b887b['result']['message']);}})[_0x3b5b('0x1a')](function(_0x414aed){logger['error'](_0x3b5b('0x15'),_0x31970a,_0x414aed);_0x408e0f(_0x414aed);});});}exports[_0x3b5b('0x1b')]=function(_0x33a0b5){var _0x3b82a5=this;return new Promise(function(_0x44affd,_0x45ae66){return db[_0x3b5b('0x1c')][_0x3b5b('0x1d')]({'raw':_0x33a0b5[_0x3b5b('0x1e')]?_0x33a0b5[_0x3b5b('0x1e')][_0x3b5b('0x1f')]===undefined?!![]:![]:!![],'where':_0x33a0b5[_0x3b5b('0x1e')]?_0x33a0b5['options'][_0x3b5b('0x20')]||null:null,'attributes':_0x33a0b5[_0x3b5b('0x1e')]?_0x33a0b5['options'][_0x3b5b('0x21')]||null:null,'limit':_0x33a0b5[_0x3b5b('0x1e')]?_0x33a0b5['options'][_0x3b5b('0x22')]||null:null,'include':_0x33a0b5[_0x3b5b('0x1e')]?_0x33a0b5[_0x3b5b('0x1e')]['include']?_['map'](_0x33a0b5[_0x3b5b('0x1e')][_0x3b5b('0x23')],function(_0x36260e){return{'model':db[_0x36260e[_0x3b5b('0x24')]],'as':_0x36260e['as'],'attributes':_0x36260e[_0x3b5b('0x21')],'include':_0x36260e['include']?_['map'](_0x36260e['include'],function(_0x476fc0){return{'model':db[_0x476fc0[_0x3b5b('0x24')]],'as':_0x476fc0['as'],'attributes':_0x476fc0[_0x3b5b('0x21')],'include':_0x476fc0[_0x3b5b('0x23')]?_['map'](_0x476fc0[_0x3b5b('0x23')],function(_0x12822d){return{'model':db[_0x12822d[_0x3b5b('0x24')]],'as':_0x12822d['as'],'attributes':_0x12822d['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b5b('0x13')](function(_0x1ab66f){logger[_0x3b5b('0x14')](_0x3b5b('0x1b'),_0x33a0b5);logger[_0x3b5b('0x25')](_0x3b5b('0x1b'),_0x33a0b5,JSON[_0x3b5b('0x26')](_0x1ab66f));_0x44affd(_0x1ab66f);})[_0x3b5b('0x1a')](function(_0x4086db){logger['error'](_0x3b5b('0x1b'),_0x4086db[_0x3b5b('0x19')],_0x33a0b5);_0x45ae66(_0x3b82a5[_0x3b5b('0x18')](0x1f4,_0x4086db['message']));});});};exports[_0x3b5b('0x27')]=function(_0x4fecbd){var _0x47217a=this;return new Promise(function(_0x49b187,_0x10ec1b){return db[_0x3b5b('0x1c')][_0x3b5b('0x28')]({'raw':_0x4fecbd['options']?_0x4fecbd[_0x3b5b('0x1e')][_0x3b5b('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fecbd[_0x3b5b('0x1e')]?_0x4fecbd[_0x3b5b('0x1e')][_0x3b5b('0x20')]||null:null,'attributes':_0x4fecbd['options']?_0x4fecbd[_0x3b5b('0x1e')][_0x3b5b('0x21')]||null:null,'include':_0x4fecbd['options']?_0x4fecbd[_0x3b5b('0x1e')]['include']?_[_0x3b5b('0x29')](_0x4fecbd[_0x3b5b('0x1e')][_0x3b5b('0x23')],function(_0x5129e0){return{'model':db[_0x5129e0[_0x3b5b('0x24')]],'as':_0x5129e0['as'],'attributes':_0x5129e0[_0x3b5b('0x21')],'include':_0x5129e0[_0x3b5b('0x23')]?_[_0x3b5b('0x29')](_0x5129e0[_0x3b5b('0x23')],function(_0x2838b0){return{'model':db[_0x2838b0[_0x3b5b('0x24')]],'as':_0x2838b0['as'],'attributes':_0x2838b0[_0x3b5b('0x21')],'include':_0x2838b0['include']?_[_0x3b5b('0x29')](_0x2838b0[_0x3b5b('0x23')],function(_0x56755b){return{'model':db[_0x56755b['model']],'as':_0x56755b['as'],'attributes':_0x56755b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b5b('0x13')](function(_0x582362){logger['info']('ShowSmsQueue',_0x4fecbd);logger['debug']('ShowSmsQueue',_0x4fecbd,JSON['stringify'](_0x582362));_0x49b187(_0x582362);})['catch'](function(_0x3987b7){logger['error'](_0x3b5b('0x27'),_0x3987b7[_0x3b5b('0x19')],_0x4fecbd);_0x10ec1b(_0x47217a[_0x3b5b('0x18')](0x1f4,_0x3987b7['message']));});});};
\ No newline at end of file