Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / setting / setting.rpc.js
index 2db7499..fc87dd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f15=['catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../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'];(function(_0x477228,_0x397c9d){var _0x23aa6e=function(_0x117b07){while(--_0x117b07){_0x477228['push'](_0x477228['shift']());}};_0x23aa6e(++_0x397c9d);}(_0x1f15,0x1e7));var _0x51f1=function(_0xc89101,_0x1163b0){_0xc89101=_0xc89101-0x0;var _0x144720=_0x1f15[_0xc89101];return _0x144720;};'use strict';var _=require(_0x51f1('0x0'));var util=require(_0x51f1('0x1'));var moment=require(_0x51f1('0x2'));var BPromise=require(_0x51f1('0x3'));var rs=require(_0x51f1('0x4'));var fs=require('fs');var Redis=require(_0x51f1('0x5'));var db=require(_0x51f1('0x6'))['db'];var utils=require(_0x51f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x51f1('0x8'));var jayson=require(_0x51f1('0x9'));var client=jayson[_0x51f1('0xa')][_0x51f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ea2bd,_0x16a1cd,_0x7c1535){return new BPromise(function(_0x3c8413,_0x5c54d7){return client[_0x51f1('0xc')](_0x4ea2bd,_0x7c1535)[_0x51f1('0xd')](function(_0xdf7a32){logger[_0x51f1('0xe')](_0x51f1('0xf'),_0x16a1cd,_0x51f1('0x10'));logger[_0x51f1('0x11')](_0x51f1('0x12'),_0x16a1cd,'request\x20sent',JSON[_0x51f1('0x13')](_0xdf7a32));if(_0xdf7a32[_0x51f1('0x14')]){if(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x15')]===0x1f4){logger[_0x51f1('0x14')]('Setting,\x20%s,\x20%s',_0x16a1cd,_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);return _0x5c54d7(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);}logger['error']('Setting,\x20%s,\x20%s',_0x16a1cd,_0xdf7a32[_0x51f1('0x14')]['message']);return _0x3c8413(_0xdf7a32[_0x51f1('0x14')][_0x51f1('0x16')]);}else{logger[_0x51f1('0xe')](_0x51f1('0xf'),_0x16a1cd,_0x51f1('0x10'));_0x3c8413(_0xdf7a32['result'][_0x51f1('0x16')]);}})[_0x51f1('0x17')](function(_0x2c4c1e){logger[_0x51f1('0x14')](_0x51f1('0xf'),_0x16a1cd,_0x2c4c1e);_0x5c54d7(_0x2c4c1e);});});}exports[_0x51f1('0x18')]=function(_0x5442eb){var _0x5975d9=this;return new Promise(function(_0x594806,_0x4907b0){return db[_0x51f1('0x19')][_0x51f1('0x1a')]({'raw':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1c')]===undefined?!![]:![]:!![],'where':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb['options'][_0x51f1('0x1d')]||null:null,'attributes':_0x5442eb['options']?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1e')]||null:null,'include':_0x5442eb[_0x51f1('0x1b')]?_0x5442eb[_0x51f1('0x1b')][_0x51f1('0x1f')]?_[_0x51f1('0x20')](_0x5442eb[_0x51f1('0x1b')]['include'],function(_0x477107){return{'model':db[_0x477107['model']],'as':_0x477107['as'],'attributes':_0x477107['attributes'],'include':_0x477107['include']?_[_0x51f1('0x20')](_0x477107[_0x51f1('0x1f')],function(_0x2946f7){return{'model':db[_0x2946f7[_0x51f1('0x21')]],'as':_0x2946f7['as'],'attributes':_0x2946f7[_0x51f1('0x1e')],'include':_0x2946f7[_0x51f1('0x1f')]?_[_0x51f1('0x20')](_0x2946f7[_0x51f1('0x1f')],function(_0x4ba48c){return{'model':db[_0x4ba48c[_0x51f1('0x21')]],'as':_0x4ba48c['as'],'attributes':_0x4ba48c[_0x51f1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7f8579){logger[_0x51f1('0xe')](_0x51f1('0x18'),_0x5442eb);logger[_0x51f1('0x11')](_0x51f1('0x18'),_0x5442eb,JSON[_0x51f1('0x13')](_0x7f8579));_0x594806(_0x7f8579);})[_0x51f1('0x17')](function(_0x41d37d){logger['error'](_0x51f1('0x18'),_0x41d37d[_0x51f1('0x16')],_0x5442eb);_0x4907b0(_0x5975d9[_0x51f1('0x14')](0x1f4,_0x41d37d[_0x51f1('0x16')]));});});};
\ No newline at end of file
+var _0x8b87=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','include','model','stringify','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x494df3,_0xb1231a){var _0x494949=function(_0x5bd4cc){while(--_0x5bd4cc){_0x494df3['push'](_0x494df3['shift']());}};_0x494949(++_0xb1231a);}(_0x8b87,0xdb));var _0x78b8=function(_0x1a1947,_0x54798f){_0x1a1947=_0x1a1947-0x0;var _0x5781ec=_0x8b87[_0x1a1947];return _0x5781ec;};'use strict';var _=require(_0x78b8('0x0'));var util=require('util');var moment=require(_0x78b8('0x1'));var BPromise=require(_0x78b8('0x2'));var rs=require(_0x78b8('0x3'));var fs=require('fs');var Redis=require(_0x78b8('0x4'));var db=require(_0x78b8('0x5'))['db'];var utils=require(_0x78b8('0x6'));var logger=require(_0x78b8('0x7'))('rpc');var config=require(_0x78b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x78b8('0x9')][_0x78b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x384b91,_0x1c34ea,_0x1b5a3d){return new BPromise(function(_0x25cd9b,_0x3c4c43){return client[_0x78b8('0xb')](_0x384b91,_0x1b5a3d)['then'](function(_0x458f0b){logger[_0x78b8('0xc')]('Setting,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'));logger[_0x78b8('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'),JSON['stringify'](_0x458f0b));if(_0x458f0b[_0x78b8('0xf')]){if(_0x458f0b[_0x78b8('0xf')][_0x78b8('0x10')]===0x1f4){logger[_0x78b8('0xf')](_0x78b8('0x11'),_0x1c34ea,_0x458f0b[_0x78b8('0xf')][_0x78b8('0x12')]);return _0x3c4c43(_0x458f0b['error'][_0x78b8('0x12')]);}logger['error'](_0x78b8('0x11'),_0x1c34ea,_0x458f0b['error'][_0x78b8('0x12')]);return _0x25cd9b(_0x458f0b[_0x78b8('0xf')][_0x78b8('0x12')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1c34ea,_0x78b8('0xd'));_0x25cd9b(_0x458f0b[_0x78b8('0x13')][_0x78b8('0x12')]);}})[_0x78b8('0x14')](function(_0x1accce){logger[_0x78b8('0xf')]('Setting,\x20%s,\x20%s',_0x1c34ea,_0x1accce);_0x3c4c43(_0x1accce);});});}exports[_0x78b8('0x15')]=function(_0x19cfe3){var _0x4c88f6=this;return new Promise(function(_0x1cd4d5,_0x5f5816){return db[_0x78b8('0x16')][_0x78b8('0x17')]({'raw':_0x19cfe3['options']?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x19')]===undefined?!![]:![]:!![],'where':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x1a')]||null:null,'attributes':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3[_0x78b8('0x18')][_0x78b8('0x1b')]||null:null,'include':_0x19cfe3[_0x78b8('0x18')]?_0x19cfe3['options']['include']?_[_0x78b8('0x1c')](_0x19cfe3[_0x78b8('0x18')]['include'],function(_0x3fd95a){return{'model':db[_0x3fd95a['model']],'as':_0x3fd95a['as'],'attributes':_0x3fd95a[_0x78b8('0x1b')],'include':_0x3fd95a[_0x78b8('0x1d')]?_[_0x78b8('0x1c')](_0x3fd95a['include'],function(_0x5060d6){return{'model':db[_0x5060d6['model']],'as':_0x5060d6['as'],'attributes':_0x5060d6['attributes'],'include':_0x5060d6[_0x78b8('0x1d')]?_[_0x78b8('0x1c')](_0x5060d6['include'],function(_0x1b1d55){return{'model':db[_0x1b1d55[_0x78b8('0x1e')]],'as':_0x1b1d55['as'],'attributes':_0x1b1d55[_0x78b8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2181c4){logger[_0x78b8('0xc')](_0x78b8('0x15'),_0x19cfe3);logger[_0x78b8('0xe')](_0x78b8('0x15'),_0x19cfe3,JSON[_0x78b8('0x1f')](_0x2181c4));_0x1cd4d5(_0x2181c4);})[_0x78b8('0x14')](function(_0x171576){logger[_0x78b8('0xf')](_0x78b8('0x15'),_0x171576[_0x78b8('0x12')],_0x19cfe3);_0x5f5816(_0x4c88f6['error'](0x1f4,_0x171576[_0x78b8('0x12')]));});});};
\ No newline at end of file