Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / variable / variable.rpc.js
index e9130b3..c27971f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f83=['request\x20sent','stringify','code','error','message','ShowVariable','Variable','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Variable,\x20%s,\x20%s'];(function(_0x5f4de,_0x13e1d6){var _0x25772d=function(_0x5f5b56){while(--_0x5f5b56){_0x5f4de['push'](_0x5f4de['shift']());}};_0x25772d(++_0x13e1d6);}(_0x5f83,0xd2));var _0x35f8=function(_0x4e5739,_0x54cf43){_0x4e5739=_0x4e5739-0x0;var _0x3d61a6=_0x5f83[_0x4e5739];return _0x3d61a6;};'use strict';var _=require(_0x35f8('0x0'));var util=require(_0x35f8('0x1'));var moment=require(_0x35f8('0x2'));var BPromise=require(_0x35f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x35f8('0x5'));var logger=require(_0x35f8('0x6'))(_0x35f8('0x7'));var config=require(_0x35f8('0x8'));var jayson=require(_0x35f8('0x9'));var client=jayson[_0x35f8('0xa')][_0x35f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a034,_0x50337c,_0x5d72b9){return new BPromise(function(_0x580a6f,_0x3a25d6){return client['request'](_0x49a034,_0x5d72b9)['then'](function(_0x592699){logger[_0x35f8('0xc')](_0x35f8('0xd'),_0x50337c,_0x35f8('0xe'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x50337c,_0x35f8('0xe'),JSON[_0x35f8('0xf')](_0x592699));if(_0x592699['error']){if(_0x592699['error'][_0x35f8('0x10')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x50337c,_0x592699[_0x35f8('0x11')][_0x35f8('0x12')]);return _0x3a25d6(_0x592699[_0x35f8('0x11')][_0x35f8('0x12')]);}logger[_0x35f8('0x11')]('Variable,\x20%s,\x20%s',_0x50337c,_0x592699[_0x35f8('0x11')][_0x35f8('0x12')]);return _0x580a6f(_0x592699[_0x35f8('0x11')]['message']);}else{logger[_0x35f8('0xc')](_0x35f8('0xd'),_0x50337c,_0x35f8('0xe'));_0x580a6f(_0x592699['result'][_0x35f8('0x12')]);}})['catch'](function(_0x35c72e){logger[_0x35f8('0x11')](_0x35f8('0xd'),_0x50337c,_0x35c72e);_0x3a25d6(_0x35c72e);});});}exports[_0x35f8('0x13')]=function(_0x34ef98){var _0x412bcd=this;return new Promise(function(_0x3e5460,_0x2dfe6d){return db[_0x35f8('0x14')][_0x35f8('0x15')]({'raw':_0x34ef98[_0x35f8('0x16')]?_0x34ef98[_0x35f8('0x16')][_0x35f8('0x17')]===undefined?!![]:![]:!![],'where':_0x34ef98[_0x35f8('0x16')]?_0x34ef98[_0x35f8('0x16')]['where']||null:null,'attributes':_0x34ef98[_0x35f8('0x16')]?_0x34ef98['options'][_0x35f8('0x18')]||null:null,'include':_0x34ef98[_0x35f8('0x16')]?_0x34ef98[_0x35f8('0x16')][_0x35f8('0x19')]?_[_0x35f8('0x1a')](_0x34ef98[_0x35f8('0x16')][_0x35f8('0x19')],function(_0x3eb130){return{'model':db[_0x3eb130[_0x35f8('0x1b')]],'as':_0x3eb130['as'],'attributes':_0x3eb130[_0x35f8('0x18')],'include':_0x3eb130[_0x35f8('0x19')]?_['map'](_0x3eb130[_0x35f8('0x19')],function(_0x1cbc6){return{'model':db[_0x1cbc6[_0x35f8('0x1b')]],'as':_0x1cbc6['as'],'attributes':_0x1cbc6[_0x35f8('0x18')],'include':_0x1cbc6[_0x35f8('0x19')]?_[_0x35f8('0x1a')](_0x1cbc6[_0x35f8('0x19')],function(_0x12767a){return{'model':db[_0x12767a[_0x35f8('0x1b')]],'as':_0x12767a['as'],'attributes':_0x12767a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c7475){logger[_0x35f8('0xc')]('ShowVariable',_0x34ef98);logger['debug'](_0x35f8('0x13'),_0x34ef98,JSON[_0x35f8('0xf')](_0x4c7475));_0x3e5460(_0x4c7475);})['catch'](function(_0x5eb962){logger['error'](_0x35f8('0x13'),_0x5eb962['message'],_0x34ef98);_0x2dfe6d(_0x412bcd['error'](0x1f4,_0x5eb962['message']));});});};
\ No newline at end of file
+var _0x98dc=['stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','Variable,\x20%s,\x20%s','message','result','catch','Variable','find','options','raw','where','attributes','include','map','model','ShowVariable'];(function(_0x1d09ed,_0x4f0a26){var _0x19a9fb=function(_0x397062){while(--_0x397062){_0x1d09ed['push'](_0x1d09ed['shift']());}};_0x19a9fb(++_0x4f0a26);}(_0x98dc,0xc7));var _0xc98d=function(_0x48ca6a,_0x1e14cd){_0x48ca6a=_0x48ca6a-0x0;var _0x5a6938=_0x98dc[_0x48ca6a];return _0x5a6938;};'use strict';var _=require('lodash');var util=require(_0xc98d('0x0'));var moment=require(_0xc98d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc98d('0x2'));var fs=require('fs');var Redis=require(_0xc98d('0x3'));var db=require(_0xc98d('0x4'))['db'];var utils=require(_0xc98d('0x5'));var logger=require(_0xc98d('0x6'))('rpc');var config=require(_0xc98d('0x7'));var jayson=require(_0xc98d('0x8'));var client=jayson['client'][_0xc98d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fd34c,_0x35aa22,_0x591145){return new BPromise(function(_0x52ea92,_0x50d63d){return client[_0xc98d('0xa')](_0x3fd34c,_0x591145)[_0xc98d('0xb')](function(_0x1457fb){logger[_0xc98d('0xc')]('Variable,\x20%s,\x20%s',_0x35aa22,_0xc98d('0xd'));logger[_0xc98d('0xe')](_0xc98d('0xf'),_0x35aa22,'request\x20sent',JSON['stringify'](_0x1457fb));if(_0x1457fb[_0xc98d('0x10')]){if(_0x1457fb[_0xc98d('0x10')][_0xc98d('0x11')]===0x1f4){logger[_0xc98d('0x10')](_0xc98d('0x12'),_0x35aa22,_0x1457fb[_0xc98d('0x10')][_0xc98d('0x13')]);return _0x50d63d(_0x1457fb[_0xc98d('0x10')][_0xc98d('0x13')]);}logger[_0xc98d('0x10')](_0xc98d('0x12'),_0x35aa22,_0x1457fb[_0xc98d('0x10')][_0xc98d('0x13')]);return _0x52ea92(_0x1457fb[_0xc98d('0x10')]['message']);}else{logger[_0xc98d('0xc')]('Variable,\x20%s,\x20%s',_0x35aa22,'request\x20sent');_0x52ea92(_0x1457fb[_0xc98d('0x14')][_0xc98d('0x13')]);}})[_0xc98d('0x15')](function(_0x5aa4d9){logger[_0xc98d('0x10')](_0xc98d('0x12'),_0x35aa22,_0x5aa4d9);_0x50d63d(_0x5aa4d9);});});}exports['ShowVariable']=function(_0x107077){var _0x3cbd24=this;return new Promise(function(_0x42431b,_0x1764fc){return db[_0xc98d('0x16')][_0xc98d('0x17')]({'raw':_0x107077[_0xc98d('0x18')]?_0x107077['options'][_0xc98d('0x19')]===undefined?!![]:![]:!![],'where':_0x107077[_0xc98d('0x18')]?_0x107077[_0xc98d('0x18')][_0xc98d('0x1a')]||null:null,'attributes':_0x107077[_0xc98d('0x18')]?_0x107077[_0xc98d('0x18')][_0xc98d('0x1b')]||null:null,'include':_0x107077[_0xc98d('0x18')]?_0x107077[_0xc98d('0x18')][_0xc98d('0x1c')]?_[_0xc98d('0x1d')](_0x107077['options']['include'],function(_0x44646a){return{'model':db[_0x44646a[_0xc98d('0x1e')]],'as':_0x44646a['as'],'attributes':_0x44646a[_0xc98d('0x1b')],'include':_0x44646a[_0xc98d('0x1c')]?_[_0xc98d('0x1d')](_0x44646a[_0xc98d('0x1c')],function(_0x13a8a4){return{'model':db[_0x13a8a4[_0xc98d('0x1e')]],'as':_0x13a8a4['as'],'attributes':_0x13a8a4[_0xc98d('0x1b')],'include':_0x13a8a4[_0xc98d('0x1c')]?_[_0xc98d('0x1d')](_0x13a8a4[_0xc98d('0x1c')],function(_0x20e633){return{'model':db[_0x20e633[_0xc98d('0x1e')]],'as':_0x20e633['as'],'attributes':_0x20e633[_0xc98d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb987e9){logger[_0xc98d('0xc')](_0xc98d('0x1f'),_0x107077);logger[_0xc98d('0xe')]('ShowVariable',_0x107077,JSON[_0xc98d('0x20')](_0xb987e9));_0x42431b(_0xb987e9);})['catch'](function(_0x59e493){logger[_0xc98d('0x10')]('ShowVariable',_0x59e493[_0xc98d('0x13')],_0x107077);_0x1764fc(_0x3cbd24[_0xc98d('0x10')](0x1f4,_0x59e493['message']));});});};
\ No newline at end of file