Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / setting / setting.rpc.js
index 50c76a7..c91c071 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6b0=['../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Setting','find','options','raw','where','attributes','include','map','model','ShowSetting','lodash','moment'];(function(_0x2264e1,_0x4c5c1c){var _0x508ab2=function(_0x2ed40f){while(--_0x2ed40f){_0x2264e1['push'](_0x2264e1['shift']());}};_0x508ab2(++_0x4c5c1c);}(_0xe6b0,0x1eb));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0e6b('0x0'));var util=require('util');var moment=require(_0x0e6b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e6b('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0e6b('0x3'));var jayson=require(_0x0e6b('0x4'));var client=jayson[_0x0e6b('0x5')][_0x0e6b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4653e9,_0x53694b,_0x139c4c){return new BPromise(function(_0x250858,_0x4cef6e){return client[_0x0e6b('0x7')](_0x4653e9,_0x139c4c)[_0x0e6b('0x8')](function(_0x27325f){logger[_0x0e6b('0x9')](_0x0e6b('0xa'),_0x53694b,_0x0e6b('0xb'));logger[_0x0e6b('0xc')](_0x0e6b('0xd'),_0x53694b,_0x0e6b('0xb'),JSON[_0x0e6b('0xe')](_0x27325f));if(_0x27325f[_0x0e6b('0xf')]){if(_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x10')]===0x1f4){logger['error'](_0x0e6b('0xa'),_0x53694b,_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x11')]);return _0x4cef6e(_0x27325f['error'][_0x0e6b('0x11')]);}logger['error'](_0x0e6b('0xa'),_0x53694b,_0x27325f[_0x0e6b('0xf')][_0x0e6b('0x11')]);return _0x250858(_0x27325f[_0x0e6b('0xf')]['message']);}else{logger[_0x0e6b('0x9')](_0x0e6b('0xa'),_0x53694b,'request\x20sent');_0x250858(_0x27325f['result'][_0x0e6b('0x11')]);}})[_0x0e6b('0x12')](function(_0x9e8ca9){logger['error'](_0x0e6b('0xa'),_0x53694b,_0x9e8ca9);_0x4cef6e(_0x9e8ca9);});});}exports['ShowSetting']=function(_0x210a7e){var _0x5684ad=this;return new Promise(function(_0x5dd636,_0x36ec73){return db[_0x0e6b('0x13')][_0x0e6b('0x14')]({'raw':_0x210a7e['options']?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x16')]===undefined?!![]:![]:!![],'where':_0x210a7e[_0x0e6b('0x15')]?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x17')]||null:null,'attributes':_0x210a7e[_0x0e6b('0x15')]?_0x210a7e['options'][_0x0e6b('0x18')]||null:null,'include':_0x210a7e['options']?_0x210a7e[_0x0e6b('0x15')][_0x0e6b('0x19')]?_[_0x0e6b('0x1a')](_0x210a7e['options']['include'],function(_0x56066b){return{'model':db[_0x56066b['model']],'as':_0x56066b['as'],'attributes':_0x56066b[_0x0e6b('0x18')],'include':_0x56066b['include']?_[_0x0e6b('0x1a')](_0x56066b['include'],function(_0x1d5503){return{'model':db[_0x1d5503[_0x0e6b('0x1b')]],'as':_0x1d5503['as'],'attributes':_0x1d5503[_0x0e6b('0x18')],'include':_0x1d5503[_0x0e6b('0x19')]?_[_0x0e6b('0x1a')](_0x1d5503[_0x0e6b('0x19')],function(_0x1b7997){return{'model':db[_0x1b7997[_0x0e6b('0x1b')]],'as':_0x1b7997['as'],'attributes':_0x1b7997[_0x0e6b('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd09f){logger[_0x0e6b('0x9')](_0x0e6b('0x1c'),_0x210a7e);logger[_0x0e6b('0xc')](_0x0e6b('0x1c'),_0x210a7e,JSON['stringify'](_0x1fd09f));_0x5dd636(_0x1fd09f);})['catch'](function(_0x215e15){logger[_0x0e6b('0xf')](_0x0e6b('0x1c'),_0x215e15[_0x0e6b('0x11')],_0x210a7e);_0x36ec73(_0x5684ad[_0x0e6b('0xf')](0x1f4,_0x215e15[_0x0e6b('0x11')]));});});};
\ No newline at end of file
+var _0x48a4=['catch','Setting','options','raw','where','include','map','model','attributes','debug','ShowSetting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x48a4,0x1be));var _0x448a=function(_0x3e5036,_0x20428f){_0x3e5036=_0x3e5036-0x0;var _0x5a130a=_0x48a4[_0x3e5036];return _0x5a130a;};'use strict';var _=require(_0x448a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x448a('0x1'));var rs=require(_0x448a('0x2'));var fs=require('fs');var Redis=require(_0x448a('0x3'));var db=require(_0x448a('0x4'))['db'];var utils=require(_0x448a('0x5'));var logger=require(_0x448a('0x6'))(_0x448a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x448a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53ea8e,_0xc98a99,_0x2cae96){return new BPromise(function(_0x55bacc,_0x7a5946){return client[_0x448a('0x9')](_0x53ea8e,_0x2cae96)[_0x448a('0xa')](function(_0x12ecad){logger[_0x448a('0xb')](_0x448a('0xc'),_0xc98a99,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0xc98a99,_0x448a('0xd'),JSON[_0x448a('0xe')](_0x12ecad));if(_0x12ecad['error']){if(_0x12ecad[_0x448a('0xf')]['code']===0x1f4){logger[_0x448a('0xf')](_0x448a('0xc'),_0xc98a99,_0x12ecad[_0x448a('0xf')][_0x448a('0x10')]);return _0x7a5946(_0x12ecad[_0x448a('0xf')][_0x448a('0x10')]);}logger[_0x448a('0xf')](_0x448a('0xc'),_0xc98a99,_0x12ecad[_0x448a('0xf')][_0x448a('0x10')]);return _0x55bacc(_0x12ecad['error']['message']);}else{logger[_0x448a('0xb')](_0x448a('0xc'),_0xc98a99,'request\x20sent');_0x55bacc(_0x12ecad[_0x448a('0x11')][_0x448a('0x10')]);}})[_0x448a('0x12')](function(_0x490d51){logger[_0x448a('0xf')](_0x448a('0xc'),_0xc98a99,_0x490d51);_0x7a5946(_0x490d51);});});}exports['ShowSetting']=function(_0x1d6cf0){var _0x319c0b=this;return new Promise(function(_0x16e7fd,_0x426555){return db[_0x448a('0x13')]['find']({'raw':_0x1d6cf0['options']?_0x1d6cf0[_0x448a('0x14')][_0x448a('0x15')]===undefined?!![]:![]:!![],'where':_0x1d6cf0[_0x448a('0x14')]?_0x1d6cf0[_0x448a('0x14')][_0x448a('0x16')]||null:null,'attributes':_0x1d6cf0[_0x448a('0x14')]?_0x1d6cf0['options']['attributes']||null:null,'include':_0x1d6cf0['options']?_0x1d6cf0[_0x448a('0x14')][_0x448a('0x17')]?_[_0x448a('0x18')](_0x1d6cf0[_0x448a('0x14')][_0x448a('0x17')],function(_0x1c191a){return{'model':db[_0x1c191a[_0x448a('0x19')]],'as':_0x1c191a['as'],'attributes':_0x1c191a['attributes'],'include':_0x1c191a[_0x448a('0x17')]?_['map'](_0x1c191a[_0x448a('0x17')],function(_0x118e64){return{'model':db[_0x118e64[_0x448a('0x19')]],'as':_0x118e64['as'],'attributes':_0x118e64['attributes'],'include':_0x118e64[_0x448a('0x17')]?_[_0x448a('0x18')](_0x118e64[_0x448a('0x17')],function(_0x43f139){return{'model':db[_0x43f139[_0x448a('0x19')]],'as':_0x43f139['as'],'attributes':_0x43f139[_0x448a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x448a('0xa')](function(_0x538a72){logger[_0x448a('0xb')]('ShowSetting',_0x1d6cf0);logger[_0x448a('0x1b')](_0x448a('0x1c'),_0x1d6cf0,JSON[_0x448a('0xe')](_0x538a72));_0x16e7fd(_0x538a72);})[_0x448a('0x12')](function(_0x3e5674){logger[_0x448a('0xf')](_0x448a('0x1c'),_0x3e5674[_0x448a('0x10')],_0x1d6cf0);_0x426555(_0x319c0b[_0x448a('0xf')](0x1f4,_0x3e5674[_0x448a('0x10')]));});});};
\ No newline at end of file