Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / template / template.rpc.js
index 824dc6b..f592761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','catch','util','moment','ioredis'];(function(_0x864548,_0xfd2b6f){var _0x4af523=function(_0x311eaa){while(--_0x311eaa){_0x864548['push'](_0x864548['shift']());}};_0x4af523(++_0xfd2b6f);}(_0x61a4,0xc3));var _0x461a=function(_0x322628,_0x2e8c6e){_0x322628=_0x322628-0x0;var _0x43e1c4=_0x61a4[_0x322628];return _0x43e1c4;};'use strict';var _=require('lodash');var util=require(_0x461a('0x0'));var moment=require(_0x461a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x461a('0x2'));var db=require(_0x461a('0x3'))['db'];var utils=require(_0x461a('0x4'));var logger=require(_0x461a('0x5'))(_0x461a('0x6'));var config=require(_0x461a('0x7'));var jayson=require(_0x461a('0x8'));var client=jayson['client'][_0x461a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26120f,_0x7d9377,_0x3d897c){return new BPromise(function(_0x30219b,_0x5b648d){return client['request'](_0x26120f,_0x3d897c)[_0x461a('0xa')](function(_0x562bd7){logger['info'](_0x461a('0xb'),_0x7d9377,'request\x20sent');logger[_0x461a('0xc')](_0x461a('0xd'),_0x7d9377,_0x461a('0xe'),JSON[_0x461a('0xf')](_0x562bd7));if(_0x562bd7['error']){if(_0x562bd7[_0x461a('0x10')][_0x461a('0x11')]===0x1f4){logger['error'](_0x461a('0xb'),_0x7d9377,_0x562bd7[_0x461a('0x10')][_0x461a('0x12')]);return _0x5b648d(_0x562bd7[_0x461a('0x10')][_0x461a('0x12')]);}logger[_0x461a('0x10')]('Template,\x20%s,\x20%s',_0x7d9377,_0x562bd7['error'][_0x461a('0x12')]);return _0x30219b(_0x562bd7[_0x461a('0x10')][_0x461a('0x12')]);}else{logger[_0x461a('0x13')](_0x461a('0xb'),_0x7d9377,_0x461a('0xe'));_0x30219b(_0x562bd7[_0x461a('0x14')][_0x461a('0x12')]);}})['catch'](function(_0x4b90f2){logger['error'](_0x461a('0xb'),_0x7d9377,_0x4b90f2);_0x5b648d(_0x4b90f2);});});}exports[_0x461a('0x15')]=function(_0x594f39){var _0x9ecdc9=this;return new Promise(function(_0x3c94ec,_0x17e9b0){return db[_0x461a('0x16')][_0x461a('0x17')]({'raw':_0x594f39['options']?_0x594f39[_0x461a('0x18')][_0x461a('0x19')]===undefined?!![]:![]:!![],'where':_0x594f39[_0x461a('0x18')]?_0x594f39[_0x461a('0x18')][_0x461a('0x1a')]||null:null,'attributes':_0x594f39[_0x461a('0x18')]?_0x594f39['options'][_0x461a('0x1b')]||null:null,'limit':_0x594f39[_0x461a('0x18')]?_0x594f39[_0x461a('0x18')][_0x461a('0x1c')]||null:null,'include':_0x594f39[_0x461a('0x18')]?_0x594f39[_0x461a('0x18')][_0x461a('0x1d')]?_[_0x461a('0x1e')](_0x594f39[_0x461a('0x18')]['include'],function(_0x22cc4b){return{'model':db[_0x22cc4b[_0x461a('0x1f')]],'as':_0x22cc4b['as'],'attributes':_0x22cc4b[_0x461a('0x1b')],'include':_0x22cc4b['include']?_[_0x461a('0x1e')](_0x22cc4b[_0x461a('0x1d')],function(_0x47d3fc){return{'model':db[_0x47d3fc[_0x461a('0x1f')]],'as':_0x47d3fc['as'],'attributes':_0x47d3fc[_0x461a('0x1b')],'include':_0x47d3fc[_0x461a('0x1d')]?_[_0x461a('0x1e')](_0x47d3fc[_0x461a('0x1d')],function(_0x2e9a8a){return{'model':db[_0x2e9a8a[_0x461a('0x1f')]],'as':_0x2e9a8a['as'],'attributes':_0x2e9a8a[_0x461a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13459b){logger[_0x461a('0x13')]('GetTemplate',_0x594f39);logger[_0x461a('0xc')]('GetTemplate',_0x594f39,JSON[_0x461a('0xf')](_0x13459b));_0x3c94ec(_0x13459b);})[_0x461a('0x20')](function(_0x1efba2){logger[_0x461a('0x10')](_0x461a('0x15'),_0x1efba2[_0x461a('0x12')],_0x594f39);_0x17e9b0(_0x9ecdc9[_0x461a('0x10')](0x1f4,_0x1efba2[_0x461a('0x12')]));});});};
\ No newline at end of file
+var _0x2739=['message','result','catch','GetTemplate','Template','findAll','raw','options','where','attributes','include','map','model','then','info','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x2739,0x8b));var _0x9273=function(_0x43c00e,_0x1a5541){_0x43c00e=_0x43c00e-0x0;var _0x1c1151=_0x2739[_0x43c00e];return _0x1c1151;};'use strict';var _=require(_0x9273('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9273('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9273('0x2'));var logger=require(_0x9273('0x3'))('rpc');var config=require(_0x9273('0x4'));var jayson=require(_0x9273('0x5'));var client=jayson[_0x9273('0x6')][_0x9273('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe2742,_0x2f56cb,_0x63aa14){return new BPromise(function(_0x5287b2,_0x82109d){return client[_0x9273('0x8')](_0xfe2742,_0x63aa14)['then'](function(_0x538c6f){logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));logger[_0x9273('0xb')](_0x9273('0xc'),_0x2f56cb,_0x9273('0xa'),JSON[_0x9273('0xd')](_0x538c6f));if(_0x538c6f[_0x9273('0xe')]){if(_0x538c6f[_0x9273('0xe')][_0x9273('0xf')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x2f56cb,_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);return _0x82109d(_0x538c6f[_0x9273('0xe')]['message']);}logger[_0x9273('0xe')]('Template,\x20%s,\x20%s',_0x2f56cb,_0x538c6f['error'][_0x9273('0x10')]);return _0x5287b2(_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);}else{logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));_0x5287b2(_0x538c6f[_0x9273('0x11')][_0x9273('0x10')]);}})[_0x9273('0x12')](function(_0x19cfa7){logger[_0x9273('0xe')](_0x9273('0x9'),_0x2f56cb,_0x19cfa7);_0x82109d(_0x19cfa7);});});}exports[_0x9273('0x13')]=function(_0x541da4){var _0x3f555a=this;return new Promise(function(_0x4f33df,_0x399cf4){return db[_0x9273('0x14')][_0x9273('0x15')]({'raw':_0x541da4['options']?_0x541da4['options'][_0x9273('0x16')]===undefined?!![]:![]:!![],'where':_0x541da4['options']?_0x541da4[_0x9273('0x17')][_0x9273('0x18')]||null:null,'attributes':_0x541da4['options']?_0x541da4['options'][_0x9273('0x19')]||null:null,'limit':_0x541da4[_0x9273('0x17')]?_0x541da4[_0x9273('0x17')]['limit']||null:null,'include':_0x541da4['options']?_0x541da4[_0x9273('0x17')][_0x9273('0x1a')]?_[_0x9273('0x1b')](_0x541da4[_0x9273('0x17')][_0x9273('0x1a')],function(_0x201ae6){return{'model':db[_0x201ae6[_0x9273('0x1c')]],'as':_0x201ae6['as'],'attributes':_0x201ae6[_0x9273('0x19')],'include':_0x201ae6[_0x9273('0x1a')]?_['map'](_0x201ae6[_0x9273('0x1a')],function(_0x2c9607){return{'model':db[_0x2c9607['model']],'as':_0x2c9607['as'],'attributes':_0x2c9607[_0x9273('0x19')],'include':_0x2c9607[_0x9273('0x1a')]?_[_0x9273('0x1b')](_0x2c9607[_0x9273('0x1a')],function(_0x1c6dcb){return{'model':db[_0x1c6dcb[_0x9273('0x1c')]],'as':_0x1c6dcb['as'],'attributes':_0x1c6dcb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9273('0x1d')](function(_0x392ea6){logger[_0x9273('0x1e')]('GetTemplate',_0x541da4);logger[_0x9273('0xb')](_0x9273('0x13'),_0x541da4,JSON[_0x9273('0xd')](_0x392ea6));_0x4f33df(_0x392ea6);})[_0x9273('0x12')](function(_0x13bdeb){logger[_0x9273('0xe')](_0x9273('0x13'),_0x13bdeb[_0x9273('0x10')],_0x541da4);_0x399cf4(_0x3f555a[_0x9273('0xe')](0x1f4,_0x13bdeb[_0x9273('0x10')]));});});};
\ No newline at end of file