Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 4b838e8..b9b4d62 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 _0x5aab=['http','redis','defaults','register','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowSmsQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x548f68,_0x2db63e){var _0x1adf80=function(_0x5b08e6){while(--_0x5b08e6){_0x548f68['push'](_0x548f68['shift']());}};_0x1adf80(++_0x2db63e);}(_0x5aab,0x154));var _0xb5aa=function(_0x11c7bc,_0x5a7b4c){_0x11c7bc=_0x11c7bc-0x0;var _0x1289df=_0x5aab[_0x11c7bc];return _0x1289df;};'use strict';var _=require(_0xb5aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb5aa('0x1'));var rs=require(_0xb5aa('0x2'));var fs=require('fs');var Redis=require(_0xb5aa('0x3'));var db=require(_0xb5aa('0x4'))['db'];var utils=require(_0xb5aa('0x5'));var logger=require(_0xb5aa('0x6'))(_0xb5aa('0x7'));var config=require(_0xb5aa('0x8'));var jayson=require(_0xb5aa('0x9'));var client=jayson[_0xb5aa('0xa')][_0xb5aa('0xb')]({'port':0x232a});config[_0xb5aa('0xc')]=_[_0xb5aa('0xd')](config[_0xb5aa('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5aa('0xc')]));require('./smsQueue.socket')[_0xb5aa('0xe')](socket);function respondWithRpcPromise(_0xf768c2,_0x2091d5,_0xf33f7b){return new BPromise(function(_0x3ce25c,_0x206b28){return client['request'](_0xf768c2,_0xf33f7b)['then'](function(_0x6ca673){logger['info']('SmsQueue,\x20%s,\x20%s',_0x2091d5,_0xb5aa('0xf'));logger[_0xb5aa('0x10')](_0xb5aa('0x11'),_0x2091d5,_0xb5aa('0xf'),JSON[_0xb5aa('0x12')](_0x6ca673));if(_0x6ca673[_0xb5aa('0x13')]){if(_0x6ca673['error'][_0xb5aa('0x14')]===0x1f4){logger[_0xb5aa('0x13')](_0xb5aa('0x15'),_0x2091d5,_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);return _0x206b28(_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);}logger[_0xb5aa('0x13')](_0xb5aa('0x15'),_0x2091d5,_0x6ca673[_0xb5aa('0x13')][_0xb5aa('0x16')]);return _0x3ce25c(_0x6ca673['error'][_0xb5aa('0x16')]);}else{logger[_0xb5aa('0x17')](_0xb5aa('0x15'),_0x2091d5,_0xb5aa('0xf'));_0x3ce25c(_0x6ca673['result'][_0xb5aa('0x16')]);}})[_0xb5aa('0x18')](function(_0x324d51){logger['error'](_0xb5aa('0x15'),_0x2091d5,_0x324d51);_0x206b28(_0x324d51);});});}exports[_0xb5aa('0x19')]=function(_0x178c37){var _0x4b0696=this;return new Promise(function(_0x3dd0d5,_0x1ec3f0){return db[_0xb5aa('0x1a')][_0xb5aa('0x1b')]({'raw':_0x178c37['options']?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x178c37['options']?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1e')]||null:null,'attributes':_0x178c37['options']?_0x178c37['options']['attributes']||null:null,'limit':_0x178c37[_0xb5aa('0x1c')]?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x1f')]||null:null,'include':_0x178c37[_0xb5aa('0x1c')]?_0x178c37[_0xb5aa('0x1c')][_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x178c37['options'][_0xb5aa('0x20')],function(_0xf0ffb4){return{'model':db[_0xf0ffb4[_0xb5aa('0x22')]],'as':_0xf0ffb4['as'],'attributes':_0xf0ffb4[_0xb5aa('0x23')],'include':_0xf0ffb4[_0xb5aa('0x20')]?_['map'](_0xf0ffb4[_0xb5aa('0x20')],function(_0x127148){return{'model':db[_0x127148[_0xb5aa('0x22')]],'as':_0x127148['as'],'attributes':_0x127148[_0xb5aa('0x23')],'include':_0x127148[_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x127148[_0xb5aa('0x20')],function(_0x35388c){return{'model':db[_0x35388c[_0xb5aa('0x22')]],'as':_0x35388c['as'],'attributes':_0x35388c['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5aa('0x24')](function(_0x4b0db9){logger[_0xb5aa('0x17')](_0xb5aa('0x19'),_0x178c37);logger[_0xb5aa('0x10')](_0xb5aa('0x19'),_0x178c37,JSON['stringify'](_0x4b0db9));_0x3dd0d5(_0x4b0db9);})[_0xb5aa('0x18')](function(_0x1e4bad){logger[_0xb5aa('0x13')](_0xb5aa('0x19'),_0x1e4bad['message'],_0x178c37);_0x1ec3f0(_0x4b0696[_0xb5aa('0x13')](0x1f4,_0x1e4bad['message']));});});};exports[_0xb5aa('0x25')]=function(_0x3ecb9d){var _0x3136a3=this;return new Promise(function(_0x2d0823,_0xf3bdc3){return db['SmsQueue'][_0xb5aa('0x26')]({'raw':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d['options'][_0xb5aa('0x1e')]||null:null,'attributes':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x23')]||null:null,'include':_0x3ecb9d[_0xb5aa('0x1c')]?_0x3ecb9d['options'][_0xb5aa('0x20')]?_[_0xb5aa('0x21')](_0x3ecb9d[_0xb5aa('0x1c')][_0xb5aa('0x20')],function(_0xfe5594){return{'model':db[_0xfe5594[_0xb5aa('0x22')]],'as':_0xfe5594['as'],'attributes':_0xfe5594[_0xb5aa('0x23')],'include':_0xfe5594['include']?_['map'](_0xfe5594[_0xb5aa('0x20')],function(_0x33cbe0){return{'model':db[_0x33cbe0[_0xb5aa('0x22')]],'as':_0x33cbe0['as'],'attributes':_0x33cbe0['attributes'],'include':_0x33cbe0['include']?_[_0xb5aa('0x21')](_0x33cbe0[_0xb5aa('0x20')],function(_0x1d9d21){return{'model':db[_0x1d9d21[_0xb5aa('0x22')]],'as':_0x1d9d21['as'],'attributes':_0x1d9d21[_0xb5aa('0x23')]};}):[]};}):[]};}):[]:[]})[_0xb5aa('0x24')](function(_0x306dc4){logger[_0xb5aa('0x17')](_0xb5aa('0x25'),_0x3ecb9d);logger[_0xb5aa('0x10')](_0xb5aa('0x25'),_0x3ecb9d,JSON[_0xb5aa('0x12')](_0x306dc4));_0x2d0823(_0x306dc4);})[_0xb5aa('0x18')](function(_0x42f387){logger[_0xb5aa('0x13')](_0xb5aa('0x25'),_0x42f387[_0xb5aa('0x16')],_0x3ecb9d);_0xf3bdc3(_0x3136a3[_0xb5aa('0x13')](0x1f4,_0x42f387[_0xb5aa('0x16')]));});});};
\ No newline at end of file