Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / userNotification / userNotification.rpc.js
index ebe51ef..97f34d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40a0=['redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5cb7f7,_0x5ae698){var _0x531b17=function(_0x103d28){while(--_0x103d28){_0x5cb7f7['push'](_0x5cb7f7['shift']());}};_0x531b17(++_0x5ae698);}(_0x40a0,0xf0));var _0x040a=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0x40a0[_0x22c684];return _0x39fcbb;};'use strict';var _=require(_0x040a('0x0'));var util=require(_0x040a('0x1'));var moment=require('moment');var BPromise=require(_0x040a('0x2'));var rs=require(_0x040a('0x3'));var fs=require('fs');var Redis=require(_0x040a('0x4'));var db=require(_0x040a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x040a('0x6'))(_0x040a('0x7'));var config=require(_0x040a('0x8'));var jayson=require(_0x040a('0x9'));var client=jayson[_0x040a('0xa')][_0x040a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x040a('0xc')],{'host':_0x040a('0xd'),'port':0x18eb});var socket=require(_0x040a('0xe'))(new Redis(config[_0x040a('0xc')]));require(_0x040a('0xf'))[_0x040a('0x10')](socket);function respondWithRpcPromise(_0x38d152,_0x5da86c,_0x2b8183){return new BPromise(function(_0x3ed1d4,_0x4da5a9){return client[_0x040a('0x11')](_0x38d152,_0x2b8183)[_0x040a('0x12')](function(_0x47cec0){logger[_0x040a('0x13')](_0x040a('0x14'),_0x5da86c,_0x040a('0x15'));logger[_0x040a('0x16')](_0x040a('0x17'),_0x5da86c,'request\x20sent',JSON[_0x040a('0x18')](_0x47cec0));if(_0x47cec0[_0x040a('0x19')]){if(_0x47cec0[_0x040a('0x19')]['code']===0x1f4){logger[_0x040a('0x19')](_0x040a('0x14'),_0x5da86c,_0x47cec0[_0x040a('0x19')][_0x040a('0x1a')]);return _0x4da5a9(_0x47cec0['error']['message']);}logger[_0x040a('0x19')](_0x040a('0x14'),_0x5da86c,_0x47cec0['error'][_0x040a('0x1a')]);return _0x3ed1d4(_0x47cec0[_0x040a('0x19')][_0x040a('0x1a')]);}else{logger['info'](_0x040a('0x14'),_0x5da86c,_0x040a('0x15'));_0x3ed1d4(_0x47cec0[_0x040a('0x1b')][_0x040a('0x1a')]);}})['catch'](function(_0x2caac0){logger[_0x040a('0x19')](_0x040a('0x14'),_0x5da86c,_0x2caac0);_0x4da5a9(_0x2caac0);});});}
\ No newline at end of file
+var _0xef08=['then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','error','UserNotification,\x20%s,\x20%s','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','request'];(function(_0x5184d1,_0x12d323){var _0x1a8857=function(_0x31b75c){while(--_0x31b75c){_0x5184d1['push'](_0x5184d1['shift']());}};_0x1a8857(++_0x12d323);}(_0xef08,0x104));var _0x8ef0=function(_0x55fe92,_0x1dfe8d){_0x55fe92=_0x55fe92-0x0;var _0x2bfae6=_0xef08[_0x55fe92];return _0x2bfae6;};'use strict';var _=require(_0x8ef0('0x0'));var util=require(_0x8ef0('0x1'));var moment=require(_0x8ef0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ef0('0x3'))['db'];var utils=require(_0x8ef0('0x4'));var logger=require(_0x8ef0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8ef0('0x6')][_0x8ef0('0x7')]({'port':0x232a});config[_0x8ef0('0x8')]=_['defaults'](config['redis'],{'host':_0x8ef0('0x9'),'port':0x18eb});var socket=require(_0x8ef0('0xa'))(new Redis(config[_0x8ef0('0x8')]));require(_0x8ef0('0xb'))['register'](socket);function respondWithRpcPromise(_0xfb0073,_0x4914c6,_0x36cc66){return new BPromise(function(_0x48cb0e,_0x175355){return client[_0x8ef0('0xc')](_0xfb0073,_0x36cc66)[_0x8ef0('0xd')](function(_0x8d86bf){logger[_0x8ef0('0xe')]('UserNotification,\x20%s,\x20%s',_0x4914c6,_0x8ef0('0xf'));logger['debug'](_0x8ef0('0x10'),_0x4914c6,_0x8ef0('0xf'),JSON['stringify'](_0x8d86bf));if(_0x8d86bf[_0x8ef0('0x11')]){if(_0x8d86bf[_0x8ef0('0x11')]['code']===0x1f4){logger[_0x8ef0('0x11')](_0x8ef0('0x12'),_0x4914c6,_0x8d86bf[_0x8ef0('0x11')][_0x8ef0('0x13')]);return _0x175355(_0x8d86bf[_0x8ef0('0x11')][_0x8ef0('0x13')]);}logger[_0x8ef0('0x11')](_0x8ef0('0x12'),_0x4914c6,_0x8d86bf[_0x8ef0('0x11')][_0x8ef0('0x13')]);return _0x48cb0e(_0x8d86bf[_0x8ef0('0x11')][_0x8ef0('0x13')]);}else{logger[_0x8ef0('0xe')](_0x8ef0('0x12'),_0x4914c6,_0x8ef0('0xf'));_0x48cb0e(_0x8d86bf['result']['message']);}})[_0x8ef0('0x14')](function(_0x2bcb1f){logger[_0x8ef0('0x11')]('UserNotification,\x20%s,\x20%s',_0x4914c6,_0x2bcb1f);_0x175355(_0x2bcb1f);});});}
\ No newline at end of file