Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / template / template.rpc.js
index 776958c..4d95393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7af=['Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw','where','limit','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code'];(function(_0xe220a1,_0x5398d6){var _0x2279b9=function(_0x258297){while(--_0x258297){_0xe220a1['push'](_0xe220a1['shift']());}};_0x2279b9(++_0x5398d6);}(_0xa7af,0x6a));var _0xfa7a=function(_0x5eab9b,_0x113241){_0x5eab9b=_0x5eab9b-0x0;var _0x16bbc5=_0xa7af[_0x5eab9b];return _0x16bbc5;};'use strict';var _=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var moment=require('moment');var BPromise=require(_0xfa7a('0x2'));var rs=require(_0xfa7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa7a('0x4'))['db'];var utils=require(_0xfa7a('0x5'));var logger=require(_0xfa7a('0x6'))('rpc');var config=require(_0xfa7a('0x7'));var jayson=require(_0xfa7a('0x8'));var client=jayson[_0xfa7a('0x9')][_0xfa7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f8ce7,_0x59541a,_0x364c75){return new BPromise(function(_0x95eff3,_0x1f808a){return client[_0xfa7a('0xb')](_0x1f8ce7,_0x364c75)[_0xfa7a('0xc')](function(_0x156e63){logger[_0xfa7a('0xd')]('Template,\x20%s,\x20%s',_0x59541a,'request\x20sent');logger[_0xfa7a('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x59541a,_0xfa7a('0xf'),JSON['stringify'](_0x156e63));if(_0x156e63[_0xfa7a('0x10')]){if(_0x156e63[_0xfa7a('0x10')][_0xfa7a('0x11')]===0x1f4){logger[_0xfa7a('0x10')](_0xfa7a('0x12'),_0x59541a,_0x156e63[_0xfa7a('0x10')][_0xfa7a('0x13')]);return _0x1f808a(_0x156e63['error'][_0xfa7a('0x13')]);}logger['error'](_0xfa7a('0x12'),_0x59541a,_0x156e63[_0xfa7a('0x10')][_0xfa7a('0x13')]);return _0x95eff3(_0x156e63[_0xfa7a('0x10')][_0xfa7a('0x13')]);}else{logger['info'](_0xfa7a('0x12'),_0x59541a,_0xfa7a('0xf'));_0x95eff3(_0x156e63[_0xfa7a('0x14')][_0xfa7a('0x13')]);}})[_0xfa7a('0x15')](function(_0x2a2273){logger['error']('Template,\x20%s,\x20%s',_0x59541a,_0x2a2273);_0x1f808a(_0x2a2273);});});}exports[_0xfa7a('0x16')]=function(_0x4a8622){var _0x1f1d24=this;return new Promise(function(_0x577db1,_0x3a1f66){return db['Template'][_0xfa7a('0x17')]({'raw':_0x4a8622[_0xfa7a('0x18')]?_0x4a8622[_0xfa7a('0x18')][_0xfa7a('0x19')]===undefined?!![]:![]:!![],'where':_0x4a8622[_0xfa7a('0x18')]?_0x4a8622[_0xfa7a('0x18')][_0xfa7a('0x1a')]||null:null,'attributes':_0x4a8622['options']?_0x4a8622['options']['attributes']||null:null,'limit':_0x4a8622[_0xfa7a('0x18')]?_0x4a8622[_0xfa7a('0x18')][_0xfa7a('0x1b')]||null:null,'include':_0x4a8622[_0xfa7a('0x18')]?_0x4a8622[_0xfa7a('0x18')][_0xfa7a('0x1c')]?_[_0xfa7a('0x1d')](_0x4a8622[_0xfa7a('0x18')][_0xfa7a('0x1c')],function(_0x1846f8){return{'model':db[_0x1846f8[_0xfa7a('0x1e')]],'as':_0x1846f8['as'],'attributes':_0x1846f8['attributes'],'include':_0x1846f8['include']?_[_0xfa7a('0x1d')](_0x1846f8[_0xfa7a('0x1c')],function(_0x2b41f3){return{'model':db[_0x2b41f3['model']],'as':_0x2b41f3['as'],'attributes':_0x2b41f3['attributes'],'include':_0x2b41f3['include']?_['map'](_0x2b41f3[_0xfa7a('0x1c')],function(_0x31ca67){return{'model':db[_0x31ca67[_0xfa7a('0x1e')]],'as':_0x31ca67['as'],'attributes':_0x31ca67['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa7a('0xc')](function(_0x2c3b7d){logger[_0xfa7a('0xd')](_0xfa7a('0x16'),_0x4a8622);logger[_0xfa7a('0xe')](_0xfa7a('0x16'),_0x4a8622,JSON['stringify'](_0x2c3b7d));_0x577db1(_0x2c3b7d);})[_0xfa7a('0x15')](function(_0x3434ba){logger['error']('GetTemplate',_0x3434ba[_0xfa7a('0x13')],_0x4a8622);_0x3a1f66(_0x1f1d24[_0xfa7a('0x10')](0x1f4,_0x3434ba[_0xfa7a('0x13')]));});});};
\ 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