Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / template / template.rpc.js
index 48b4602..4d95393 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 _0x0e90=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x0e90,0x176));var _0x00e9=function(_0x39b37b,_0x59a375){_0x39b37b=_0x39b37b-0x0;var _0xad65ae=_0x0e90[_0x39b37b];return _0xad65ae;};'use strict';var _=require(_0x00e9('0x0'));var util=require(_0x00e9('0x1'));var moment=require(_0x00e9('0x2'));var BPromise=require(_0x00e9('0x3'));var rs=require(_0x00e9('0x4'));var fs=require('fs');var Redis=require(_0x00e9('0x5'));var db=require(_0x00e9('0x6'))['db'];var utils=require(_0x00e9('0x7'));var logger=require(_0x00e9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x00e9('0x9'));var client=jayson[_0x00e9('0xa')][_0x00e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x493c76,_0x123014,_0x46f846){return new BPromise(function(_0x17de3a,_0x37841b){return client[_0x00e9('0xc')](_0x493c76,_0x46f846)[_0x00e9('0xd')](function(_0x3e0dd8){logger[_0x00e9('0xe')](_0x00e9('0xf'),_0x123014,'request\x20sent');logger[_0x00e9('0x10')](_0x00e9('0x11'),_0x123014,_0x00e9('0x12'),JSON['stringify'](_0x3e0dd8));if(_0x3e0dd8[_0x00e9('0x13')]){if(_0x3e0dd8[_0x00e9('0x13')]['code']===0x1f4){logger[_0x00e9('0x13')](_0x00e9('0xf'),_0x123014,_0x3e0dd8[_0x00e9('0x13')][_0x00e9('0x14')]);return _0x37841b(_0x3e0dd8[_0x00e9('0x13')][_0x00e9('0x14')]);}logger[_0x00e9('0x13')]('Template,\x20%s,\x20%s',_0x123014,_0x3e0dd8[_0x00e9('0x13')]['message']);return _0x17de3a(_0x3e0dd8[_0x00e9('0x13')][_0x00e9('0x14')]);}else{logger[_0x00e9('0xe')](_0x00e9('0xf'),_0x123014,_0x00e9('0x12'));_0x17de3a(_0x3e0dd8[_0x00e9('0x15')][_0x00e9('0x14')]);}})[_0x00e9('0x16')](function(_0x1dfcfe){logger[_0x00e9('0x13')](_0x00e9('0xf'),_0x123014,_0x1dfcfe);_0x37841b(_0x1dfcfe);});});}exports[_0x00e9('0x17')]=function(_0x539eef){var _0x359fd2=this;return new Promise(function(_0x570876,_0xa6910f){return db[_0x00e9('0x18')]['findAll']({'raw':_0x539eef['options']?_0x539eef[_0x00e9('0x19')][_0x00e9('0x1a')]===undefined?!![]:![]:!![],'where':_0x539eef[_0x00e9('0x19')]?_0x539eef['options'][_0x00e9('0x1b')]||null:null,'attributes':_0x539eef[_0x00e9('0x19')]?_0x539eef[_0x00e9('0x19')][_0x00e9('0x1c')]||null:null,'limit':_0x539eef['options']?_0x539eef['options'][_0x00e9('0x1d')]||null:null,'include':_0x539eef[_0x00e9('0x19')]?_0x539eef['options'][_0x00e9('0x1e')]?_[_0x00e9('0x1f')](_0x539eef['options']['include'],function(_0x4eec4d){return{'model':db[_0x4eec4d[_0x00e9('0x20')]],'as':_0x4eec4d['as'],'attributes':_0x4eec4d[_0x00e9('0x1c')],'include':_0x4eec4d[_0x00e9('0x1e')]?_[_0x00e9('0x1f')](_0x4eec4d[_0x00e9('0x1e')],function(_0x5b1ac1){return{'model':db[_0x5b1ac1[_0x00e9('0x20')]],'as':_0x5b1ac1['as'],'attributes':_0x5b1ac1[_0x00e9('0x1c')],'include':_0x5b1ac1[_0x00e9('0x1e')]?_[_0x00e9('0x1f')](_0x5b1ac1['include'],function(_0x4b7266){return{'model':db[_0x4b7266[_0x00e9('0x20')]],'as':_0x4b7266['as'],'attributes':_0x4b7266[_0x00e9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x00e9('0xd')](function(_0x845c44){logger[_0x00e9('0xe')](_0x00e9('0x17'),_0x539eef);logger[_0x00e9('0x10')](_0x00e9('0x17'),_0x539eef,JSON[_0x00e9('0x21')](_0x845c44));_0x570876(_0x845c44);})[_0x00e9('0x16')](function(_0x470c19){logger[_0x00e9('0x13')](_0x00e9('0x17'),_0x470c19['message'],_0x539eef);_0xa6910f(_0x359fd2[_0x00e9('0x13')](0x1f4,_0x470c19[_0x00e9('0x14')]));});});};
\ No newline at end of file