Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / interval / interval.rpc.js
index 13f4d9b..ff077b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60eb=['message','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','map','model','info','debug','ShowInterval','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x37909b,_0xbd548c){var _0x1a949b=function(_0x1bceb8){while(--_0x1bceb8){_0x37909b['push'](_0x37909b['shift']());}};_0x1a949b(++_0xbd548c);}(_0x60eb,0xfd));var _0xb60e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x60eb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb60e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb60e('0x1'));var rs=require(_0xb60e('0x2'));var fs=require('fs');var Redis=require(_0xb60e('0x3'));var db=require(_0xb60e('0x4'))['db'];var utils=require(_0xb60e('0x5'));var logger=require(_0xb60e('0x6'))(_0xb60e('0x7'));var config=require(_0xb60e('0x8'));var jayson=require(_0xb60e('0x9'));var client=jayson[_0xb60e('0xa')][_0xb60e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14fe63,_0x9d3e74,_0x40dac4){return new BPromise(function(_0x4f9d93,_0x428ae0){return client[_0xb60e('0xc')](_0x14fe63,_0x40dac4)[_0xb60e('0xd')](function(_0x80aa7b){logger['info'](_0xb60e('0xe'),_0x9d3e74,_0xb60e('0xf'));logger['debug'](_0xb60e('0x10'),_0x9d3e74,_0xb60e('0xf'),JSON[_0xb60e('0x11')](_0x80aa7b));if(_0x80aa7b[_0xb60e('0x12')]){if(_0x80aa7b[_0xb60e('0x12')]['code']===0x1f4){logger['error'](_0xb60e('0xe'),_0x9d3e74,_0x80aa7b[_0xb60e('0x12')][_0xb60e('0x13')]);return _0x428ae0(_0x80aa7b[_0xb60e('0x12')]['message']);}logger['error'](_0xb60e('0xe'),_0x9d3e74,_0x80aa7b[_0xb60e('0x12')][_0xb60e('0x13')]);return _0x4f9d93(_0x80aa7b[_0xb60e('0x12')][_0xb60e('0x13')]);}else{logger['info']('Interval,\x20%s,\x20%s',_0x9d3e74,_0xb60e('0xf'));_0x4f9d93(_0x80aa7b['result'][_0xb60e('0x13')]);}})['catch'](function(_0x4c60a8){logger[_0xb60e('0x12')](_0xb60e('0xe'),_0x9d3e74,_0x4c60a8);_0x428ae0(_0x4c60a8);});});}exports[_0xb60e('0x14')]=function(_0x1bd566){var _0x1d9d7e=this;return new Promise(function(_0x5781e7,_0x16858f){return db[_0xb60e('0x15')][_0xb60e('0x16')]({'raw':_0x1bd566[_0xb60e('0x17')]?_0x1bd566[_0xb60e('0x17')][_0xb60e('0x18')]===undefined?!![]:![]:!![],'where':_0x1bd566[_0xb60e('0x17')]?_0x1bd566[_0xb60e('0x17')][_0xb60e('0x19')]||null:null,'attributes':_0x1bd566['options']?_0x1bd566[_0xb60e('0x17')][_0xb60e('0x1a')]||null:null,'limit':_0x1bd566['options']?_0x1bd566['options'][_0xb60e('0x1b')]||null:null,'include':_0x1bd566[_0xb60e('0x17')]?_0x1bd566['options'][_0xb60e('0x1c')]?_[_0xb60e('0x1d')](_0x1bd566[_0xb60e('0x17')][_0xb60e('0x1c')],function(_0x26c2fc){return{'model':db[_0x26c2fc['model']],'as':_0x26c2fc['as'],'attributes':_0x26c2fc[_0xb60e('0x1a')],'include':_0x26c2fc['include']?_[_0xb60e('0x1d')](_0x26c2fc[_0xb60e('0x1c')],function(_0xa3a9e3){return{'model':db[_0xa3a9e3[_0xb60e('0x1e')]],'as':_0xa3a9e3['as'],'attributes':_0xa3a9e3[_0xb60e('0x1a')],'include':_0xa3a9e3[_0xb60e('0x1c')]?_[_0xb60e('0x1d')](_0xa3a9e3[_0xb60e('0x1c')],function(_0x166505){return{'model':db[_0x166505['model']],'as':_0x166505['as'],'attributes':_0x166505[_0xb60e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb60e('0xd')](function(_0x4961ff){logger[_0xb60e('0x1f')](_0xb60e('0x14'),_0x1bd566);logger[_0xb60e('0x20')]('GetInterval',_0x1bd566,JSON['stringify'](_0x4961ff));_0x5781e7(_0x4961ff);})['catch'](function(_0x392420){logger[_0xb60e('0x12')](_0xb60e('0x14'),_0x392420[_0xb60e('0x13')],_0x1bd566);_0x16858f(_0x1d9d7e[_0xb60e('0x12')](0x1f4,_0x392420['message']));});});};exports[_0xb60e('0x21')]=function(_0x872447){var _0x2f8eb7=this;return new Promise(function(_0x24c073,_0x4f2c4b){return db[_0xb60e('0x15')]['find']({'raw':_0x872447['options']?_0x872447[_0xb60e('0x17')][_0xb60e('0x18')]===undefined?!![]:![]:!![],'where':_0x872447['options']?_0x872447[_0xb60e('0x17')][_0xb60e('0x19')]||null:null,'attributes':_0x872447[_0xb60e('0x17')]?_0x872447['options'][_0xb60e('0x1a')]||null:null,'include':_0x872447[_0xb60e('0x17')]?_0x872447[_0xb60e('0x17')][_0xb60e('0x1c')]?_['map'](_0x872447['options']['include'],function(_0x206065){return{'model':db[_0x206065['model']],'as':_0x206065['as'],'attributes':_0x206065[_0xb60e('0x1a')],'include':_0x206065['include']?_['map'](_0x206065[_0xb60e('0x1c')],function(_0x30c9d7){return{'model':db[_0x30c9d7[_0xb60e('0x1e')]],'as':_0x30c9d7['as'],'attributes':_0x30c9d7['attributes'],'include':_0x30c9d7[_0xb60e('0x1c')]?_[_0xb60e('0x1d')](_0x30c9d7[_0xb60e('0x1c')],function(_0x1160b2){return{'model':db[_0x1160b2[_0xb60e('0x1e')]],'as':_0x1160b2['as'],'attributes':_0x1160b2[_0xb60e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb60e('0xd')](function(_0x192093){logger[_0xb60e('0x1f')](_0xb60e('0x21'),_0x872447);logger[_0xb60e('0x20')](_0xb60e('0x21'),_0x872447,JSON['stringify'](_0x192093));_0x24c073(_0x192093);})['catch'](function(_0x30d1d8){logger[_0xb60e('0x12')]('ShowInterval',_0x30d1d8[_0xb60e('0x13')],_0x872447);_0x4f2c4b(_0x2f8eb7[_0xb60e('0x12')](0x1f4,_0x30d1d8[_0xb60e('0x13')]));});});};
\ No newline at end of file
+var _0x6a09=['attributes','limit','model','map','include','info','GetInterval','find','ShowInterval','stringify','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Interval','findAll','options','raw','where'];(function(_0x2444be,_0x2c8b1a){var _0x23d85a=function(_0x352906){while(--_0x352906){_0x2444be['push'](_0x2444be['shift']());}};_0x23d85a(++_0x2c8b1a);}(_0x6a09,0x1c4));var _0x96a0=function(_0x8969c2,_0xc524b7){_0x8969c2=_0x8969c2-0x0;var _0x519f23=_0x6a09[_0x8969c2];return _0x519f23;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x96a0('0x0'));var rs=require(_0x96a0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96a0('0x2'))['db'];var utils=require(_0x96a0('0x3'));var logger=require('../../config/logger')(_0x96a0('0x4'));var config=require(_0x96a0('0x5'));var jayson=require(_0x96a0('0x6'));var client=jayson[_0x96a0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bf5ed,_0x1060b9,_0x2ffac6){return new BPromise(function(_0x28be88,_0x312e55){return client[_0x96a0('0x8')](_0x5bf5ed,_0x2ffac6)[_0x96a0('0x9')](function(_0x109e24){logger['info'](_0x96a0('0xa'),_0x1060b9,_0x96a0('0xb'));logger[_0x96a0('0xc')](_0x96a0('0xd'),_0x1060b9,_0x96a0('0xb'),JSON['stringify'](_0x109e24));if(_0x109e24[_0x96a0('0xe')]){if(_0x109e24[_0x96a0('0xe')][_0x96a0('0xf')]===0x1f4){logger['error']('Interval,\x20%s,\x20%s',_0x1060b9,_0x109e24[_0x96a0('0xe')][_0x96a0('0x10')]);return _0x312e55(_0x109e24[_0x96a0('0xe')][_0x96a0('0x10')]);}logger[_0x96a0('0xe')](_0x96a0('0xa'),_0x1060b9,_0x109e24[_0x96a0('0xe')][_0x96a0('0x10')]);return _0x28be88(_0x109e24[_0x96a0('0xe')]['message']);}else{logger['info'](_0x96a0('0xa'),_0x1060b9,_0x96a0('0xb'));_0x28be88(_0x109e24[_0x96a0('0x11')][_0x96a0('0x10')]);}})[_0x96a0('0x12')](function(_0x5685c7){logger[_0x96a0('0xe')](_0x96a0('0xa'),_0x1060b9,_0x5685c7);_0x312e55(_0x5685c7);});});}exports['GetInterval']=function(_0x340016){var _0x28f2de=this;return new Promise(function(_0x1ef882,_0x1f26de){return db[_0x96a0('0x13')][_0x96a0('0x14')]({'raw':_0x340016[_0x96a0('0x15')]?_0x340016[_0x96a0('0x15')][_0x96a0('0x16')]===undefined?!![]:![]:!![],'where':_0x340016[_0x96a0('0x15')]?_0x340016['options'][_0x96a0('0x17')]||null:null,'attributes':_0x340016['options']?_0x340016[_0x96a0('0x15')][_0x96a0('0x18')]||null:null,'limit':_0x340016[_0x96a0('0x15')]?_0x340016[_0x96a0('0x15')][_0x96a0('0x19')]||null:null,'include':_0x340016['options']?_0x340016[_0x96a0('0x15')]['include']?_['map'](_0x340016[_0x96a0('0x15')]['include'],function(_0x53c5bd){return{'model':db[_0x53c5bd[_0x96a0('0x1a')]],'as':_0x53c5bd['as'],'attributes':_0x53c5bd[_0x96a0('0x18')],'include':_0x53c5bd['include']?_[_0x96a0('0x1b')](_0x53c5bd[_0x96a0('0x1c')],function(_0x282edb){return{'model':db[_0x282edb[_0x96a0('0x1a')]],'as':_0x282edb['as'],'attributes':_0x282edb[_0x96a0('0x18')],'include':_0x282edb[_0x96a0('0x1c')]?_[_0x96a0('0x1b')](_0x282edb[_0x96a0('0x1c')],function(_0x2e17bc){return{'model':db[_0x2e17bc[_0x96a0('0x1a')]],'as':_0x2e17bc['as'],'attributes':_0x2e17bc[_0x96a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x96a0('0x9')](function(_0x3de893){logger[_0x96a0('0x1d')](_0x96a0('0x1e'),_0x340016);logger['debug']('GetInterval',_0x340016,JSON['stringify'](_0x3de893));_0x1ef882(_0x3de893);})[_0x96a0('0x12')](function(_0x3c46e8){logger[_0x96a0('0xe')](_0x96a0('0x1e'),_0x3c46e8[_0x96a0('0x10')],_0x340016);_0x1f26de(_0x28f2de[_0x96a0('0xe')](0x1f4,_0x3c46e8[_0x96a0('0x10')]));});});};exports['ShowInterval']=function(_0x4010a2){var _0x101913=this;return new Promise(function(_0x5844c1,_0x43713c){return db[_0x96a0('0x13')][_0x96a0('0x1f')]({'raw':_0x4010a2[_0x96a0('0x15')]?_0x4010a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x4010a2[_0x96a0('0x15')]?_0x4010a2['options'][_0x96a0('0x17')]||null:null,'attributes':_0x4010a2[_0x96a0('0x15')]?_0x4010a2[_0x96a0('0x15')][_0x96a0('0x18')]||null:null,'include':_0x4010a2[_0x96a0('0x15')]?_0x4010a2[_0x96a0('0x15')][_0x96a0('0x1c')]?_[_0x96a0('0x1b')](_0x4010a2[_0x96a0('0x15')][_0x96a0('0x1c')],function(_0x1a9435){return{'model':db[_0x1a9435[_0x96a0('0x1a')]],'as':_0x1a9435['as'],'attributes':_0x1a9435[_0x96a0('0x18')],'include':_0x1a9435[_0x96a0('0x1c')]?_[_0x96a0('0x1b')](_0x1a9435[_0x96a0('0x1c')],function(_0xe22753){return{'model':db[_0xe22753[_0x96a0('0x1a')]],'as':_0xe22753['as'],'attributes':_0xe22753[_0x96a0('0x18')],'include':_0xe22753['include']?_['map'](_0xe22753['include'],function(_0x2380a7){return{'model':db[_0x2380a7[_0x96a0('0x1a')]],'as':_0x2380a7['as'],'attributes':_0x2380a7[_0x96a0('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x165d95){logger[_0x96a0('0x1d')](_0x96a0('0x20'),_0x4010a2);logger['debug'](_0x96a0('0x20'),_0x4010a2,JSON[_0x96a0('0x21')](_0x165d95));_0x5844c1(_0x165d95);})[_0x96a0('0x12')](function(_0x230b06){logger[_0x96a0('0xe')]('ShowInterval',_0x230b06[_0x96a0('0x10')],_0x4010a2);_0x43713c(_0x101913[_0x96a0('0xe')](0x1f4,_0x230b06[_0x96a0('0x10')]));});});};
\ No newline at end of file