Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / pause / pause.rpc.js
index ede020f..e41e4d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f97=['debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowPause','find','options','raw','where','attributes','include','model','map','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x8f97,0x13e));var _0x78f9=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x8f97[_0x46a3ff];return _0x404bc2;};'use strict';var _=require('lodash');var util=require(_0x78f9('0x0'));var moment=require(_0x78f9('0x1'));var BPromise=require(_0x78f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78f9('0x3'))['db'];var utils=require(_0x78f9('0x4'));var logger=require(_0x78f9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x78f9('0x6'));var client=jayson['client'][_0x78f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14317d,_0x2616b5,_0x497724){return new BPromise(function(_0xf9946,_0x526bb){return client[_0x78f9('0x8')](_0x14317d,_0x497724)[_0x78f9('0x9')](function(_0x14e916){logger[_0x78f9('0xa')](_0x78f9('0xb'),_0x2616b5,'request\x20sent');logger[_0x78f9('0xc')](_0x78f9('0xd'),_0x2616b5,_0x78f9('0xe'),JSON[_0x78f9('0xf')](_0x14e916));if(_0x14e916['error']){if(_0x14e916[_0x78f9('0x10')][_0x78f9('0x11')]===0x1f4){logger[_0x78f9('0x10')](_0x78f9('0xb'),_0x2616b5,_0x14e916['error'][_0x78f9('0x12')]);return _0x526bb(_0x14e916[_0x78f9('0x10')][_0x78f9('0x12')]);}logger['error'](_0x78f9('0xb'),_0x2616b5,_0x14e916[_0x78f9('0x10')][_0x78f9('0x12')]);return _0xf9946(_0x14e916['error'][_0x78f9('0x12')]);}else{logger['info'](_0x78f9('0xb'),_0x2616b5,_0x78f9('0xe'));_0xf9946(_0x14e916[_0x78f9('0x13')][_0x78f9('0x12')]);}})[_0x78f9('0x14')](function(_0x4f81ec){logger[_0x78f9('0x10')](_0x78f9('0xb'),_0x2616b5,_0x4f81ec);_0x526bb(_0x4f81ec);});});}exports[_0x78f9('0x15')]=function(_0x209f2f){var _0x7388bd=this;return new Promise(function(_0x534d6c,_0x7f5b7b){return db['Pause'][_0x78f9('0x16')]({'raw':_0x209f2f[_0x78f9('0x17')]?_0x209f2f[_0x78f9('0x17')][_0x78f9('0x18')]===undefined?!![]:![]:!![],'where':_0x209f2f[_0x78f9('0x17')]?_0x209f2f['options'][_0x78f9('0x19')]||null:null,'attributes':_0x209f2f['options']?_0x209f2f[_0x78f9('0x17')][_0x78f9('0x1a')]||null:null,'include':_0x209f2f[_0x78f9('0x17')]?_0x209f2f[_0x78f9('0x17')][_0x78f9('0x1b')]?_['map'](_0x209f2f[_0x78f9('0x17')]['include'],function(_0x3afbe8){return{'model':db[_0x3afbe8['model']],'as':_0x3afbe8['as'],'attributes':_0x3afbe8[_0x78f9('0x1a')],'include':_0x3afbe8[_0x78f9('0x1b')]?_['map'](_0x3afbe8[_0x78f9('0x1b')],function(_0x2426a2){return{'model':db[_0x2426a2[_0x78f9('0x1c')]],'as':_0x2426a2['as'],'attributes':_0x2426a2[_0x78f9('0x1a')],'include':_0x2426a2[_0x78f9('0x1b')]?_[_0x78f9('0x1d')](_0x2426a2[_0x78f9('0x1b')],function(_0x5dd0fc){return{'model':db[_0x5dd0fc[_0x78f9('0x1c')]],'as':_0x5dd0fc['as'],'attributes':_0x5dd0fc[_0x78f9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x78f9('0x9')](function(_0x332414){logger[_0x78f9('0xa')]('ShowPause',_0x209f2f);logger[_0x78f9('0xc')](_0x78f9('0x15'),_0x209f2f,JSON[_0x78f9('0xf')](_0x332414));_0x534d6c(_0x332414);})[_0x78f9('0x14')](function(_0x1153d5){logger[_0x78f9('0x10')](_0x78f9('0x15'),_0x1153d5[_0x78f9('0x12')],_0x209f2f);_0x7f5b7b(_0x7388bd[_0x78f9('0x10')](0x1f4,_0x1153d5[_0x78f9('0x12')]));});});};
\ No newline at end of file
+var _0xb6b1=['options','raw','where','attributes','include','map','model','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','Pause,\x20%s,\x20%s','message','info','result','catch','ShowPause','Pause','find'];(function(_0x4de003,_0x1677e9){var _0x2875b9=function(_0x686fda){while(--_0x686fda){_0x4de003['push'](_0x4de003['shift']());}};_0x2875b9(++_0x1677e9);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0xb6b1[_0x4d8dc3];return _0x9b03d9;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Pause,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});}exports[_0x1b6b('0x15')]=function(_0x2e608b){var _0x59e671=this;return new Promise(function(_0x923711,_0x15d44b){return db[_0x1b6b('0x16')][_0x1b6b('0x17')]({'raw':_0x2e608b[_0x1b6b('0x18')]?_0x2e608b[_0x1b6b('0x18')][_0x1b6b('0x19')]===undefined?!![]:![]:!![],'where':_0x2e608b[_0x1b6b('0x18')]?_0x2e608b[_0x1b6b('0x18')][_0x1b6b('0x1a')]||null:null,'attributes':_0x2e608b['options']?_0x2e608b[_0x1b6b('0x18')][_0x1b6b('0x1b')]||null:null,'include':_0x2e608b[_0x1b6b('0x18')]?_0x2e608b[_0x1b6b('0x18')][_0x1b6b('0x1c')]?_[_0x1b6b('0x1d')](_0x2e608b[_0x1b6b('0x18')][_0x1b6b('0x1c')],function(_0x22f0b7){return{'model':db[_0x22f0b7['model']],'as':_0x22f0b7['as'],'attributes':_0x22f0b7[_0x1b6b('0x1b')],'include':_0x22f0b7['include']?_['map'](_0x22f0b7['include'],function(_0x11449b){return{'model':db[_0x11449b[_0x1b6b('0x1e')]],'as':_0x11449b['as'],'attributes':_0x11449b['attributes'],'include':_0x11449b[_0x1b6b('0x1c')]?_['map'](_0x11449b[_0x1b6b('0x1c')],function(_0x440658){return{'model':db[_0x440658[_0x1b6b('0x1e')]],'as':_0x440658['as'],'attributes':_0x440658[_0x1b6b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1b6b('0xa')](function(_0x2aa755){logger['info'](_0x1b6b('0x15'),_0x2e608b);logger[_0x1b6b('0xc')](_0x1b6b('0x15'),_0x2e608b,JSON[_0x1b6b('0xe')](_0x2aa755));_0x923711(_0x2aa755);})['catch'](function(_0x23dac4){logger['error']('ShowPause',_0x23dac4[_0x1b6b('0x11')],_0x2e608b);_0x15d44b(_0x59e671['error'](0x1f4,_0x23dac4[_0x1b6b('0x11')]));});});};
\ No newline at end of file