Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index b0480e8..905bebb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6f3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','stringify','find','ShowSmsQueue','debug','lodash'];(function(_0x48fa5f,_0x4d980f){var _0x2ed0c9=function(_0x475d2d){while(--_0x475d2d){_0x48fa5f['push'](_0x48fa5f['shift']());}};_0x2ed0c9(++_0x4d980f);}(_0xc6f3,0x1c7));var _0x3c6f=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0xc6f3[_0x592cbc];return _0x39b8d9;};'use strict';var _=require(_0x3c6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c6f('0x1'));var rs=require(_0x3c6f('0x2'));var fs=require('fs');var Redis=require(_0x3c6f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c6f('0x4'));var logger=require(_0x3c6f('0x5'))(_0x3c6f('0x6'));var config=require(_0x3c6f('0x7'));var jayson=require(_0x3c6f('0x8'));var client=jayson[_0x3c6f('0x9')][_0x3c6f('0xa')]({'port':0x232a});config[_0x3c6f('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c6f('0xb')]));require(_0x3c6f('0xc'))['register'](socket);function respondWithRpcPromise(_0x43fcdd,_0x2040e5,_0x3c9546){return new BPromise(function(_0x31db6b,_0x2100f7){return client[_0x3c6f('0xd')](_0x43fcdd,_0x3c9546)[_0x3c6f('0xe')](function(_0x517cfe){logger[_0x3c6f('0xf')](_0x3c6f('0x10'),_0x2040e5,_0x3c6f('0x11'));logger['debug'](_0x3c6f('0x12'),_0x2040e5,'request\x20sent',JSON['stringify'](_0x517cfe));if(_0x517cfe['error']){if(_0x517cfe[_0x3c6f('0x13')][_0x3c6f('0x14')]===0x1f4){logger[_0x3c6f('0x13')](_0x3c6f('0x10'),_0x2040e5,_0x517cfe[_0x3c6f('0x13')][_0x3c6f('0x15')]);return _0x2100f7(_0x517cfe[_0x3c6f('0x13')][_0x3c6f('0x15')]);}logger[_0x3c6f('0x13')](_0x3c6f('0x10'),_0x2040e5,_0x517cfe[_0x3c6f('0x13')][_0x3c6f('0x15')]);return _0x31db6b(_0x517cfe[_0x3c6f('0x13')][_0x3c6f('0x15')]);}else{logger[_0x3c6f('0xf')](_0x3c6f('0x10'),_0x2040e5,_0x3c6f('0x11'));_0x31db6b(_0x517cfe[_0x3c6f('0x16')]['message']);}})[_0x3c6f('0x17')](function(_0xd5791){logger[_0x3c6f('0x13')](_0x3c6f('0x10'),_0x2040e5,_0xd5791);_0x2100f7(_0xd5791);});});}exports[_0x3c6f('0x18')]=function(_0x55348f){var _0x5a7834=this;return new Promise(function(_0x124ab7,_0x5648e9){return db[_0x3c6f('0x19')][_0x3c6f('0x1a')]({'raw':_0x55348f[_0x3c6f('0x1b')]?_0x55348f[_0x3c6f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x55348f[_0x3c6f('0x1b')]?_0x55348f['options'][_0x3c6f('0x1c')]||null:null,'attributes':_0x55348f[_0x3c6f('0x1b')]?_0x55348f[_0x3c6f('0x1b')][_0x3c6f('0x1d')]||null:null,'limit':_0x55348f[_0x3c6f('0x1b')]?_0x55348f['options'][_0x3c6f('0x1e')]||null:null,'include':_0x55348f['options']?_0x55348f[_0x3c6f('0x1b')][_0x3c6f('0x1f')]?_[_0x3c6f('0x20')](_0x55348f[_0x3c6f('0x1b')][_0x3c6f('0x1f')],function(_0x36570f){return{'model':db[_0x36570f['model']],'as':_0x36570f['as'],'attributes':_0x36570f[_0x3c6f('0x1d')],'include':_0x36570f[_0x3c6f('0x1f')]?_[_0x3c6f('0x20')](_0x36570f[_0x3c6f('0x1f')],function(_0x2e95f7){return{'model':db[_0x2e95f7[_0x3c6f('0x21')]],'as':_0x2e95f7['as'],'attributes':_0x2e95f7[_0x3c6f('0x1d')],'include':_0x2e95f7[_0x3c6f('0x1f')]?_[_0x3c6f('0x20')](_0x2e95f7[_0x3c6f('0x1f')],function(_0x57e3a1){return{'model':db[_0x57e3a1[_0x3c6f('0x21')]],'as':_0x57e3a1['as'],'attributes':_0x57e3a1[_0x3c6f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x141d2e){logger[_0x3c6f('0xf')]('GetSmsQueue',_0x55348f);logger['debug'](_0x3c6f('0x18'),_0x55348f,JSON[_0x3c6f('0x22')](_0x141d2e));_0x124ab7(_0x141d2e);})[_0x3c6f('0x17')](function(_0x512f4d){logger[_0x3c6f('0x13')](_0x3c6f('0x18'),_0x512f4d[_0x3c6f('0x15')],_0x55348f);_0x5648e9(_0x5a7834[_0x3c6f('0x13')](0x1f4,_0x512f4d['message']));});});};exports['ShowSmsQueue']=function(_0x7bc6ec){var _0x4a86b1=this;return new Promise(function(_0xe45b8b,_0x381404){return db[_0x3c6f('0x19')][_0x3c6f('0x23')]({'raw':_0x7bc6ec[_0x3c6f('0x1b')]?_0x7bc6ec[_0x3c6f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x7bc6ec[_0x3c6f('0x1b')]?_0x7bc6ec['options'][_0x3c6f('0x1c')]||null:null,'attributes':_0x7bc6ec[_0x3c6f('0x1b')]?_0x7bc6ec[_0x3c6f('0x1b')][_0x3c6f('0x1d')]||null:null,'include':_0x7bc6ec[_0x3c6f('0x1b')]?_0x7bc6ec[_0x3c6f('0x1b')][_0x3c6f('0x1f')]?_[_0x3c6f('0x20')](_0x7bc6ec[_0x3c6f('0x1b')][_0x3c6f('0x1f')],function(_0x9dc7f){return{'model':db[_0x9dc7f[_0x3c6f('0x21')]],'as':_0x9dc7f['as'],'attributes':_0x9dc7f[_0x3c6f('0x1d')],'include':_0x9dc7f['include']?_[_0x3c6f('0x20')](_0x9dc7f[_0x3c6f('0x1f')],function(_0x2e3557){return{'model':db[_0x2e3557['model']],'as':_0x2e3557['as'],'attributes':_0x2e3557[_0x3c6f('0x1d')],'include':_0x2e3557[_0x3c6f('0x1f')]?_[_0x3c6f('0x20')](_0x2e3557[_0x3c6f('0x1f')],function(_0x500de1){return{'model':db[_0x500de1[_0x3c6f('0x21')]],'as':_0x500de1['as'],'attributes':_0x500de1[_0x3c6f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3c6f('0xe')](function(_0x26d0b7){logger[_0x3c6f('0xf')](_0x3c6f('0x24'),_0x7bc6ec);logger[_0x3c6f('0x25')](_0x3c6f('0x24'),_0x7bc6ec,JSON[_0x3c6f('0x22')](_0x26d0b7));_0xe45b8b(_0x26d0b7);})[_0x3c6f('0x17')](function(_0x3d79b6){logger[_0x3c6f('0x13')](_0x3c6f('0x24'),_0x3d79b6['message'],_0x7bc6ec);_0x381404(_0x4a86b1[_0x3c6f('0x13')](0x1f4,_0x3d79b6[_0x3c6f('0x15')]));});});};
\ No newline at end of file
+var _0x270f=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowSmsQueue','find','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x270f,0x119));var _0xf270=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x270f[_0x2d126e];return _0xcb04d3;};'use strict';var _=require('lodash');var util=require(_0xf270('0x0'));var moment=require('moment');var BPromise=require(_0xf270('0x1'));var rs=require(_0xf270('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf270('0x3'));var logger=require(_0xf270('0x4'))(_0xf270('0x5'));var config=require(_0xf270('0x6'));var jayson=require(_0xf270('0x7'));var client=jayson[_0xf270('0x8')][_0xf270('0x9')]({'port':0x232a});config[_0xf270('0xa')]=_[_0xf270('0xb')](config[_0xf270('0xa')],{'host':_0xf270('0xc'),'port':0x18eb});var socket=require(_0xf270('0xd'))(new Redis(config[_0xf270('0xa')]));require(_0xf270('0xe'))['register'](socket);function respondWithRpcPromise(_0x161b70,_0x378450,_0x16e6aa){return new BPromise(function(_0x572447,_0x146984){return client['request'](_0x161b70,_0x16e6aa)[_0xf270('0xf')](function(_0x4d199a){logger[_0xf270('0x10')](_0xf270('0x11'),_0x378450,'request\x20sent');logger[_0xf270('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x378450,_0xf270('0x13'),JSON['stringify'](_0x4d199a));if(_0x4d199a[_0xf270('0x14')]){if(_0x4d199a[_0xf270('0x14')]['code']===0x1f4){logger[_0xf270('0x14')]('SmsQueue,\x20%s,\x20%s',_0x378450,_0x4d199a[_0xf270('0x14')]['message']);return _0x146984(_0x4d199a[_0xf270('0x14')][_0xf270('0x15')]);}logger[_0xf270('0x14')]('SmsQueue,\x20%s,\x20%s',_0x378450,_0x4d199a[_0xf270('0x14')][_0xf270('0x15')]);return _0x572447(_0x4d199a[_0xf270('0x14')][_0xf270('0x15')]);}else{logger[_0xf270('0x10')](_0xf270('0x11'),_0x378450,_0xf270('0x13'));_0x572447(_0x4d199a['result'][_0xf270('0x15')]);}})[_0xf270('0x16')](function(_0x4bfd76){logger[_0xf270('0x14')](_0xf270('0x11'),_0x378450,_0x4bfd76);_0x146984(_0x4bfd76);});});}exports[_0xf270('0x17')]=function(_0x5b1791){var _0x48fb2c=this;return new Promise(function(_0x4622e2,_0x10778a){return db['SmsQueue'][_0xf270('0x18')]({'raw':_0x5b1791[_0xf270('0x19')]?_0x5b1791[_0xf270('0x19')][_0xf270('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b1791[_0xf270('0x19')]?_0x5b1791[_0xf270('0x19')][_0xf270('0x1b')]||null:null,'attributes':_0x5b1791['options']?_0x5b1791['options'][_0xf270('0x1c')]||null:null,'limit':_0x5b1791[_0xf270('0x19')]?_0x5b1791[_0xf270('0x19')][_0xf270('0x1d')]||null:null,'include':_0x5b1791[_0xf270('0x19')]?_0x5b1791[_0xf270('0x19')][_0xf270('0x1e')]?_[_0xf270('0x1f')](_0x5b1791['options'][_0xf270('0x1e')],function(_0x5d8f6d){return{'model':db[_0x5d8f6d['model']],'as':_0x5d8f6d['as'],'attributes':_0x5d8f6d[_0xf270('0x1c')],'include':_0x5d8f6d[_0xf270('0x1e')]?_[_0xf270('0x1f')](_0x5d8f6d[_0xf270('0x1e')],function(_0x44ac9f){return{'model':db[_0x44ac9f[_0xf270('0x20')]],'as':_0x44ac9f['as'],'attributes':_0x44ac9f['attributes'],'include':_0x44ac9f[_0xf270('0x1e')]?_[_0xf270('0x1f')](_0x44ac9f['include'],function(_0x4ffc7b){return{'model':db[_0x4ffc7b['model']],'as':_0x4ffc7b['as'],'attributes':_0x4ffc7b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cc52f){logger['info'](_0xf270('0x17'),_0x5b1791);logger['debug'](_0xf270('0x17'),_0x5b1791,JSON[_0xf270('0x21')](_0x4cc52f));_0x4622e2(_0x4cc52f);})[_0xf270('0x16')](function(_0x3618e9){logger[_0xf270('0x14')](_0xf270('0x17'),_0x3618e9[_0xf270('0x15')],_0x5b1791);_0x10778a(_0x48fb2c[_0xf270('0x14')](0x1f4,_0x3618e9['message']));});});};exports[_0xf270('0x22')]=function(_0x4ee05c){var _0x2f17ab=this;return new Promise(function(_0x487ad5,_0x2429b4){return db['SmsQueue'][_0xf270('0x23')]({'raw':_0x4ee05c[_0xf270('0x19')]?_0x4ee05c[_0xf270('0x19')][_0xf270('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ee05c[_0xf270('0x19')]?_0x4ee05c['options']['where']||null:null,'attributes':_0x4ee05c[_0xf270('0x19')]?_0x4ee05c[_0xf270('0x19')][_0xf270('0x1c')]||null:null,'include':_0x4ee05c[_0xf270('0x19')]?_0x4ee05c['options']['include']?_[_0xf270('0x1f')](_0x4ee05c['options']['include'],function(_0x5628ff){return{'model':db[_0x5628ff[_0xf270('0x20')]],'as':_0x5628ff['as'],'attributes':_0x5628ff['attributes'],'include':_0x5628ff['include']?_[_0xf270('0x1f')](_0x5628ff[_0xf270('0x1e')],function(_0x2398c0){return{'model':db[_0x2398c0[_0xf270('0x20')]],'as':_0x2398c0['as'],'attributes':_0x2398c0[_0xf270('0x1c')],'include':_0x2398c0[_0xf270('0x1e')]?_['map'](_0x2398c0[_0xf270('0x1e')],function(_0x218d26){return{'model':db[_0x218d26[_0xf270('0x20')]],'as':_0x218d26['as'],'attributes':_0x218d26[_0xf270('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf270('0xf')](function(_0xaf2b9a){logger[_0xf270('0x10')](_0xf270('0x22'),_0x4ee05c);logger[_0xf270('0x12')](_0xf270('0x22'),_0x4ee05c,JSON['stringify'](_0xaf2b9a));_0x487ad5(_0xaf2b9a);})[_0xf270('0x16')](function(_0x4110e3){logger[_0xf270('0x14')](_0xf270('0x22'),_0x4110e3[_0xf270('0x15')],_0x4ee05c);_0x2429b4(_0x2f17ab[_0xf270('0x14')](0x1f4,_0x4110e3['message']));});});};
\ No newline at end of file