Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / setting / setting.rpc.js
index f16e873..fb46e9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6612=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','find','options','raw','where','attributes','include','model','map','debug','ShowSetting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x32be39,_0x251f3c){var _0x2ad962=function(_0x292dc5){while(--_0x292dc5){_0x32be39['push'](_0x32be39['shift']());}};_0x2ad962(++_0x251f3c);}(_0x6612,0x106));var _0x2661=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x6612[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x2661('0x0'));var util=require('util');var moment=require(_0x2661('0x1'));var BPromise=require(_0x2661('0x2'));var rs=require(_0x2661('0x3'));var fs=require('fs');var Redis=require(_0x2661('0x4'));var db=require(_0x2661('0x5'))['db'];var utils=require(_0x2661('0x6'));var logger=require(_0x2661('0x7'))(_0x2661('0x8'));var config=require('../../config/environment');var jayson=require(_0x2661('0x9'));var client=jayson['client'][_0x2661('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b3658,_0x5f0540,_0x46f4ee){return new BPromise(function(_0x3ea8bf,_0x5062f7){return client[_0x2661('0xb')](_0x2b3658,_0x46f4ee)[_0x2661('0xc')](function(_0x32a1a8){logger[_0x2661('0xd')](_0x2661('0xe'),_0x5f0540,_0x2661('0xf'));logger['debug'](_0x2661('0x10'),_0x5f0540,_0x2661('0xf'),JSON[_0x2661('0x11')](_0x32a1a8));if(_0x32a1a8[_0x2661('0x12')]){if(_0x32a1a8[_0x2661('0x12')][_0x2661('0x13')]===0x1f4){logger[_0x2661('0x12')]('Setting,\x20%s,\x20%s',_0x5f0540,_0x32a1a8[_0x2661('0x12')][_0x2661('0x14')]);return _0x5062f7(_0x32a1a8[_0x2661('0x12')][_0x2661('0x14')]);}logger[_0x2661('0x12')](_0x2661('0xe'),_0x5f0540,_0x32a1a8[_0x2661('0x12')][_0x2661('0x14')]);return _0x3ea8bf(_0x32a1a8[_0x2661('0x12')]['message']);}else{logger['info']('Setting,\x20%s,\x20%s',_0x5f0540,_0x2661('0xf'));_0x3ea8bf(_0x32a1a8[_0x2661('0x15')][_0x2661('0x14')]);}})[_0x2661('0x16')](function(_0x2cde2f){logger[_0x2661('0x12')]('Setting,\x20%s,\x20%s',_0x5f0540,_0x2cde2f);_0x5062f7(_0x2cde2f);});});}exports['ShowSetting']=function(_0x23bbc8){var _0x24a73f=this;return new Promise(function(_0x218592,_0x28b66c){return db[_0x2661('0x17')][_0x2661('0x18')]({'raw':_0x23bbc8[_0x2661('0x19')]?_0x23bbc8[_0x2661('0x19')][_0x2661('0x1a')]===undefined?!![]:![]:!![],'where':_0x23bbc8[_0x2661('0x19')]?_0x23bbc8['options'][_0x2661('0x1b')]||null:null,'attributes':_0x23bbc8['options']?_0x23bbc8[_0x2661('0x19')][_0x2661('0x1c')]||null:null,'include':_0x23bbc8[_0x2661('0x19')]?_0x23bbc8[_0x2661('0x19')][_0x2661('0x1d')]?_['map'](_0x23bbc8['options'][_0x2661('0x1d')],function(_0x1adbad){return{'model':db[_0x1adbad[_0x2661('0x1e')]],'as':_0x1adbad['as'],'attributes':_0x1adbad[_0x2661('0x1c')],'include':_0x1adbad[_0x2661('0x1d')]?_['map'](_0x1adbad['include'],function(_0x10645f){return{'model':db[_0x10645f['model']],'as':_0x10645f['as'],'attributes':_0x10645f['attributes'],'include':_0x10645f[_0x2661('0x1d')]?_[_0x2661('0x1f')](_0x10645f[_0x2661('0x1d')],function(_0x1f291c){return{'model':db[_0x1f291c[_0x2661('0x1e')]],'as':_0x1f291c['as'],'attributes':_0x1f291c[_0x2661('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2661('0xc')](function(_0x4db002){logger[_0x2661('0xd')]('ShowSetting',_0x23bbc8);logger[_0x2661('0x20')](_0x2661('0x21'),_0x23bbc8,JSON['stringify'](_0x4db002));_0x218592(_0x4db002);})[_0x2661('0x16')](function(_0x1ecd92){logger[_0x2661('0x12')](_0x2661('0x21'),_0x1ecd92[_0x2661('0x14')],_0x23bbc8);_0x28b66c(_0x24a73f[_0x2661('0x12')](0x1f4,_0x1ecd92[_0x2661('0x14')]));});});};
\ No newline at end of file
+var _0x2cc1=['model','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../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','include','map'];(function(_0x231c4b,_0xca7fc2){var _0x478db0=function(_0x23ca99){while(--_0x23ca99){_0x231c4b['push'](_0x231c4b['shift']());}};_0x478db0(++_0xca7fc2);}(_0x2cc1,0x18f));var _0x12cc=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x2cc1[_0x1c546c];return _0x2cc384;};'use strict';var _=require('lodash');var util=require(_0x12cc('0x0'));var moment=require(_0x12cc('0x1'));var BPromise=require(_0x12cc('0x2'));var rs=require(_0x12cc('0x3'));var fs=require('fs');var Redis=require(_0x12cc('0x4'));var db=require(_0x12cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x12cc('0x6'))(_0x12cc('0x7'));var config=require(_0x12cc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x12cc('0x9')][_0x12cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4648c8,_0x444909,_0x1deff1){return new BPromise(function(_0x361281,_0x246b26){return client[_0x12cc('0xb')](_0x4648c8,_0x1deff1)['then'](function(_0x58c5af){logger[_0x12cc('0xc')]('Setting,\x20%s,\x20%s',_0x444909,_0x12cc('0xd'));logger[_0x12cc('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x444909,_0x12cc('0xd'),JSON['stringify'](_0x58c5af));if(_0x58c5af[_0x12cc('0xf')]){if(_0x58c5af[_0x12cc('0xf')][_0x12cc('0x10')]===0x1f4){logger[_0x12cc('0xf')](_0x12cc('0x11'),_0x444909,_0x58c5af[_0x12cc('0xf')][_0x12cc('0x12')]);return _0x246b26(_0x58c5af[_0x12cc('0xf')][_0x12cc('0x12')]);}logger['error'](_0x12cc('0x11'),_0x444909,_0x58c5af['error'][_0x12cc('0x12')]);return _0x361281(_0x58c5af[_0x12cc('0xf')]['message']);}else{logger[_0x12cc('0xc')](_0x12cc('0x11'),_0x444909,_0x12cc('0xd'));_0x361281(_0x58c5af[_0x12cc('0x13')][_0x12cc('0x12')]);}})[_0x12cc('0x14')](function(_0x33ac28){logger[_0x12cc('0xf')]('Setting,\x20%s,\x20%s',_0x444909,_0x33ac28);_0x246b26(_0x33ac28);});});}exports[_0x12cc('0x15')]=function(_0x57f2a9){var _0x10b008=this;return new Promise(function(_0xf9aca1,_0x56b815){return db[_0x12cc('0x16')][_0x12cc('0x17')]({'raw':_0x57f2a9[_0x12cc('0x18')]?_0x57f2a9[_0x12cc('0x18')][_0x12cc('0x19')]===undefined?!![]:![]:!![],'where':_0x57f2a9['options']?_0x57f2a9[_0x12cc('0x18')][_0x12cc('0x1a')]||null:null,'attributes':_0x57f2a9[_0x12cc('0x18')]?_0x57f2a9[_0x12cc('0x18')][_0x12cc('0x1b')]||null:null,'include':_0x57f2a9[_0x12cc('0x18')]?_0x57f2a9[_0x12cc('0x18')][_0x12cc('0x1c')]?_[_0x12cc('0x1d')](_0x57f2a9[_0x12cc('0x18')][_0x12cc('0x1c')],function(_0x2427a1){return{'model':db[_0x2427a1['model']],'as':_0x2427a1['as'],'attributes':_0x2427a1[_0x12cc('0x1b')],'include':_0x2427a1[_0x12cc('0x1c')]?_[_0x12cc('0x1d')](_0x2427a1[_0x12cc('0x1c')],function(_0x20e0aa){return{'model':db[_0x20e0aa[_0x12cc('0x1e')]],'as':_0x20e0aa['as'],'attributes':_0x20e0aa[_0x12cc('0x1b')],'include':_0x20e0aa[_0x12cc('0x1c')]?_[_0x12cc('0x1d')](_0x20e0aa[_0x12cc('0x1c')],function(_0x3ea4e2){return{'model':db[_0x3ea4e2[_0x12cc('0x1e')]],'as':_0x3ea4e2['as'],'attributes':_0x3ea4e2[_0x12cc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12cc('0x1f')](function(_0x20319c){logger[_0x12cc('0xc')](_0x12cc('0x15'),_0x57f2a9);logger[_0x12cc('0xe')](_0x12cc('0x15'),_0x57f2a9,JSON[_0x12cc('0x20')](_0x20319c));_0xf9aca1(_0x20319c);})[_0x12cc('0x14')](function(_0x3df009){logger['error'](_0x12cc('0x15'),_0x3df009[_0x12cc('0x12')],_0x57f2a9);_0x56b815(_0x10b008['error'](0x1f4,_0x3df009['message']));});});};
\ No newline at end of file