Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 360d518..abf338a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1baa=['limit','include','map','model','then','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1baa,0x81));var _0xa1ba=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x1baa[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xa1ba('0x0'));var util=require(_0xa1ba('0x1'));var moment=require(_0xa1ba('0x2'));var BPromise=require(_0xa1ba('0x3'));var rs=require(_0xa1ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1ba('0x5'))['db'];var utils=require(_0xa1ba('0x6'));var logger=require(_0xa1ba('0x7'))(_0xa1ba('0x8'));var config=require(_0xa1ba('0x9'));var jayson=require(_0xa1ba('0xa'));var client=jayson[_0xa1ba('0xb')][_0xa1ba('0xc')]({'port':0x232a});config['redis']=_[_0xa1ba('0xd')](config[_0xa1ba('0xe')],{'host':_0xa1ba('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1ba('0xe')]));require(_0xa1ba('0x10'))[_0xa1ba('0x11')](socket);function respondWithRpcPromise(_0x52f8a2,_0x4d8bd8,_0x249c5f){return new BPromise(function(_0x3805be,_0x410fb0){return client[_0xa1ba('0x12')](_0x52f8a2,_0x249c5f)['then'](function(_0x50ffd7){logger[_0xa1ba('0x13')](_0xa1ba('0x14'),_0x4d8bd8,'request\x20sent');logger[_0xa1ba('0x15')](_0xa1ba('0x16'),_0x4d8bd8,_0xa1ba('0x17'),JSON[_0xa1ba('0x18')](_0x50ffd7));if(_0x50ffd7[_0xa1ba('0x19')]){if(_0x50ffd7[_0xa1ba('0x19')]['code']===0x1f4){logger[_0xa1ba('0x19')](_0xa1ba('0x14'),_0x4d8bd8,_0x50ffd7[_0xa1ba('0x19')][_0xa1ba('0x1a')]);return _0x410fb0(_0x50ffd7['error'][_0xa1ba('0x1a')]);}logger[_0xa1ba('0x19')]('SmsQueue,\x20%s,\x20%s',_0x4d8bd8,_0x50ffd7['error'][_0xa1ba('0x1a')]);return _0x3805be(_0x50ffd7['error']['message']);}else{logger['info'](_0xa1ba('0x14'),_0x4d8bd8,'request\x20sent');_0x3805be(_0x50ffd7['result']['message']);}})[_0xa1ba('0x1b')](function(_0x4f6b46){logger[_0xa1ba('0x19')](_0xa1ba('0x14'),_0x4d8bd8,_0x4f6b46);_0x410fb0(_0x4f6b46);});});}exports[_0xa1ba('0x1c')]=function(_0x4cc236){var _0x6d5775=this;return new Promise(function(_0x255f2c,_0x4aae78){return db[_0xa1ba('0x1d')][_0xa1ba('0x1e')]({'raw':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x20')]===undefined?!![]:![]:!![],'where':_0x4cc236[_0xa1ba('0x1f')]?_0x4cc236['options'][_0xa1ba('0x21')]||null:null,'attributes':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x22')]||null:null,'limit':_0x4cc236[_0xa1ba('0x1f')]?_0x4cc236['options'][_0xa1ba('0x23')]||null:null,'include':_0x4cc236['options']?_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x4cc236[_0xa1ba('0x1f')][_0xa1ba('0x24')],function(_0xe31b3b){return{'model':db[_0xe31b3b[_0xa1ba('0x26')]],'as':_0xe31b3b['as'],'attributes':_0xe31b3b[_0xa1ba('0x22')],'include':_0xe31b3b[_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0xe31b3b['include'],function(_0x44470b){return{'model':db[_0x44470b[_0xa1ba('0x26')]],'as':_0x44470b['as'],'attributes':_0x44470b[_0xa1ba('0x22')],'include':_0x44470b[_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x44470b['include'],function(_0x462c96){return{'model':db[_0x462c96[_0xa1ba('0x26')]],'as':_0x462c96['as'],'attributes':_0x462c96[_0xa1ba('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa1ba('0x27')](function(_0x15e1f5){logger[_0xa1ba('0x13')](_0xa1ba('0x1c'),_0x4cc236);logger[_0xa1ba('0x15')]('GetSmsQueue',_0x4cc236,JSON['stringify'](_0x15e1f5));_0x255f2c(_0x15e1f5);})[_0xa1ba('0x1b')](function(_0x47343c){logger[_0xa1ba('0x19')]('GetSmsQueue',_0x47343c[_0xa1ba('0x1a')],_0x4cc236);_0x4aae78(_0x6d5775[_0xa1ba('0x19')](0x1f4,_0x47343c[_0xa1ba('0x1a')]));});});};exports[_0xa1ba('0x28')]=function(_0x7c7740){var _0x2e4900=this;return new Promise(function(_0x5f5afd,_0x304779){return db['SmsQueue']['find']({'raw':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740[_0xa1ba('0x1f')][_0xa1ba('0x20')]===undefined?!![]:![]:!![],'where':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740['options'][_0xa1ba('0x21')]||null:null,'attributes':_0x7c7740[_0xa1ba('0x1f')]?_0x7c7740[_0xa1ba('0x1f')]['attributes']||null:null,'include':_0x7c7740['options']?_0x7c7740['options'][_0xa1ba('0x24')]?_[_0xa1ba('0x25')](_0x7c7740['options'][_0xa1ba('0x24')],function(_0x10abf2){return{'model':db[_0x10abf2[_0xa1ba('0x26')]],'as':_0x10abf2['as'],'attributes':_0x10abf2[_0xa1ba('0x22')],'include':_0x10abf2[_0xa1ba('0x24')]?_['map'](_0x10abf2[_0xa1ba('0x24')],function(_0x307ff0){return{'model':db[_0x307ff0[_0xa1ba('0x26')]],'as':_0x307ff0['as'],'attributes':_0x307ff0['attributes'],'include':_0x307ff0['include']?_[_0xa1ba('0x25')](_0x307ff0['include'],function(_0x5cd03f){return{'model':db[_0x5cd03f[_0xa1ba('0x26')]],'as':_0x5cd03f['as'],'attributes':_0x5cd03f[_0xa1ba('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8af7d7){logger[_0xa1ba('0x13')](_0xa1ba('0x28'),_0x7c7740);logger[_0xa1ba('0x15')](_0xa1ba('0x28'),_0x7c7740,JSON[_0xa1ba('0x18')](_0x8af7d7));_0x5f5afd(_0x8af7d7);})[_0xa1ba('0x1b')](function(_0x3ab3c9){logger[_0xa1ba('0x19')](_0xa1ba('0x28'),_0x3ab3c9[_0xa1ba('0x1a')],_0x7c7740);_0x304779(_0x2e4900[_0xa1ba('0x19')](0x1f4,_0x3ab3c9[_0xa1ba('0x1a')]));});});};
\ No newline at end of file
+var _0x9c68=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','where','limit','include','model','attributes','map','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x9c68,0x76));var _0x89c6=function(_0x16659e,_0x65638d){_0x16659e=_0x16659e-0x0;var _0x331ebb=_0x9c68[_0x16659e];return _0x331ebb;};'use strict';var _=require(_0x89c6('0x0'));var util=require(_0x89c6('0x1'));var moment=require(_0x89c6('0x2'));var BPromise=require(_0x89c6('0x3'));var rs=require(_0x89c6('0x4'));var fs=require('fs');var Redis=require(_0x89c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x89c6('0x6'));var logger=require(_0x89c6('0x7'))('rpc');var config=require(_0x89c6('0x8'));var jayson=require(_0x89c6('0x9'));var client=jayson[_0x89c6('0xa')]['http']({'port':0x232a});config['redis']=_[_0x89c6('0xb')](config[_0x89c6('0xc')],{'host':_0x89c6('0xd'),'port':0x18eb});var socket=require(_0x89c6('0xe'))(new Redis(config[_0x89c6('0xc')]));require(_0x89c6('0xf'))[_0x89c6('0x10')](socket);function respondWithRpcPromise(_0x258e18,_0x5d7bff,_0x105ee2){return new BPromise(function(_0x49d51c,_0x2bdbe6){return client['request'](_0x258e18,_0x105ee2)[_0x89c6('0x11')](function(_0x265892){logger[_0x89c6('0x12')](_0x89c6('0x13'),_0x5d7bff,_0x89c6('0x14'));logger[_0x89c6('0x15')](_0x89c6('0x16'),_0x5d7bff,_0x89c6('0x14'),JSON[_0x89c6('0x17')](_0x265892));if(_0x265892[_0x89c6('0x18')]){if(_0x265892[_0x89c6('0x18')][_0x89c6('0x19')]===0x1f4){logger['error'](_0x89c6('0x13'),_0x5d7bff,_0x265892[_0x89c6('0x18')][_0x89c6('0x1a')]);return _0x2bdbe6(_0x265892[_0x89c6('0x18')][_0x89c6('0x1a')]);}logger[_0x89c6('0x18')](_0x89c6('0x13'),_0x5d7bff,_0x265892['error'][_0x89c6('0x1a')]);return _0x49d51c(_0x265892[_0x89c6('0x18')][_0x89c6('0x1a')]);}else{logger[_0x89c6('0x12')](_0x89c6('0x13'),_0x5d7bff,_0x89c6('0x14'));_0x49d51c(_0x265892[_0x89c6('0x1b')]['message']);}})[_0x89c6('0x1c')](function(_0x2c5f74){logger[_0x89c6('0x18')](_0x89c6('0x13'),_0x5d7bff,_0x2c5f74);_0x2bdbe6(_0x2c5f74);});});}exports[_0x89c6('0x1d')]=function(_0x639eb2){var _0xf0d6f2=this;return new Promise(function(_0x39f927,_0x4ffeb9){return db[_0x89c6('0x1e')]['findAll']({'raw':_0x639eb2[_0x89c6('0x1f')]?_0x639eb2[_0x89c6('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x639eb2['options']?_0x639eb2[_0x89c6('0x1f')][_0x89c6('0x20')]||null:null,'attributes':_0x639eb2[_0x89c6('0x1f')]?_0x639eb2['options']['attributes']||null:null,'limit':_0x639eb2['options']?_0x639eb2[_0x89c6('0x1f')][_0x89c6('0x21')]||null:null,'include':_0x639eb2['options']?_0x639eb2['options'][_0x89c6('0x22')]?_['map'](_0x639eb2[_0x89c6('0x1f')]['include'],function(_0x41190c){return{'model':db[_0x41190c[_0x89c6('0x23')]],'as':_0x41190c['as'],'attributes':_0x41190c[_0x89c6('0x24')],'include':_0x41190c[_0x89c6('0x22')]?_[_0x89c6('0x25')](_0x41190c['include'],function(_0x39567c){return{'model':db[_0x39567c[_0x89c6('0x23')]],'as':_0x39567c['as'],'attributes':_0x39567c[_0x89c6('0x24')],'include':_0x39567c['include']?_['map'](_0x39567c[_0x89c6('0x22')],function(_0x399062){return{'model':db[_0x399062[_0x89c6('0x23')]],'as':_0x399062['as'],'attributes':_0x399062[_0x89c6('0x24')]};}):[]};}):[]};}):[]:[]})[_0x89c6('0x11')](function(_0x23d07a){logger[_0x89c6('0x12')](_0x89c6('0x1d'),_0x639eb2);logger[_0x89c6('0x15')](_0x89c6('0x1d'),_0x639eb2,JSON[_0x89c6('0x17')](_0x23d07a));_0x39f927(_0x23d07a);})[_0x89c6('0x1c')](function(_0x4db6b5){logger[_0x89c6('0x18')]('GetSmsQueue',_0x4db6b5[_0x89c6('0x1a')],_0x639eb2);_0x4ffeb9(_0xf0d6f2['error'](0x1f4,_0x4db6b5[_0x89c6('0x1a')]));});});};exports[_0x89c6('0x26')]=function(_0x3e4622){var _0x28095e=this;return new Promise(function(_0x5e9b94,_0x51b7ec){return db[_0x89c6('0x1e')][_0x89c6('0x27')]({'raw':_0x3e4622[_0x89c6('0x1f')]?_0x3e4622[_0x89c6('0x1f')][_0x89c6('0x28')]===undefined?!![]:![]:!![],'where':_0x3e4622[_0x89c6('0x1f')]?_0x3e4622['options'][_0x89c6('0x20')]||null:null,'attributes':_0x3e4622[_0x89c6('0x1f')]?_0x3e4622['options']['attributes']||null:null,'include':_0x3e4622[_0x89c6('0x1f')]?_0x3e4622[_0x89c6('0x1f')][_0x89c6('0x22')]?_[_0x89c6('0x25')](_0x3e4622[_0x89c6('0x1f')][_0x89c6('0x22')],function(_0x1876e2){return{'model':db[_0x1876e2[_0x89c6('0x23')]],'as':_0x1876e2['as'],'attributes':_0x1876e2[_0x89c6('0x24')],'include':_0x1876e2['include']?_['map'](_0x1876e2[_0x89c6('0x22')],function(_0x30f8bc){return{'model':db[_0x30f8bc[_0x89c6('0x23')]],'as':_0x30f8bc['as'],'attributes':_0x30f8bc['attributes'],'include':_0x30f8bc[_0x89c6('0x22')]?_[_0x89c6('0x25')](_0x30f8bc[_0x89c6('0x22')],function(_0x26e906){return{'model':db[_0x26e906[_0x89c6('0x23')]],'as':_0x26e906['as'],'attributes':_0x26e906['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x220bf6){logger['info']('ShowSmsQueue',_0x3e4622);logger[_0x89c6('0x15')]('ShowSmsQueue',_0x3e4622,JSON['stringify'](_0x220bf6));_0x5e9b94(_0x220bf6);})[_0x89c6('0x1c')](function(_0x554813){logger[_0x89c6('0x18')]('ShowSmsQueue',_0x554813[_0x89c6('0x1a')],_0x3e4622);_0x51b7ec(_0x28095e['error'](0x1f4,_0x554813['message']));});});};
\ No newline at end of file