Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 4b838e8..915505e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x301f=['code','message','result','GetSmsQueue','SmsQueue','findAll','raw','options','where','attributes','limit','map','include','then','catch','ShowSmsQueue','find','model','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x301f,0xda));var _0xf301=function(_0x61b230,_0x19721b){_0x61b230=_0x61b230-0x0;var _0x484d5e=_0x301f[_0x61b230];return _0x484d5e;};'use strict';var _=require(_0xf301('0x0'));var util=require(_0xf301('0x1'));var moment=require('moment');var BPromise=require(_0xf301('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf301('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf301('0x4'));var logger=require(_0xf301('0x5'))(_0xf301('0x6'));var config=require(_0xf301('0x7'));var jayson=require(_0xf301('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xf301('0x9')]=_[_0xf301('0xa')](config[_0xf301('0x9')],{'host':_0xf301('0xb'),'port':0x18eb});var socket=require(_0xf301('0xc'))(new Redis(config['redis']));require(_0xf301('0xd'))[_0xf301('0xe')](socket);function respondWithRpcPromise(_0x31dfd4,_0x36e3f0,_0x2e8b50){return new BPromise(function(_0x1996fd,_0x3e71d1){return client[_0xf301('0xf')](_0x31dfd4,_0x2e8b50)['then'](function(_0x553f9d){logger[_0xf301('0x10')](_0xf301('0x11'),_0x36e3f0,'request\x20sent');logger[_0xf301('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x36e3f0,_0xf301('0x13'),JSON[_0xf301('0x14')](_0x553f9d));if(_0x553f9d[_0xf301('0x15')]){if(_0x553f9d[_0xf301('0x15')][_0xf301('0x16')]===0x1f4){logger[_0xf301('0x15')]('SmsQueue,\x20%s,\x20%s',_0x36e3f0,_0x553f9d['error'][_0xf301('0x17')]);return _0x3e71d1(_0x553f9d[_0xf301('0x15')][_0xf301('0x17')]);}logger[_0xf301('0x15')](_0xf301('0x11'),_0x36e3f0,_0x553f9d[_0xf301('0x15')]['message']);return _0x1996fd(_0x553f9d[_0xf301('0x15')]['message']);}else{logger[_0xf301('0x10')](_0xf301('0x11'),_0x36e3f0,_0xf301('0x13'));_0x1996fd(_0x553f9d[_0xf301('0x18')]['message']);}})['catch'](function(_0x1447ed){logger[_0xf301('0x15')](_0xf301('0x11'),_0x36e3f0,_0x1447ed);_0x3e71d1(_0x1447ed);});});}exports[_0xf301('0x19')]=function(_0x5b5884){var _0x421c4e=this;return new Promise(function(_0x48b648,_0x5047fe){return db[_0xf301('0x1a')][_0xf301('0x1b')]({'raw':_0x5b5884['options']?_0x5b5884['options'][_0xf301('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b5884[_0xf301('0x1d')]?_0x5b5884[_0xf301('0x1d')][_0xf301('0x1e')]||null:null,'attributes':_0x5b5884[_0xf301('0x1d')]?_0x5b5884[_0xf301('0x1d')][_0xf301('0x1f')]||null:null,'limit':_0x5b5884[_0xf301('0x1d')]?_0x5b5884[_0xf301('0x1d')][_0xf301('0x20')]||null:null,'include':_0x5b5884[_0xf301('0x1d')]?_0x5b5884[_0xf301('0x1d')]['include']?_[_0xf301('0x21')](_0x5b5884['options']['include'],function(_0x2afa1e){return{'model':db[_0x2afa1e['model']],'as':_0x2afa1e['as'],'attributes':_0x2afa1e[_0xf301('0x1f')],'include':_0x2afa1e[_0xf301('0x22')]?_[_0xf301('0x21')](_0x2afa1e[_0xf301('0x22')],function(_0x58dadf){return{'model':db[_0x58dadf['model']],'as':_0x58dadf['as'],'attributes':_0x58dadf[_0xf301('0x1f')],'include':_0x58dadf[_0xf301('0x22')]?_['map'](_0x58dadf[_0xf301('0x22')],function(_0x3f81dc){return{'model':db[_0x3f81dc['model']],'as':_0x3f81dc['as'],'attributes':_0x3f81dc[_0xf301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf301('0x23')](function(_0x5a7b50){logger[_0xf301('0x10')](_0xf301('0x19'),_0x5b5884);logger[_0xf301('0x12')]('GetSmsQueue',_0x5b5884,JSON[_0xf301('0x14')](_0x5a7b50));_0x48b648(_0x5a7b50);})[_0xf301('0x24')](function(_0x5945e4){logger[_0xf301('0x15')](_0xf301('0x19'),_0x5945e4['message'],_0x5b5884);_0x5047fe(_0x421c4e[_0xf301('0x15')](0x1f4,_0x5945e4[_0xf301('0x17')]));});});};exports[_0xf301('0x25')]=function(_0x9b240d){var _0x36495f=this;return new Promise(function(_0x259749,_0x48766c){return db['SmsQueue'][_0xf301('0x26')]({'raw':_0x9b240d[_0xf301('0x1d')]?_0x9b240d[_0xf301('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x9b240d['options']?_0x9b240d[_0xf301('0x1d')][_0xf301('0x1e')]||null:null,'attributes':_0x9b240d['options']?_0x9b240d['options']['attributes']||null:null,'include':_0x9b240d['options']?_0x9b240d['options'][_0xf301('0x22')]?_[_0xf301('0x21')](_0x9b240d[_0xf301('0x1d')][_0xf301('0x22')],function(_0x34ae7c){return{'model':db[_0x34ae7c[_0xf301('0x27')]],'as':_0x34ae7c['as'],'attributes':_0x34ae7c[_0xf301('0x1f')],'include':_0x34ae7c['include']?_[_0xf301('0x21')](_0x34ae7c[_0xf301('0x22')],function(_0x232f58){return{'model':db[_0x232f58[_0xf301('0x27')]],'as':_0x232f58['as'],'attributes':_0x232f58['attributes'],'include':_0x232f58[_0xf301('0x22')]?_['map'](_0x232f58[_0xf301('0x22')],function(_0x35b66f){return{'model':db[_0x35b66f[_0xf301('0x27')]],'as':_0x35b66f['as'],'attributes':_0x35b66f[_0xf301('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf301('0x23')](function(_0x5947a9){logger[_0xf301('0x10')](_0xf301('0x25'),_0x9b240d);logger[_0xf301('0x12')](_0xf301('0x25'),_0x9b240d,JSON[_0xf301('0x14')](_0x5947a9));_0x259749(_0x5947a9);})['catch'](function(_0x39bf1a){logger[_0xf301('0x15')](_0xf301('0x25'),_0x39bf1a[_0xf301('0x17')],_0x9b240d);_0x48766c(_0x36495f[_0xf301('0x15')](0x1f4,_0x39bf1a[_0xf301('0x17')]));});});};
\ 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