Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / setting / setting.rpc.js
index d9a5e38..45dacd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb25d=['model','ShowSetting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../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','message','result','catch','Setting','find','options','raw','where','attributes','include','map'];(function(_0x300ea7,_0x330ebe){var _0x31404f=function(_0x3f6f1d){while(--_0x3f6f1d){_0x300ea7['push'](_0x300ea7['shift']());}};_0x31404f(++_0x330ebe);}(_0xb25d,0x160));var _0xdb25=function(_0x2c306c,_0x13e664){_0x2c306c=_0x2c306c-0x0;var _0x3fc622=_0xb25d[_0x2c306c];return _0x3fc622;};'use strict';var _=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var moment=require(_0xdb25('0x2'));var BPromise=require(_0xdb25('0x3'));var rs=require(_0xdb25('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb25('0x5'))['db'];var utils=require(_0xdb25('0x6'));var logger=require(_0xdb25('0x7'))(_0xdb25('0x8'));var config=require(_0xdb25('0x9'));var jayson=require(_0xdb25('0xa'));var client=jayson[_0xdb25('0xb')][_0xdb25('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5f1b5e,_0xca23d4,_0x560c32){return new BPromise(function(_0x15267e,_0x47b47b){return client[_0xdb25('0xd')](_0x5f1b5e,_0x560c32)[_0xdb25('0xe')](function(_0x15243c){logger[_0xdb25('0xf')](_0xdb25('0x10'),_0xca23d4,_0xdb25('0x11'));logger[_0xdb25('0x12')](_0xdb25('0x13'),_0xca23d4,'request\x20sent',JSON[_0xdb25('0x14')](_0x15243c));if(_0x15243c['error']){if(_0x15243c['error']['code']===0x1f4){logger[_0xdb25('0x15')](_0xdb25('0x10'),_0xca23d4,_0x15243c['error'][_0xdb25('0x16')]);return _0x47b47b(_0x15243c['error'][_0xdb25('0x16')]);}logger['error'](_0xdb25('0x10'),_0xca23d4,_0x15243c[_0xdb25('0x15')]['message']);return _0x15267e(_0x15243c[_0xdb25('0x15')][_0xdb25('0x16')]);}else{logger[_0xdb25('0xf')](_0xdb25('0x10'),_0xca23d4,_0xdb25('0x11'));_0x15267e(_0x15243c[_0xdb25('0x17')][_0xdb25('0x16')]);}})[_0xdb25('0x18')](function(_0x4794ed){logger[_0xdb25('0x15')]('Setting,\x20%s,\x20%s',_0xca23d4,_0x4794ed);_0x47b47b(_0x4794ed);});});}exports['ShowSetting']=function(_0x1cb05c){var _0x7b4365=this;return new Promise(function(_0x4c0417,_0x58f25c){return db[_0xdb25('0x19')][_0xdb25('0x1a')]({'raw':_0x1cb05c[_0xdb25('0x1b')]?_0x1cb05c[_0xdb25('0x1b')][_0xdb25('0x1c')]===undefined?!![]:![]:!![],'where':_0x1cb05c[_0xdb25('0x1b')]?_0x1cb05c[_0xdb25('0x1b')][_0xdb25('0x1d')]||null:null,'attributes':_0x1cb05c['options']?_0x1cb05c[_0xdb25('0x1b')][_0xdb25('0x1e')]||null:null,'include':_0x1cb05c[_0xdb25('0x1b')]?_0x1cb05c[_0xdb25('0x1b')][_0xdb25('0x1f')]?_[_0xdb25('0x20')](_0x1cb05c[_0xdb25('0x1b')][_0xdb25('0x1f')],function(_0x1aa8eb){return{'model':db[_0x1aa8eb[_0xdb25('0x21')]],'as':_0x1aa8eb['as'],'attributes':_0x1aa8eb[_0xdb25('0x1e')],'include':_0x1aa8eb[_0xdb25('0x1f')]?_['map'](_0x1aa8eb[_0xdb25('0x1f')],function(_0x5f5c70){return{'model':db[_0x5f5c70[_0xdb25('0x21')]],'as':_0x5f5c70['as'],'attributes':_0x5f5c70['attributes'],'include':_0x5f5c70[_0xdb25('0x1f')]?_[_0xdb25('0x20')](_0x5f5c70[_0xdb25('0x1f')],function(_0x5f07dd){return{'model':db[_0x5f07dd[_0xdb25('0x21')]],'as':_0x5f07dd['as'],'attributes':_0x5f07dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb25('0xe')](function(_0x8745d5){logger[_0xdb25('0xf')](_0xdb25('0x22'),_0x1cb05c);logger[_0xdb25('0x12')](_0xdb25('0x22'),_0x1cb05c,JSON['stringify'](_0x8745d5));_0x4c0417(_0x8745d5);})[_0xdb25('0x18')](function(_0x49787d){logger['error'](_0xdb25('0x22'),_0x49787d[_0xdb25('0x16')],_0x1cb05c);_0x58f25c(_0x7b4365['error'](0x1f4,_0x49787d[_0xdb25('0x16')]));});});};
\ No newline at end of file
+var _0x894c=['error','code','message','result','catch','ShowSetting','find','options','raw','where','attributes','include','model','map','then','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x894c,0x1da));var _0xc894=function(_0x584b45,_0x219409){_0x584b45=_0x584b45-0x0;var _0xbd54c9=_0x894c[_0x584b45];return _0xbd54c9;};'use strict';var _=require(_0xc894('0x0'));var util=require(_0xc894('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc894('0x2'));var db=require(_0xc894('0x3'))['db'];var utils=require(_0xc894('0x4'));var logger=require('../../config/logger')(_0xc894('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc894('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x50e2a6,_0x4df558,_0xa92fb7){return new BPromise(function(_0x207fc9,_0x67d86f){return client['request'](_0x50e2a6,_0xa92fb7)['then'](function(_0xe4c3f4){logger[_0xc894('0x7')](_0xc894('0x8'),_0x4df558,_0xc894('0x9'));logger[_0xc894('0xa')]('Setting,\x20%s,\x20%s,\x20%s',_0x4df558,_0xc894('0x9'),JSON[_0xc894('0xb')](_0xe4c3f4));if(_0xe4c3f4[_0xc894('0xc')]){if(_0xe4c3f4[_0xc894('0xc')][_0xc894('0xd')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x4df558,_0xe4c3f4[_0xc894('0xc')][_0xc894('0xe')]);return _0x67d86f(_0xe4c3f4[_0xc894('0xc')][_0xc894('0xe')]);}logger[_0xc894('0xc')]('Setting,\x20%s,\x20%s',_0x4df558,_0xe4c3f4[_0xc894('0xc')][_0xc894('0xe')]);return _0x207fc9(_0xe4c3f4[_0xc894('0xc')]['message']);}else{logger['info'](_0xc894('0x8'),_0x4df558,'request\x20sent');_0x207fc9(_0xe4c3f4[_0xc894('0xf')][_0xc894('0xe')]);}})[_0xc894('0x10')](function(_0x5ec674){logger[_0xc894('0xc')]('Setting,\x20%s,\x20%s',_0x4df558,_0x5ec674);_0x67d86f(_0x5ec674);});});}exports[_0xc894('0x11')]=function(_0x110e35){var _0x2fecc4=this;return new Promise(function(_0x5ae219,_0x124edf){return db['Setting'][_0xc894('0x12')]({'raw':_0x110e35[_0xc894('0x13')]?_0x110e35[_0xc894('0x13')][_0xc894('0x14')]===undefined?!![]:![]:!![],'where':_0x110e35[_0xc894('0x13')]?_0x110e35[_0xc894('0x13')][_0xc894('0x15')]||null:null,'attributes':_0x110e35['options']?_0x110e35[_0xc894('0x13')][_0xc894('0x16')]||null:null,'include':_0x110e35['options']?_0x110e35[_0xc894('0x13')]['include']?_['map'](_0x110e35[_0xc894('0x13')][_0xc894('0x17')],function(_0x508a13){return{'model':db[_0x508a13[_0xc894('0x18')]],'as':_0x508a13['as'],'attributes':_0x508a13['attributes'],'include':_0x508a13[_0xc894('0x17')]?_[_0xc894('0x19')](_0x508a13[_0xc894('0x17')],function(_0x2b8f1d){return{'model':db[_0x2b8f1d[_0xc894('0x18')]],'as':_0x2b8f1d['as'],'attributes':_0x2b8f1d[_0xc894('0x16')],'include':_0x2b8f1d[_0xc894('0x17')]?_['map'](_0x2b8f1d[_0xc894('0x17')],function(_0x2b5e7b){return{'model':db[_0x2b5e7b[_0xc894('0x18')]],'as':_0x2b5e7b['as'],'attributes':_0x2b5e7b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc894('0x1a')](function(_0x38fb5f){logger[_0xc894('0x7')](_0xc894('0x11'),_0x110e35);logger[_0xc894('0xa')](_0xc894('0x11'),_0x110e35,JSON['stringify'](_0x38fb5f));_0x5ae219(_0x38fb5f);})[_0xc894('0x10')](function(_0x259e35){logger[_0xc894('0xc')]('ShowSetting',_0x259e35[_0xc894('0xe')],_0x110e35);_0x124edf(_0x2fecc4['error'](0x1f4,_0x259e35[_0xc894('0xe')]));});});};
\ No newline at end of file