Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / template / template.rpc.js
index 48b4602..3bd723c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcaf=['request\x20sent','stringify','error','message','GetTemplate','Template','options','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s'];(function(_0x542588,_0x4305c9){var _0xf24784=function(_0x13ea9d){while(--_0x13ea9d){_0x542588['push'](_0x542588['shift']());}};_0xf24784(++_0x4305c9);}(_0xfcaf,0x1c0));var _0xffca=function(_0x241b5a,_0x5ac06c){_0x241b5a=_0x241b5a-0x0;var _0x49fff8=_0xfcaf[_0x241b5a];return _0x49fff8;};'use strict';var _=require(_0xffca('0x0'));var util=require(_0xffca('0x1'));var moment=require(_0xffca('0x2'));var BPromise=require(_0xffca('0x3'));var rs=require(_0xffca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffca('0x5'))['db'];var utils=require(_0xffca('0x6'));var logger=require('../../config/logger')(_0xffca('0x7'));var config=require('../../config/environment');var jayson=require(_0xffca('0x8'));var client=jayson[_0xffca('0x9')][_0xffca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a865a,_0x2a6c16,_0x6261f2){return new BPromise(function(_0x15711d,_0x5965f8){return client['request'](_0x3a865a,_0x6261f2)[_0xffca('0xb')](function(_0x503dc2){logger[_0xffca('0xc')](_0xffca('0xd'),_0x2a6c16,'request\x20sent');logger[_0xffca('0xe')](_0xffca('0xf'),_0x2a6c16,_0xffca('0x10'),JSON[_0xffca('0x11')](_0x503dc2));if(_0x503dc2[_0xffca('0x12')]){if(_0x503dc2[_0xffca('0x12')]['code']===0x1f4){logger[_0xffca('0x12')](_0xffca('0xd'),_0x2a6c16,_0x503dc2['error']['message']);return _0x5965f8(_0x503dc2['error'][_0xffca('0x13')]);}logger[_0xffca('0x12')](_0xffca('0xd'),_0x2a6c16,_0x503dc2[_0xffca('0x12')][_0xffca('0x13')]);return _0x15711d(_0x503dc2['error'][_0xffca('0x13')]);}else{logger['info'](_0xffca('0xd'),_0x2a6c16,'request\x20sent');_0x15711d(_0x503dc2['result'][_0xffca('0x13')]);}})['catch'](function(_0x582729){logger['error'](_0xffca('0xd'),_0x2a6c16,_0x582729);_0x5965f8(_0x582729);});});}exports[_0xffca('0x14')]=function(_0x4a0603){var _0x372abc=this;return new Promise(function(_0x5601ff,_0x5a4fc5){return db[_0xffca('0x15')]['findAll']({'raw':_0x4a0603[_0xffca('0x16')]?_0x4a0603[_0xffca('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4a0603['options']?_0x4a0603['options'][_0xffca('0x17')]||null:null,'attributes':_0x4a0603[_0xffca('0x16')]?_0x4a0603['options'][_0xffca('0x18')]||null:null,'limit':_0x4a0603['options']?_0x4a0603[_0xffca('0x16')][_0xffca('0x19')]||null:null,'include':_0x4a0603[_0xffca('0x16')]?_0x4a0603[_0xffca('0x16')][_0xffca('0x1a')]?_['map'](_0x4a0603[_0xffca('0x16')][_0xffca('0x1a')],function(_0xd75cfa){return{'model':db[_0xd75cfa[_0xffca('0x1b')]],'as':_0xd75cfa['as'],'attributes':_0xd75cfa[_0xffca('0x18')],'include':_0xd75cfa[_0xffca('0x1a')]?_[_0xffca('0x1c')](_0xd75cfa['include'],function(_0x3a9f92){return{'model':db[_0x3a9f92['model']],'as':_0x3a9f92['as'],'attributes':_0x3a9f92['attributes'],'include':_0x3a9f92[_0xffca('0x1a')]?_[_0xffca('0x1c')](_0x3a9f92[_0xffca('0x1a')],function(_0xafc56c){return{'model':db[_0xafc56c[_0xffca('0x1b')]],'as':_0xafc56c['as'],'attributes':_0xafc56c['attributes']};}):[]};}):[]};}):[]:[]})[_0xffca('0xb')](function(_0xfc0fb1){logger[_0xffca('0xc')](_0xffca('0x14'),_0x4a0603);logger[_0xffca('0xe')]('GetTemplate',_0x4a0603,JSON[_0xffca('0x11')](_0xfc0fb1));_0x5601ff(_0xfc0fb1);})['catch'](function(_0x36aab9){logger[_0xffca('0x12')](_0xffca('0x14'),_0x36aab9[_0xffca('0x13')],_0x4a0603);_0x5a4fc5(_0x372abc['error'](0x1f4,_0x36aab9['message']));});});};
\ No newline at end of file
+var _0x5139=['GetTemplate','findAll','options','raw','where','limit','attributes','include','map','model','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x37c80b,_0x5b90a5){var _0x4ea485=function(_0x27520f){while(--_0x27520f){_0x37c80b['push'](_0x37c80b['shift']());}};_0x4ea485(++_0x5b90a5);}(_0x5139,0x1db));var _0x9513=function(_0x41e3e7,_0x253246){_0x41e3e7=_0x41e3e7-0x0;var _0x40f52b=_0x5139[_0x41e3e7];return _0x40f52b;};'use strict';var _=require('lodash');var util=require(_0x9513('0x0'));var moment=require(_0x9513('0x1'));var BPromise=require(_0x9513('0x2'));var rs=require(_0x9513('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9513('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9513('0x5'))(_0x9513('0x6'));var config=require('../../config/environment');var jayson=require(_0x9513('0x7'));var client=jayson[_0x9513('0x8')][_0x9513('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3741cb,_0x52010f,_0x4b429b){return new BPromise(function(_0x3d24fd,_0x2fbf81){return client[_0x9513('0xa')](_0x3741cb,_0x4b429b)[_0x9513('0xb')](function(_0x3c025f){logger[_0x9513('0xc')](_0x9513('0xd'),_0x52010f,_0x9513('0xe'));logger[_0x9513('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x52010f,_0x9513('0xe'),JSON[_0x9513('0x10')](_0x3c025f));if(_0x3c025f[_0x9513('0x11')]){if(_0x3c025f[_0x9513('0x11')]['code']===0x1f4){logger[_0x9513('0x11')](_0x9513('0xd'),_0x52010f,_0x3c025f[_0x9513('0x11')]['message']);return _0x2fbf81(_0x3c025f['error'][_0x9513('0x12')]);}logger['error']('Template,\x20%s,\x20%s',_0x52010f,_0x3c025f[_0x9513('0x11')][_0x9513('0x12')]);return _0x3d24fd(_0x3c025f[_0x9513('0x11')]['message']);}else{logger[_0x9513('0xc')](_0x9513('0xd'),_0x52010f,_0x9513('0xe'));_0x3d24fd(_0x3c025f[_0x9513('0x13')]['message']);}})[_0x9513('0x14')](function(_0x58d601){logger[_0x9513('0x11')](_0x9513('0xd'),_0x52010f,_0x58d601);_0x2fbf81(_0x58d601);});});}exports[_0x9513('0x15')]=function(_0x726309){var _0x37f5a4=this;return new Promise(function(_0x125987,_0x2098d1){return db['Template'][_0x9513('0x16')]({'raw':_0x726309[_0x9513('0x17')]?_0x726309[_0x9513('0x17')][_0x9513('0x18')]===undefined?!![]:![]:!![],'where':_0x726309['options']?_0x726309[_0x9513('0x17')][_0x9513('0x19')]||null:null,'attributes':_0x726309[_0x9513('0x17')]?_0x726309['options']['attributes']||null:null,'limit':_0x726309[_0x9513('0x17')]?_0x726309[_0x9513('0x17')][_0x9513('0x1a')]||null:null,'include':_0x726309[_0x9513('0x17')]?_0x726309[_0x9513('0x17')]['include']?_['map'](_0x726309[_0x9513('0x17')]['include'],function(_0xb8af20){return{'model':db[_0xb8af20['model']],'as':_0xb8af20['as'],'attributes':_0xb8af20[_0x9513('0x1b')],'include':_0xb8af20[_0x9513('0x1c')]?_[_0x9513('0x1d')](_0xb8af20['include'],function(_0x2de67b){return{'model':db[_0x2de67b[_0x9513('0x1e')]],'as':_0x2de67b['as'],'attributes':_0x2de67b['attributes'],'include':_0x2de67b[_0x9513('0x1c')]?_[_0x9513('0x1d')](_0x2de67b['include'],function(_0x3d4cad){return{'model':db[_0x3d4cad[_0x9513('0x1e')]],'as':_0x3d4cad['as'],'attributes':_0x3d4cad[_0x9513('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9513('0xb')](function(_0x520e1f){logger['info'](_0x9513('0x15'),_0x726309);logger[_0x9513('0xf')](_0x9513('0x15'),_0x726309,JSON[_0x9513('0x10')](_0x520e1f));_0x125987(_0x520e1f);})['catch'](function(_0x253656){logger[_0x9513('0x11')](_0x9513('0x15'),_0x253656[_0x9513('0x12')],_0x726309);_0x2098d1(_0x37f5a4[_0x9513('0x11')](0x1f4,_0x253656['message']));});});};
\ No newline at end of file