Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 6e427da..830163f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8411=['bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','GetSmsQueue','findAll','options','raw','where','limit','include','attributes','map','SmsQueue','find','model','then','ShowSmsQueue','util'];(function(_0x38d9a9,_0x9afda6){var _0x2e4214=function(_0x51c54e){while(--_0x51c54e){_0x38d9a9['push'](_0x38d9a9['shift']());}};_0x2e4214(++_0x9afda6);}(_0x8411,0x185));var _0x1841=function(_0x4a47f4,_0x3a3961){_0x4a47f4=_0x4a47f4-0x0;var _0x5753a3=_0x8411[_0x4a47f4];return _0x5753a3;};'use strict';var _=require('lodash');var util=require(_0x1841('0x0'));var moment=require('moment');var BPromise=require(_0x1841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1841('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1841('0x3'));var logger=require('../../config/logger')(_0x1841('0x4'));var config=require('../../config/environment');var jayson=require(_0x1841('0x5'));var client=jayson[_0x1841('0x6')][_0x1841('0x7')]({'port':0x232a});config[_0x1841('0x8')]=_[_0x1841('0x9')](config[_0x1841('0x8')],{'host':_0x1841('0xa'),'port':0x18eb});var socket=require(_0x1841('0xb'))(new Redis(config[_0x1841('0x8')]));require(_0x1841('0xc'))[_0x1841('0xd')](socket);function respondWithRpcPromise(_0x568bf3,_0x979d79,_0x576fb9){return new BPromise(function(_0xe03a49,_0x5ca162){return client[_0x1841('0xe')](_0x568bf3,_0x576fb9)['then'](function(_0x183160){logger['info'](_0x1841('0xf'),_0x979d79,_0x1841('0x10'));logger[_0x1841('0x11')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x979d79,_0x1841('0x10'),JSON[_0x1841('0x12')](_0x183160));if(_0x183160['error']){if(_0x183160['error'][_0x1841('0x13')]===0x1f4){logger[_0x1841('0x14')](_0x1841('0xf'),_0x979d79,_0x183160[_0x1841('0x14')][_0x1841('0x15')]);return _0x5ca162(_0x183160[_0x1841('0x14')][_0x1841('0x15')]);}logger[_0x1841('0x14')](_0x1841('0xf'),_0x979d79,_0x183160['error']['message']);return _0xe03a49(_0x183160[_0x1841('0x14')]['message']);}else{logger[_0x1841('0x16')](_0x1841('0xf'),_0x979d79,_0x1841('0x10'));_0xe03a49(_0x183160[_0x1841('0x17')][_0x1841('0x15')]);}})[_0x1841('0x18')](function(_0x1ffb0d){logger['error'](_0x1841('0xf'),_0x979d79,_0x1ffb0d);_0x5ca162(_0x1ffb0d);});});}exports[_0x1841('0x19')]=function(_0x2f54c4){var _0x4a8570=this;return new Promise(function(_0x18a1e3,_0x4b7d09){return db['SmsQueue'][_0x1841('0x1a')]({'raw':_0x2f54c4[_0x1841('0x1b')]?_0x2f54c4[_0x1841('0x1b')][_0x1841('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f54c4['options']?_0x2f54c4[_0x1841('0x1b')][_0x1841('0x1d')]||null:null,'attributes':_0x2f54c4['options']?_0x2f54c4[_0x1841('0x1b')]['attributes']||null:null,'limit':_0x2f54c4['options']?_0x2f54c4[_0x1841('0x1b')][_0x1841('0x1e')]||null:null,'include':_0x2f54c4[_0x1841('0x1b')]?_0x2f54c4[_0x1841('0x1b')][_0x1841('0x1f')]?_['map'](_0x2f54c4[_0x1841('0x1b')][_0x1841('0x1f')],function(_0x4f5089){return{'model':db[_0x4f5089['model']],'as':_0x4f5089['as'],'attributes':_0x4f5089[_0x1841('0x20')],'include':_0x4f5089[_0x1841('0x1f')]?_[_0x1841('0x21')](_0x4f5089[_0x1841('0x1f')],function(_0x43beeb){return{'model':db[_0x43beeb['model']],'as':_0x43beeb['as'],'attributes':_0x43beeb[_0x1841('0x20')],'include':_0x43beeb[_0x1841('0x1f')]?_[_0x1841('0x21')](_0x43beeb[_0x1841('0x1f')],function(_0x32e5f4){return{'model':db[_0x32e5f4['model']],'as':_0x32e5f4['as'],'attributes':_0x32e5f4[_0x1841('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ee844){logger[_0x1841('0x16')]('GetSmsQueue',_0x2f54c4);logger[_0x1841('0x11')](_0x1841('0x19'),_0x2f54c4,JSON[_0x1841('0x12')](_0x4ee844));_0x18a1e3(_0x4ee844);})[_0x1841('0x18')](function(_0x30e0b5){logger['error']('GetSmsQueue',_0x30e0b5['message'],_0x2f54c4);_0x4b7d09(_0x4a8570[_0x1841('0x14')](0x1f4,_0x30e0b5[_0x1841('0x15')]));});});};exports['ShowSmsQueue']=function(_0x5933c7){var _0x13c6bb=this;return new Promise(function(_0x465791,_0x2be1e5){return db[_0x1841('0x22')][_0x1841('0x23')]({'raw':_0x5933c7[_0x1841('0x1b')]?_0x5933c7['options'][_0x1841('0x1c')]===undefined?!![]:![]:!![],'where':_0x5933c7[_0x1841('0x1b')]?_0x5933c7['options']['where']||null:null,'attributes':_0x5933c7['options']?_0x5933c7[_0x1841('0x1b')][_0x1841('0x20')]||null:null,'include':_0x5933c7[_0x1841('0x1b')]?_0x5933c7[_0x1841('0x1b')][_0x1841('0x1f')]?_[_0x1841('0x21')](_0x5933c7[_0x1841('0x1b')][_0x1841('0x1f')],function(_0xd8aebd){return{'model':db[_0xd8aebd['model']],'as':_0xd8aebd['as'],'attributes':_0xd8aebd[_0x1841('0x20')],'include':_0xd8aebd['include']?_[_0x1841('0x21')](_0xd8aebd[_0x1841('0x1f')],function(_0x462f71){return{'model':db[_0x462f71[_0x1841('0x24')]],'as':_0x462f71['as'],'attributes':_0x462f71[_0x1841('0x20')],'include':_0x462f71[_0x1841('0x1f')]?_[_0x1841('0x21')](_0x462f71[_0x1841('0x1f')],function(_0x2b5683){return{'model':db[_0x2b5683[_0x1841('0x24')]],'as':_0x2b5683['as'],'attributes':_0x2b5683[_0x1841('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1841('0x25')](function(_0x2d0235){logger[_0x1841('0x16')](_0x1841('0x26'),_0x5933c7);logger[_0x1841('0x11')]('ShowSmsQueue',_0x5933c7,JSON[_0x1841('0x12')](_0x2d0235));_0x465791(_0x2d0235);})[_0x1841('0x18')](function(_0x366f8b){logger[_0x1841('0x14')](_0x1841('0x26'),_0x366f8b[_0x1841('0x15')],_0x5933c7);_0x2be1e5(_0x13c6bb[_0x1841('0x14')](0x1f4,_0x366f8b[_0x1841('0x15')]));});});};
\ No newline at end of file
+var _0xc255=['limit','include','map','model','GetSmsQueue','debug','catch','ShowSmsQueue','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','SmsQueue','options','raw','where','attributes'];(function(_0x425cc4,_0x50053e){var _0x56d05a=function(_0x37d75e){while(--_0x37d75e){_0x425cc4['push'](_0x425cc4['shift']());}};_0x56d05a(++_0x50053e);}(_0xc255,0x155));var _0x5c25=function(_0x32d788,_0xbaa65e){_0x32d788=_0x32d788-0x0;var _0x1b671a=_0xc255[_0x32d788];return _0x1b671a;};'use strict';var _=require(_0x5c25('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5c25('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c25('0x2'));var db=require(_0x5c25('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5c25('0x4'));var config=require(_0x5c25('0x5'));var jayson=require(_0x5c25('0x6'));var client=jayson[_0x5c25('0x7')][_0x5c25('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5c25('0x9')],{'host':_0x5c25('0xa'),'port':0x18eb});var socket=require(_0x5c25('0xb'))(new Redis(config[_0x5c25('0x9')]));require(_0x5c25('0xc'))[_0x5c25('0xd')](socket);function respondWithRpcPromise(_0x3094c4,_0x2faedc,_0x5cd6cc){return new BPromise(function(_0x1c7aae,_0x300c23){return client[_0x5c25('0xe')](_0x3094c4,_0x5cd6cc)[_0x5c25('0xf')](function(_0xdc92d5){logger['info'](_0x5c25('0x10'),_0x2faedc,_0x5c25('0x11'));logger['debug'](_0x5c25('0x12'),_0x2faedc,_0x5c25('0x11'),JSON[_0x5c25('0x13')](_0xdc92d5));if(_0xdc92d5[_0x5c25('0x14')]){if(_0xdc92d5[_0x5c25('0x14')]['code']===0x1f4){logger[_0x5c25('0x14')](_0x5c25('0x10'),_0x2faedc,_0xdc92d5['error'][_0x5c25('0x15')]);return _0x300c23(_0xdc92d5['error']['message']);}logger[_0x5c25('0x14')](_0x5c25('0x10'),_0x2faedc,_0xdc92d5[_0x5c25('0x14')]['message']);return _0x1c7aae(_0xdc92d5[_0x5c25('0x14')][_0x5c25('0x15')]);}else{logger[_0x5c25('0x16')]('SmsQueue,\x20%s,\x20%s',_0x2faedc,_0x5c25('0x11'));_0x1c7aae(_0xdc92d5[_0x5c25('0x17')][_0x5c25('0x15')]);}})['catch'](function(_0x3163ff){logger['error'](_0x5c25('0x10'),_0x2faedc,_0x3163ff);_0x300c23(_0x3163ff);});});}exports['GetSmsQueue']=function(_0x304a53){var _0x56d70b=this;return new Promise(function(_0x2decd3,_0x2bcd80){return db[_0x5c25('0x18')]['findAll']({'raw':_0x304a53['options']?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x304a53[_0x5c25('0x19')]?_0x304a53['options'][_0x5c25('0x1b')]||null:null,'attributes':_0x304a53['options']?_0x304a53['options'][_0x5c25('0x1c')]||null:null,'limit':_0x304a53['options']?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1d')]||null:null,'include':_0x304a53[_0x5c25('0x19')]?_0x304a53[_0x5c25('0x19')][_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0x304a53['options']['include'],function(_0x36107c){return{'model':db[_0x36107c[_0x5c25('0x20')]],'as':_0x36107c['as'],'attributes':_0x36107c[_0x5c25('0x1c')],'include':_0x36107c['include']?_[_0x5c25('0x1f')](_0x36107c[_0x5c25('0x1e')],function(_0xe9fb76){return{'model':db[_0xe9fb76[_0x5c25('0x20')]],'as':_0xe9fb76['as'],'attributes':_0xe9fb76[_0x5c25('0x1c')],'include':_0xe9fb76[_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0xe9fb76['include'],function(_0x45bf8c){return{'model':db[_0x45bf8c['model']],'as':_0x45bf8c['as'],'attributes':_0x45bf8c[_0x5c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x531221){logger[_0x5c25('0x16')](_0x5c25('0x21'),_0x304a53);logger[_0x5c25('0x22')](_0x5c25('0x21'),_0x304a53,JSON[_0x5c25('0x13')](_0x531221));_0x2decd3(_0x531221);})[_0x5c25('0x23')](function(_0x587c28){logger[_0x5c25('0x14')](_0x5c25('0x21'),_0x587c28[_0x5c25('0x15')],_0x304a53);_0x2bcd80(_0x56d70b[_0x5c25('0x14')](0x1f4,_0x587c28[_0x5c25('0x15')]));});});};exports[_0x5c25('0x24')]=function(_0x336fe3){var _0x188e2d=this;return new Promise(function(_0x1639cc,_0x279298){return db[_0x5c25('0x18')]['find']({'raw':_0x336fe3[_0x5c25('0x19')]?_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1a')]===undefined?!![]:![]:!![],'where':_0x336fe3['options']?_0x336fe3['options'][_0x5c25('0x1b')]||null:null,'attributes':_0x336fe3[_0x5c25('0x19')]?_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1c')]||null:null,'include':_0x336fe3[_0x5c25('0x19')]?_0x336fe3['options']['include']?_[_0x5c25('0x1f')](_0x336fe3[_0x5c25('0x19')][_0x5c25('0x1e')],function(_0x1e9e8a){return{'model':db[_0x1e9e8a[_0x5c25('0x20')]],'as':_0x1e9e8a['as'],'attributes':_0x1e9e8a[_0x5c25('0x1c')],'include':_0x1e9e8a[_0x5c25('0x1e')]?_[_0x5c25('0x1f')](_0x1e9e8a[_0x5c25('0x1e')],function(_0x11965b){return{'model':db[_0x11965b[_0x5c25('0x20')]],'as':_0x11965b['as'],'attributes':_0x11965b['attributes'],'include':_0x11965b[_0x5c25('0x1e')]?_['map'](_0x11965b['include'],function(_0x5b254f){return{'model':db[_0x5b254f['model']],'as':_0x5b254f['as'],'attributes':_0x5b254f[_0x5c25('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4dcb21){logger[_0x5c25('0x16')](_0x5c25('0x24'),_0x336fe3);logger[_0x5c25('0x22')]('ShowSmsQueue',_0x336fe3,JSON['stringify'](_0x4dcb21));_0x1639cc(_0x4dcb21);})[_0x5c25('0x23')](function(_0x5524bd){logger['error'](_0x5c25('0x24'),_0x5524bd[_0x5c25('0x15')],_0x336fe3);_0x279298(_0x188e2d['error'](0x1f4,_0x5524bd[_0x5c25('0x15')]));});});};
\ No newline at end of file