Built motion from commit 5b761a7b.|2.5.36
[motion2.git] / server / api / setting / setting.rpc.js
index 88fca3b..d9a5e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab83=['stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ShowSetting','Setting','find','options','raw','attributes','include','map','model'];(function(_0xc4b0a3,_0x26026b){var _0x368b92=function(_0x3cb1c3){while(--_0x3cb1c3){_0xc4b0a3['push'](_0xc4b0a3['shift']());}};_0x368b92(++_0x26026b);}(_0xab83,0x134));var _0x3ab8=function(_0x5eb88f,_0x5b0442){_0x5eb88f=_0x5eb88f-0x0;var _0x2f086b=_0xab83[_0x5eb88f];return _0x2f086b;};'use strict';var _=require(_0x3ab8('0x0'));var util=require('util');var moment=require(_0x3ab8('0x1'));var BPromise=require(_0x3ab8('0x2'));var rs=require(_0x3ab8('0x3'));var fs=require('fs');var Redis=require(_0x3ab8('0x4'));var db=require(_0x3ab8('0x5'))['db'];var utils=require(_0x3ab8('0x6'));var logger=require(_0x3ab8('0x7'))(_0x3ab8('0x8'));var config=require(_0x3ab8('0x9'));var jayson=require(_0x3ab8('0xa'));var client=jayson[_0x3ab8('0xb')][_0x3ab8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x181f9b,_0x3e594c,_0x36629b){return new BPromise(function(_0x5c5cb1,_0x360934){return client[_0x3ab8('0xd')](_0x181f9b,_0x36629b)[_0x3ab8('0xe')](function(_0x4bc0d8){logger['info'](_0x3ab8('0xf'),_0x3e594c,_0x3ab8('0x10'));logger['debug'](_0x3ab8('0x11'),_0x3e594c,_0x3ab8('0x10'),JSON['stringify'](_0x4bc0d8));if(_0x4bc0d8[_0x3ab8('0x12')]){if(_0x4bc0d8[_0x3ab8('0x12')][_0x3ab8('0x13')]===0x1f4){logger[_0x3ab8('0x12')]('Setting,\x20%s,\x20%s',_0x3e594c,_0x4bc0d8[_0x3ab8('0x12')][_0x3ab8('0x14')]);return _0x360934(_0x4bc0d8[_0x3ab8('0x12')][_0x3ab8('0x14')]);}logger[_0x3ab8('0x12')](_0x3ab8('0xf'),_0x3e594c,_0x4bc0d8[_0x3ab8('0x12')][_0x3ab8('0x14')]);return _0x5c5cb1(_0x4bc0d8['error'][_0x3ab8('0x14')]);}else{logger[_0x3ab8('0x15')](_0x3ab8('0xf'),_0x3e594c,'request\x20sent');_0x5c5cb1(_0x4bc0d8[_0x3ab8('0x16')][_0x3ab8('0x14')]);}})['catch'](function(_0x2ffc67){logger['error']('Setting,\x20%s,\x20%s',_0x3e594c,_0x2ffc67);_0x360934(_0x2ffc67);});});}exports[_0x3ab8('0x17')]=function(_0x12c372){var _0x5e7067=this;return new Promise(function(_0x2e80ea,_0x402c32){return db[_0x3ab8('0x18')][_0x3ab8('0x19')]({'raw':_0x12c372['options']?_0x12c372[_0x3ab8('0x1a')][_0x3ab8('0x1b')]===undefined?!![]:![]:!![],'where':_0x12c372[_0x3ab8('0x1a')]?_0x12c372['options']['where']||null:null,'attributes':_0x12c372[_0x3ab8('0x1a')]?_0x12c372['options'][_0x3ab8('0x1c')]||null:null,'include':_0x12c372[_0x3ab8('0x1a')]?_0x12c372['options'][_0x3ab8('0x1d')]?_[_0x3ab8('0x1e')](_0x12c372[_0x3ab8('0x1a')][_0x3ab8('0x1d')],function(_0x387dc3){return{'model':db[_0x387dc3[_0x3ab8('0x1f')]],'as':_0x387dc3['as'],'attributes':_0x387dc3[_0x3ab8('0x1c')],'include':_0x387dc3[_0x3ab8('0x1d')]?_[_0x3ab8('0x1e')](_0x387dc3[_0x3ab8('0x1d')],function(_0x1a74a6){return{'model':db[_0x1a74a6[_0x3ab8('0x1f')]],'as':_0x1a74a6['as'],'attributes':_0x1a74a6[_0x3ab8('0x1c')],'include':_0x1a74a6[_0x3ab8('0x1d')]?_[_0x3ab8('0x1e')](_0x1a74a6[_0x3ab8('0x1d')],function(_0x3b736e){return{'model':db[_0x3b736e[_0x3ab8('0x1f')]],'as':_0x3b736e['as'],'attributes':_0x3b736e[_0x3ab8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3ab8('0xe')](function(_0x1cb5f0){logger[_0x3ab8('0x15')](_0x3ab8('0x17'),_0x12c372);logger['debug'](_0x3ab8('0x17'),_0x12c372,JSON[_0x3ab8('0x20')](_0x1cb5f0));_0x2e80ea(_0x1cb5f0);})[_0x3ab8('0x21')](function(_0x4b2fc3){logger[_0x3ab8('0x12')]('ShowSetting',_0x4b2fc3[_0x3ab8('0x14')],_0x12c372);_0x402c32(_0x5e7067[_0x3ab8('0x12')](0x1f4,_0x4b2fc3[_0x3ab8('0x14')]));});});};
\ No newline at end of file
+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