Built motion from commit 936e8062.|2.5.33
[motion2.git] / server / api / setting / setting.rpc.js
index ff17c99..965eac0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5cb=['error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x18108c,_0xc174df){var _0x115f8b=function(_0x58f7df){while(--_0x58f7df){_0x18108c['push'](_0x18108c['shift']());}};_0x115f8b(++_0xc174df);}(_0xc5cb,0x1bd));var _0xbc5c=function(_0x2a8eec,_0x382a74){_0x2a8eec=_0x2a8eec-0x0;var _0x2bbc5f=_0xc5cb[_0x2a8eec];return _0x2bbc5f;};'use strict';var _=require(_0xbc5c('0x0'));var util=require(_0xbc5c('0x1'));var moment=require('moment');var BPromise=require(_0xbc5c('0x2'));var rs=require(_0xbc5c('0x3'));var fs=require('fs');var Redis=require(_0xbc5c('0x4'));var db=require(_0xbc5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc5c('0x6'))(_0xbc5c('0x7'));var config=require('../../config/environment');var jayson=require(_0xbc5c('0x8'));var client=jayson[_0xbc5c('0x9')][_0xbc5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35f7ab,_0x5842da,_0x12e7bf){return new BPromise(function(_0x4ed383,_0x5dda64){return client[_0xbc5c('0xb')](_0x35f7ab,_0x12e7bf)[_0xbc5c('0xc')](function(_0x1c0906){logger[_0xbc5c('0xd')](_0xbc5c('0xe'),_0x5842da,_0xbc5c('0xf'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x5842da,'request\x20sent',JSON[_0xbc5c('0x10')](_0x1c0906));if(_0x1c0906[_0xbc5c('0x11')]){if(_0x1c0906[_0xbc5c('0x11')][_0xbc5c('0x12')]===0x1f4){logger[_0xbc5c('0x11')](_0xbc5c('0xe'),_0x5842da,_0x1c0906[_0xbc5c('0x11')][_0xbc5c('0x13')]);return _0x5dda64(_0x1c0906['error']['message']);}logger[_0xbc5c('0x11')](_0xbc5c('0xe'),_0x5842da,_0x1c0906[_0xbc5c('0x11')][_0xbc5c('0x13')]);return _0x4ed383(_0x1c0906[_0xbc5c('0x11')][_0xbc5c('0x13')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5842da,'request\x20sent');_0x4ed383(_0x1c0906[_0xbc5c('0x14')][_0xbc5c('0x13')]);}})[_0xbc5c('0x15')](function(_0x517250){logger[_0xbc5c('0x11')](_0xbc5c('0xe'),_0x5842da,_0x517250);_0x5dda64(_0x517250);});});}exports[_0xbc5c('0x16')]=function(_0x174f9b){var _0x778d0d=this;return new Promise(function(_0x3bef14,_0x189473){return db[_0xbc5c('0x17')][_0xbc5c('0x18')]({'raw':_0x174f9b[_0xbc5c('0x19')]?_0x174f9b['options'][_0xbc5c('0x1a')]===undefined?!![]:![]:!![],'where':_0x174f9b[_0xbc5c('0x19')]?_0x174f9b[_0xbc5c('0x19')][_0xbc5c('0x1b')]||null:null,'attributes':_0x174f9b[_0xbc5c('0x19')]?_0x174f9b[_0xbc5c('0x19')][_0xbc5c('0x1c')]||null:null,'include':_0x174f9b[_0xbc5c('0x19')]?_0x174f9b[_0xbc5c('0x19')][_0xbc5c('0x1d')]?_['map'](_0x174f9b['options'][_0xbc5c('0x1d')],function(_0x4d7735){return{'model':db[_0x4d7735['model']],'as':_0x4d7735['as'],'attributes':_0x4d7735[_0xbc5c('0x1c')],'include':_0x4d7735[_0xbc5c('0x1d')]?_[_0xbc5c('0x1e')](_0x4d7735['include'],function(_0x61ecfe){return{'model':db[_0x61ecfe[_0xbc5c('0x1f')]],'as':_0x61ecfe['as'],'attributes':_0x61ecfe['attributes'],'include':_0x61ecfe['include']?_[_0xbc5c('0x1e')](_0x61ecfe[_0xbc5c('0x1d')],function(_0x193f1e){return{'model':db[_0x193f1e[_0xbc5c('0x1f')]],'as':_0x193f1e['as'],'attributes':_0x193f1e[_0xbc5c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbc5c('0xc')](function(_0x3f387c){logger['info'](_0xbc5c('0x16'),_0x174f9b);logger[_0xbc5c('0x20')]('ShowSetting',_0x174f9b,JSON[_0xbc5c('0x10')](_0x3f387c));_0x3bef14(_0x3f387c);})[_0xbc5c('0x15')](function(_0xf45ae4){logger[_0xbc5c('0x11')](_0xbc5c('0x16'),_0xf45ae4[_0xbc5c('0x13')],_0x174f9b);_0x189473(_0x778d0d[_0xbc5c('0x11')](0x1f4,_0xf45ae4[_0xbc5c('0x13')]));});});};
\ No newline at end of file
+var _0xa876=['error','code','message','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2990de,_0x551395){var _0x29149f=function(_0x3c8886){while(--_0x3c8886){_0x2990de['push'](_0x2990de['shift']());}};_0x29149f(++_0x551395);}(_0xa876,0xed));var _0x6a87=function(_0x352c4d,_0x5ba677){_0x352c4d=_0x352c4d-0x0;var _0x4cec00=_0xa876[_0x352c4d];return _0x4cec00;};'use strict';var _=require(_0x6a87('0x0'));var util=require(_0x6a87('0x1'));var moment=require(_0x6a87('0x2'));var BPromise=require(_0x6a87('0x3'));var rs=require(_0x6a87('0x4'));var fs=require('fs');var Redis=require(_0x6a87('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6a87('0x6'))(_0x6a87('0x7'));var config=require(_0x6a87('0x8'));var jayson=require(_0x6a87('0x9'));var client=jayson[_0x6a87('0xa')][_0x6a87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5286fd,_0x49b950,_0x1761b3){return new BPromise(function(_0x264b7b,_0x5168a0){return client['request'](_0x5286fd,_0x1761b3)[_0x6a87('0xc')](function(_0x39afa6){logger[_0x6a87('0xd')](_0x6a87('0xe'),_0x49b950,_0x6a87('0xf'));logger[_0x6a87('0x10')](_0x6a87('0x11'),_0x49b950,'request\x20sent',JSON[_0x6a87('0x12')](_0x39afa6));if(_0x39afa6[_0x6a87('0x13')]){if(_0x39afa6[_0x6a87('0x13')][_0x6a87('0x14')]===0x1f4){logger[_0x6a87('0x13')](_0x6a87('0xe'),_0x49b950,_0x39afa6[_0x6a87('0x13')]['message']);return _0x5168a0(_0x39afa6[_0x6a87('0x13')][_0x6a87('0x15')]);}logger[_0x6a87('0x13')]('Setting,\x20%s,\x20%s',_0x49b950,_0x39afa6[_0x6a87('0x13')][_0x6a87('0x15')]);return _0x264b7b(_0x39afa6[_0x6a87('0x13')][_0x6a87('0x15')]);}else{logger[_0x6a87('0xd')]('Setting,\x20%s,\x20%s',_0x49b950,_0x6a87('0xf'));_0x264b7b(_0x39afa6['result'][_0x6a87('0x15')]);}})[_0x6a87('0x16')](function(_0x5b9212){logger['error'](_0x6a87('0xe'),_0x49b950,_0x5b9212);_0x5168a0(_0x5b9212);});});}exports[_0x6a87('0x17')]=function(_0x4d06f6){var _0x3ad07e=this;return new Promise(function(_0x46a08b,_0xbc0942){return db[_0x6a87('0x18')][_0x6a87('0x19')]({'raw':_0x4d06f6[_0x6a87('0x1a')]?_0x4d06f6[_0x6a87('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4d06f6['options']?_0x4d06f6[_0x6a87('0x1a')][_0x6a87('0x1b')]||null:null,'attributes':_0x4d06f6[_0x6a87('0x1a')]?_0x4d06f6['options'][_0x6a87('0x1c')]||null:null,'include':_0x4d06f6[_0x6a87('0x1a')]?_0x4d06f6[_0x6a87('0x1a')][_0x6a87('0x1d')]?_[_0x6a87('0x1e')](_0x4d06f6[_0x6a87('0x1a')]['include'],function(_0x11e11d){return{'model':db[_0x11e11d['model']],'as':_0x11e11d['as'],'attributes':_0x11e11d[_0x6a87('0x1c')],'include':_0x11e11d[_0x6a87('0x1d')]?_[_0x6a87('0x1e')](_0x11e11d['include'],function(_0x367ae3){return{'model':db[_0x367ae3[_0x6a87('0x1f')]],'as':_0x367ae3['as'],'attributes':_0x367ae3['attributes'],'include':_0x367ae3[_0x6a87('0x1d')]?_[_0x6a87('0x1e')](_0x367ae3['include'],function(_0x239740){return{'model':db[_0x239740[_0x6a87('0x1f')]],'as':_0x239740['as'],'attributes':_0x239740[_0x6a87('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55ef93){logger[_0x6a87('0xd')](_0x6a87('0x17'),_0x4d06f6);logger[_0x6a87('0x10')](_0x6a87('0x17'),_0x4d06f6,JSON[_0x6a87('0x12')](_0x55ef93));_0x46a08b(_0x55ef93);})[_0x6a87('0x16')](function(_0x469a36){logger[_0x6a87('0x13')](_0x6a87('0x17'),_0x469a36['message'],_0x4d06f6);_0xbc0942(_0x3ad07e['error'](0x1f4,_0x469a36[_0x6a87('0x15')]));});});};
\ No newline at end of file