Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 0f6db7a..915505e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffc1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','map','include','model','attributes','then','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x15cef4,_0x448b97){var _0x384430=function(_0x38ebce){while(--_0x38ebce){_0x15cef4['push'](_0x15cef4['shift']());}};_0x384430(++_0x448b97);}(_0xffc1,0x9f));var _0x1ffc=function(_0x4fe7aa,_0x36415a){_0x4fe7aa=_0x4fe7aa-0x0;var _0x57353e=_0xffc1[_0x4fe7aa];return _0x57353e;};'use strict';var _=require(_0x1ffc('0x0'));var util=require(_0x1ffc('0x1'));var moment=require(_0x1ffc('0x2'));var BPromise=require(_0x1ffc('0x3'));var rs=require(_0x1ffc('0x4'));var fs=require('fs');var Redis=require(_0x1ffc('0x5'));var db=require(_0x1ffc('0x6'))['db'];var utils=require(_0x1ffc('0x7'));var logger=require(_0x1ffc('0x8'))(_0x1ffc('0x9'));var config=require(_0x1ffc('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1ffc('0xb')][_0x1ffc('0xc')]({'port':0x232a});config[_0x1ffc('0xd')]=_['defaults'](config[_0x1ffc('0xd')],{'host':_0x1ffc('0xe'),'port':0x18eb});var socket=require(_0x1ffc('0xf'))(new Redis(config[_0x1ffc('0xd')]));require('./smsQueue.socket')[_0x1ffc('0x10')](socket);function respondWithRpcPromise(_0xe608ca,_0x509094,_0xb85ea){return new BPromise(function(_0x2a589d,_0x3f7828){return client['request'](_0xe608ca,_0xb85ea)['then'](function(_0x55c193){logger[_0x1ffc('0x11')](_0x1ffc('0x12'),_0x509094,_0x1ffc('0x13'));logger[_0x1ffc('0x14')](_0x1ffc('0x15'),_0x509094,_0x1ffc('0x13'),JSON[_0x1ffc('0x16')](_0x55c193));if(_0x55c193[_0x1ffc('0x17')]){if(_0x55c193[_0x1ffc('0x17')][_0x1ffc('0x18')]===0x1f4){logger[_0x1ffc('0x17')](_0x1ffc('0x12'),_0x509094,_0x55c193['error']['message']);return _0x3f7828(_0x55c193['error'][_0x1ffc('0x19')]);}logger[_0x1ffc('0x17')]('SmsQueue,\x20%s,\x20%s',_0x509094,_0x55c193[_0x1ffc('0x17')][_0x1ffc('0x19')]);return _0x2a589d(_0x55c193[_0x1ffc('0x17')][_0x1ffc('0x19')]);}else{logger[_0x1ffc('0x11')](_0x1ffc('0x12'),_0x509094,_0x1ffc('0x13'));_0x2a589d(_0x55c193[_0x1ffc('0x1a')]['message']);}})[_0x1ffc('0x1b')](function(_0x42a1c4){logger['error'](_0x1ffc('0x12'),_0x509094,_0x42a1c4);_0x3f7828(_0x42a1c4);});});}exports[_0x1ffc('0x1c')]=function(_0x2ad494){var _0x1ea0c1=this;return new Promise(function(_0x59db0a,_0x30d8fd){return db[_0x1ffc('0x1d')][_0x1ffc('0x1e')]({'raw':_0x2ad494[_0x1ffc('0x1f')]?_0x2ad494['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ad494[_0x1ffc('0x1f')]?_0x2ad494['options'][_0x1ffc('0x20')]||null:null,'attributes':_0x2ad494[_0x1ffc('0x1f')]?_0x2ad494[_0x1ffc('0x1f')]['attributes']||null:null,'limit':_0x2ad494['options']?_0x2ad494[_0x1ffc('0x1f')]['limit']||null:null,'include':_0x2ad494[_0x1ffc('0x1f')]?_0x2ad494['options']['include']?_[_0x1ffc('0x21')](_0x2ad494[_0x1ffc('0x1f')][_0x1ffc('0x22')],function(_0x38be78){return{'model':db[_0x38be78[_0x1ffc('0x23')]],'as':_0x38be78['as'],'attributes':_0x38be78['attributes'],'include':_0x38be78['include']?_['map'](_0x38be78[_0x1ffc('0x22')],function(_0x665bf4){return{'model':db[_0x665bf4[_0x1ffc('0x23')]],'as':_0x665bf4['as'],'attributes':_0x665bf4[_0x1ffc('0x24')],'include':_0x665bf4['include']?_[_0x1ffc('0x21')](_0x665bf4[_0x1ffc('0x22')],function(_0x11ee04){return{'model':db[_0x11ee04[_0x1ffc('0x23')]],'as':_0x11ee04['as'],'attributes':_0x11ee04['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ffc('0x25')](function(_0x9ddf03){logger[_0x1ffc('0x11')](_0x1ffc('0x1c'),_0x2ad494);logger[_0x1ffc('0x14')](_0x1ffc('0x1c'),_0x2ad494,JSON[_0x1ffc('0x16')](_0x9ddf03));_0x59db0a(_0x9ddf03);})['catch'](function(_0x10e40f){logger[_0x1ffc('0x17')](_0x1ffc('0x1c'),_0x10e40f[_0x1ffc('0x19')],_0x2ad494);_0x30d8fd(_0x1ea0c1[_0x1ffc('0x17')](0x1f4,_0x10e40f[_0x1ffc('0x19')]));});});};exports[_0x1ffc('0x26')]=function(_0x3a4305){var _0x26bc39=this;return new Promise(function(_0x358db6,_0x4a60f0){return db[_0x1ffc('0x1d')][_0x1ffc('0x27')]({'raw':_0x3a4305[_0x1ffc('0x1f')]?_0x3a4305[_0x1ffc('0x1f')][_0x1ffc('0x28')]===undefined?!![]:![]:!![],'where':_0x3a4305['options']?_0x3a4305[_0x1ffc('0x1f')][_0x1ffc('0x20')]||null:null,'attributes':_0x3a4305['options']?_0x3a4305['options'][_0x1ffc('0x24')]||null:null,'include':_0x3a4305['options']?_0x3a4305[_0x1ffc('0x1f')]['include']?_['map'](_0x3a4305[_0x1ffc('0x1f')]['include'],function(_0x2c72ea){return{'model':db[_0x2c72ea[_0x1ffc('0x23')]],'as':_0x2c72ea['as'],'attributes':_0x2c72ea[_0x1ffc('0x24')],'include':_0x2c72ea['include']?_[_0x1ffc('0x21')](_0x2c72ea[_0x1ffc('0x22')],function(_0x59dad8){return{'model':db[_0x59dad8[_0x1ffc('0x23')]],'as':_0x59dad8['as'],'attributes':_0x59dad8[_0x1ffc('0x24')],'include':_0x59dad8[_0x1ffc('0x22')]?_[_0x1ffc('0x21')](_0x59dad8[_0x1ffc('0x22')],function(_0x105b3c){return{'model':db[_0x105b3c[_0x1ffc('0x23')]],'as':_0x105b3c['as'],'attributes':_0x105b3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ffc('0x25')](function(_0x58c3a8){logger[_0x1ffc('0x11')](_0x1ffc('0x26'),_0x3a4305);logger[_0x1ffc('0x14')]('ShowSmsQueue',_0x3a4305,JSON[_0x1ffc('0x16')](_0x58c3a8));_0x358db6(_0x58c3a8);})[_0x1ffc('0x1b')](function(_0x32ad0e){logger[_0x1ffc('0x17')]('ShowSmsQueue',_0x32ad0e[_0x1ffc('0x19')],_0x3a4305);_0x4a60f0(_0x26bc39[_0x1ffc('0x17')](0x1f4,_0x32ad0e[_0x1ffc('0x19')]));});});};
\ No newline at end of file
+var _0x73bd=['map','model','catch','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include'];(function(_0x4fabbe,_0xc514f3){var _0x5510dd=function(_0x1e7d23){while(--_0x1e7d23){_0x4fabbe['push'](_0x4fabbe['shift']());}};_0x5510dd(++_0xc514f3);}(_0x73bd,0x181));var _0xd73b=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x73bd[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xd73b('0x0'));var util=require(_0xd73b('0x1'));var moment=require(_0xd73b('0x2'));var BPromise=require(_0xd73b('0x3'));var rs=require(_0xd73b('0x4'));var fs=require('fs');var Redis=require(_0xd73b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd73b('0x6'))(_0xd73b('0x7'));var config=require(_0xd73b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd73b('0x9')][_0xd73b('0xa')]({'port':0x232a});config[_0xd73b('0xb')]=_[_0xd73b('0xc')](config[_0xd73b('0xb')],{'host':_0xd73b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd73b('0xb')]));require('./smsQueue.socket')[_0xd73b('0xe')](socket);function respondWithRpcPromise(_0x25f290,_0x141925,_0x453eb7){return new BPromise(function(_0x1d3743,_0x3ed151){return client['request'](_0x25f290,_0x453eb7)[_0xd73b('0xf')](function(_0x547bc2){logger[_0xd73b('0x10')](_0xd73b('0x11'),_0x141925,_0xd73b('0x12'));logger[_0xd73b('0x13')](_0xd73b('0x14'),_0x141925,_0xd73b('0x12'),JSON[_0xd73b('0x15')](_0x547bc2));if(_0x547bc2[_0xd73b('0x16')]){if(_0x547bc2[_0xd73b('0x16')]['code']===0x1f4){logger[_0xd73b('0x16')](_0xd73b('0x11'),_0x141925,_0x547bc2[_0xd73b('0x16')][_0xd73b('0x17')]);return _0x3ed151(_0x547bc2[_0xd73b('0x16')][_0xd73b('0x17')]);}logger[_0xd73b('0x16')]('SmsQueue,\x20%s,\x20%s',_0x141925,_0x547bc2['error'][_0xd73b('0x17')]);return _0x1d3743(_0x547bc2['error'][_0xd73b('0x17')]);}else{logger[_0xd73b('0x10')](_0xd73b('0x11'),_0x141925,_0xd73b('0x12'));_0x1d3743(_0x547bc2[_0xd73b('0x18')][_0xd73b('0x17')]);}})['catch'](function(_0x23268e){logger[_0xd73b('0x16')](_0xd73b('0x11'),_0x141925,_0x23268e);_0x3ed151(_0x23268e);});});}exports[_0xd73b('0x19')]=function(_0x455333){var _0x2be2e4=this;return new Promise(function(_0x354c52,_0x334955){return db[_0xd73b('0x1a')]['findAll']({'raw':_0x455333['options']?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1c')]===undefined?!![]:![]:!![],'where':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1d')]||null:null,'attributes':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x1e')]||null:null,'limit':_0x455333[_0xd73b('0x1b')]?_0x455333['options'][_0xd73b('0x1f')]||null:null,'include':_0x455333[_0xd73b('0x1b')]?_0x455333[_0xd73b('0x1b')][_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x455333['options']['include'],function(_0x3f0fcc){return{'model':db[_0x3f0fcc[_0xd73b('0x22')]],'as':_0x3f0fcc['as'],'attributes':_0x3f0fcc[_0xd73b('0x1e')],'include':_0x3f0fcc[_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x3f0fcc[_0xd73b('0x20')],function(_0xede853){return{'model':db[_0xede853[_0xd73b('0x22')]],'as':_0xede853['as'],'attributes':_0xede853[_0xd73b('0x1e')],'include':_0xede853[_0xd73b('0x20')]?_['map'](_0xede853[_0xd73b('0x20')],function(_0x3ddc13){return{'model':db[_0x3ddc13[_0xd73b('0x22')]],'as':_0x3ddc13['as'],'attributes':_0x3ddc13[_0xd73b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd73b('0xf')](function(_0x384da4){logger[_0xd73b('0x10')](_0xd73b('0x19'),_0x455333);logger['debug'](_0xd73b('0x19'),_0x455333,JSON[_0xd73b('0x15')](_0x384da4));_0x354c52(_0x384da4);})[_0xd73b('0x23')](function(_0x101321){logger['error']('GetSmsQueue',_0x101321[_0xd73b('0x17')],_0x455333);_0x334955(_0x2be2e4[_0xd73b('0x16')](0x1f4,_0x101321[_0xd73b('0x17')]));});});};exports['ShowSmsQueue']=function(_0x53c180){var _0x5efbef=this;return new Promise(function(_0x47e67f,_0xd340e6){return db[_0xd73b('0x1a')][_0xd73b('0x24')]({'raw':_0x53c180['options']?_0x53c180['options'][_0xd73b('0x1c')]===undefined?!![]:![]:!![],'where':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x1d')]||null:null,'attributes':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x1e')]||null:null,'include':_0x53c180[_0xd73b('0x1b')]?_0x53c180[_0xd73b('0x1b')][_0xd73b('0x20')]?_['map'](_0x53c180[_0xd73b('0x1b')][_0xd73b('0x20')],function(_0x3be61f){return{'model':db[_0x3be61f[_0xd73b('0x22')]],'as':_0x3be61f['as'],'attributes':_0x3be61f[_0xd73b('0x1e')],'include':_0x3be61f[_0xd73b('0x20')]?_[_0xd73b('0x21')](_0x3be61f[_0xd73b('0x20')],function(_0x503690){return{'model':db[_0x503690[_0xd73b('0x22')]],'as':_0x503690['as'],'attributes':_0x503690['attributes'],'include':_0x503690[_0xd73b('0x20')]?_['map'](_0x503690['include'],function(_0x4af7cb){return{'model':db[_0x4af7cb['model']],'as':_0x4af7cb['as'],'attributes':_0x4af7cb['attributes']};}):[]};}):[]};}):[]:[]})[_0xd73b('0xf')](function(_0x35b360){logger[_0xd73b('0x10')]('ShowSmsQueue',_0x53c180);logger['debug'](_0xd73b('0x25'),_0x53c180,JSON[_0xd73b('0x15')](_0x35b360));_0x47e67f(_0x35b360);})['catch'](function(_0xff2230){logger[_0xd73b('0x16')]('ShowSmsQueue',_0xff2230['message'],_0x53c180);_0xd340e6(_0x5efbef[_0xd73b('0x16')](0x1f4,_0xff2230[_0xd73b('0x17')]));});});};
\ No newline at end of file