Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / api / setting / setting.rpc.js
index e38c895..61f9919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x607f=['code','message','Setting','options','raw','where','include','map','model','attributes','ShowSetting','debug','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','error'];(function(_0x7ba534,_0x53faf5){var _0x166ef1=function(_0x3aa12c){while(--_0x3aa12c){_0x7ba534['push'](_0x7ba534['shift']());}};_0x166ef1(++_0x53faf5);}(_0x607f,0x125));var _0xf607=function(_0x49fc4c,_0x4f5ce7){_0x49fc4c=_0x49fc4c-0x0;var _0x1c3880=_0x607f[_0x49fc4c];return _0x1c3880;};'use strict';var _=require(_0xf607('0x0'));var util=require('util');var moment=require(_0xf607('0x1'));var BPromise=require(_0xf607('0x2'));var rs=require(_0xf607('0x3'));var fs=require('fs');var Redis=require(_0xf607('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf607('0x5'));var logger=require(_0xf607('0x6'))(_0xf607('0x7'));var config=require(_0xf607('0x8'));var jayson=require(_0xf607('0x9'));var client=jayson['client'][_0xf607('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c4562,_0x481a93,_0x5aa49d){return new BPromise(function(_0x134a06,_0x1badaf){return client[_0xf607('0xb')](_0x2c4562,_0x5aa49d)[_0xf607('0xc')](function(_0x30d181){logger[_0xf607('0xd')](_0xf607('0xe'),_0x481a93,_0xf607('0xf'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x481a93,_0xf607('0xf'),JSON['stringify'](_0x30d181));if(_0x30d181[_0xf607('0x10')]){if(_0x30d181[_0xf607('0x10')][_0xf607('0x11')]===0x1f4){logger[_0xf607('0x10')](_0xf607('0xe'),_0x481a93,_0x30d181[_0xf607('0x10')][_0xf607('0x12')]);return _0x1badaf(_0x30d181[_0xf607('0x10')][_0xf607('0x12')]);}logger[_0xf607('0x10')](_0xf607('0xe'),_0x481a93,_0x30d181[_0xf607('0x10')][_0xf607('0x12')]);return _0x134a06(_0x30d181[_0xf607('0x10')][_0xf607('0x12')]);}else{logger[_0xf607('0xd')](_0xf607('0xe'),_0x481a93,_0xf607('0xf'));_0x134a06(_0x30d181['result'][_0xf607('0x12')]);}})['catch'](function(_0x578d2a){logger[_0xf607('0x10')](_0xf607('0xe'),_0x481a93,_0x578d2a);_0x1badaf(_0x578d2a);});});}exports['ShowSetting']=function(_0x1a2fd2){var _0x1c6745=this;return new Promise(function(_0x5b859b,_0x4542f6){return db[_0xf607('0x13')]['find']({'raw':_0x1a2fd2['options']?_0x1a2fd2[_0xf607('0x14')][_0xf607('0x15')]===undefined?!![]:![]:!![],'where':_0x1a2fd2[_0xf607('0x14')]?_0x1a2fd2[_0xf607('0x14')][_0xf607('0x16')]||null:null,'attributes':_0x1a2fd2[_0xf607('0x14')]?_0x1a2fd2[_0xf607('0x14')]['attributes']||null:null,'include':_0x1a2fd2[_0xf607('0x14')]?_0x1a2fd2[_0xf607('0x14')][_0xf607('0x17')]?_[_0xf607('0x18')](_0x1a2fd2[_0xf607('0x14')][_0xf607('0x17')],function(_0x1bae93){return{'model':db[_0x1bae93[_0xf607('0x19')]],'as':_0x1bae93['as'],'attributes':_0x1bae93[_0xf607('0x1a')],'include':_0x1bae93[_0xf607('0x17')]?_[_0xf607('0x18')](_0x1bae93[_0xf607('0x17')],function(_0x5a9ecb){return{'model':db[_0x5a9ecb[_0xf607('0x19')]],'as':_0x5a9ecb['as'],'attributes':_0x5a9ecb[_0xf607('0x1a')],'include':_0x5a9ecb[_0xf607('0x17')]?_['map'](_0x5a9ecb['include'],function(_0x166c9b){return{'model':db[_0x166c9b[_0xf607('0x19')]],'as':_0x166c9b['as'],'attributes':_0x166c9b[_0xf607('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf607('0xc')](function(_0x9b6d8c){logger[_0xf607('0xd')](_0xf607('0x1b'),_0x1a2fd2);logger[_0xf607('0x1c')](_0xf607('0x1b'),_0x1a2fd2,JSON[_0xf607('0x1d')](_0x9b6d8c));_0x5b859b(_0x9b6d8c);})[_0xf607('0x1e')](function(_0x1e4776){logger[_0xf607('0x10')](_0xf607('0x1b'),_0x1e4776[_0xf607('0x12')],_0x1a2fd2);_0x4542f6(_0x1c6745[_0xf607('0x10')](0x1f4,_0x1e4776[_0xf607('0x12')]));});});};
\ No newline at end of file
+var _0x3c0b=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','model','include','info','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3c0b,0x1de));var _0xb3c0=function(_0x3a3c8a,_0x137e29){_0x3a3c8a=_0x3a3c8a-0x0;var _0x3ab6c2=_0x3c0b[_0x3a3c8a];return _0x3ab6c2;};'use strict';var _=require(_0xb3c0('0x0'));var util=require(_0xb3c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb3c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3c0('0x3'))['db'];var utils=require(_0xb3c0('0x4'));var logger=require(_0xb3c0('0x5'))(_0xb3c0('0x6'));var config=require(_0xb3c0('0x7'));var jayson=require(_0xb3c0('0x8'));var client=jayson[_0xb3c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5dd5d3,_0x4adb1e,_0xdae360){return new BPromise(function(_0x83b66a,_0x15d33c){return client[_0xb3c0('0xa')](_0x5dd5d3,_0xdae360)[_0xb3c0('0xb')](function(_0x1ae80c){logger['info'](_0xb3c0('0xc'),_0x4adb1e,_0xb3c0('0xd'));logger[_0xb3c0('0xe')](_0xb3c0('0xf'),_0x4adb1e,_0xb3c0('0xd'),JSON[_0xb3c0('0x10')](_0x1ae80c));if(_0x1ae80c[_0xb3c0('0x11')]){if(_0x1ae80c[_0xb3c0('0x11')]['code']===0x1f4){logger[_0xb3c0('0x11')]('Setting,\x20%s,\x20%s',_0x4adb1e,_0x1ae80c[_0xb3c0('0x11')][_0xb3c0('0x12')]);return _0x15d33c(_0x1ae80c[_0xb3c0('0x11')][_0xb3c0('0x12')]);}logger['error'](_0xb3c0('0xc'),_0x4adb1e,_0x1ae80c[_0xb3c0('0x11')][_0xb3c0('0x12')]);return _0x83b66a(_0x1ae80c[_0xb3c0('0x11')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4adb1e,_0xb3c0('0xd'));_0x83b66a(_0x1ae80c[_0xb3c0('0x13')]['message']);}})[_0xb3c0('0x14')](function(_0x1984d9){logger[_0xb3c0('0x11')](_0xb3c0('0xc'),_0x4adb1e,_0x1984d9);_0x15d33c(_0x1984d9);});});}exports[_0xb3c0('0x15')]=function(_0x2d9066){var _0x3cc75d=this;return new Promise(function(_0x3b2b8a,_0x525368){return db[_0xb3c0('0x16')][_0xb3c0('0x17')]({'raw':_0x2d9066[_0xb3c0('0x18')]?_0x2d9066['options'][_0xb3c0('0x19')]===undefined?!![]:![]:!![],'where':_0x2d9066[_0xb3c0('0x18')]?_0x2d9066[_0xb3c0('0x18')][_0xb3c0('0x1a')]||null:null,'attributes':_0x2d9066[_0xb3c0('0x18')]?_0x2d9066[_0xb3c0('0x18')][_0xb3c0('0x1b')]||null:null,'include':_0x2d9066[_0xb3c0('0x18')]?_0x2d9066['options']['include']?_[_0xb3c0('0x1c')](_0x2d9066[_0xb3c0('0x18')]['include'],function(_0x565d81){return{'model':db[_0x565d81[_0xb3c0('0x1d')]],'as':_0x565d81['as'],'attributes':_0x565d81[_0xb3c0('0x1b')],'include':_0x565d81[_0xb3c0('0x1e')]?_[_0xb3c0('0x1c')](_0x565d81[_0xb3c0('0x1e')],function(_0x5dd352){return{'model':db[_0x5dd352[_0xb3c0('0x1d')]],'as':_0x5dd352['as'],'attributes':_0x5dd352[_0xb3c0('0x1b')],'include':_0x5dd352['include']?_[_0xb3c0('0x1c')](_0x5dd352[_0xb3c0('0x1e')],function(_0x2b2c6b){return{'model':db[_0x2b2c6b[_0xb3c0('0x1d')]],'as':_0x2b2c6b['as'],'attributes':_0x2b2c6b[_0xb3c0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb3c0('0xb')](function(_0x53dbbe){logger[_0xb3c0('0x1f')](_0xb3c0('0x15'),_0x2d9066);logger['debug']('ShowSetting',_0x2d9066,JSON[_0xb3c0('0x10')](_0x53dbbe));_0x3b2b8a(_0x53dbbe);})[_0xb3c0('0x14')](function(_0x2b7d54){logger[_0xb3c0('0x11')](_0xb3c0('0x15'),_0x2b7d54[_0xb3c0('0x12')],_0x2d9066);_0x525368(_0x3cc75d[_0xb3c0('0x11')](0x1f4,_0x2b7d54[_0xb3c0('0x12')]));});});};
\ No newline at end of file