Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / template / template.rpc.js
index 22d8bcc..03f27f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6207=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x9e3340,_0x24882b){var _0x33b2f8=function(_0x127846){while(--_0x127846){_0x9e3340['push'](_0x9e3340['shift']());}};_0x33b2f8(++_0x24882b);}(_0x6207,0xc0));var _0x7620=function(_0x238dc7,_0x4152ae){_0x238dc7=_0x238dc7-0x0;var _0x274da2=_0x6207[_0x238dc7];return _0x274da2;};'use strict';var _=require(_0x7620('0x0'));var util=require(_0x7620('0x1'));var moment=require(_0x7620('0x2'));var BPromise=require(_0x7620('0x3'));var rs=require(_0x7620('0x4'));var fs=require('fs');var Redis=require(_0x7620('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7620('0x6'));var logger=require(_0x7620('0x7'))(_0x7620('0x8'));var config=require(_0x7620('0x9'));var jayson=require(_0x7620('0xa'));var client=jayson[_0x7620('0xb')][_0x7620('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5499aa,_0x17f7b0,_0x45f3a3){return new BPromise(function(_0x5885dd,_0x1d8af3){return client[_0x7620('0xd')](_0x5499aa,_0x45f3a3)[_0x7620('0xe')](function(_0x4d9b5d){logger[_0x7620('0xf')](_0x7620('0x10'),_0x17f7b0,_0x7620('0x11'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x17f7b0,_0x7620('0x11'),JSON[_0x7620('0x12')](_0x4d9b5d));if(_0x4d9b5d[_0x7620('0x13')]){if(_0x4d9b5d[_0x7620('0x13')]['code']===0x1f4){logger[_0x7620('0x13')](_0x7620('0x10'),_0x17f7b0,_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);return _0x1d8af3(_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);}logger[_0x7620('0x13')](_0x7620('0x10'),_0x17f7b0,_0x4d9b5d[_0x7620('0x13')]['message']);return _0x5885dd(_0x4d9b5d[_0x7620('0x13')][_0x7620('0x14')]);}else{logger[_0x7620('0xf')]('Template,\x20%s,\x20%s',_0x17f7b0,'request\x20sent');_0x5885dd(_0x4d9b5d[_0x7620('0x15')][_0x7620('0x14')]);}})[_0x7620('0x16')](function(_0x58ad9a){logger['error']('Template,\x20%s,\x20%s',_0x17f7b0,_0x58ad9a);_0x1d8af3(_0x58ad9a);});});}exports[_0x7620('0x17')]=function(_0x31eff7){var _0xfb373e=this;return new Promise(function(_0x304dc5,_0x25aa31){return db[_0x7620('0x18')][_0x7620('0x19')]({'raw':_0x31eff7[_0x7620('0x1a')]?_0x31eff7['options']['raw']===undefined?!![]:![]:!![],'where':_0x31eff7['options']?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1b')]||null:null,'attributes':_0x31eff7[_0x7620('0x1a')]?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1c')]||null:null,'limit':_0x31eff7['options']?_0x31eff7['options'][_0x7620('0x1d')]||null:null,'include':_0x31eff7[_0x7620('0x1a')]?_0x31eff7[_0x7620('0x1a')][_0x7620('0x1e')]?_[_0x7620('0x1f')](_0x31eff7[_0x7620('0x1a')][_0x7620('0x1e')],function(_0x171f94){return{'model':db[_0x171f94[_0x7620('0x20')]],'as':_0x171f94['as'],'attributes':_0x171f94[_0x7620('0x1c')],'include':_0x171f94[_0x7620('0x1e')]?_[_0x7620('0x1f')](_0x171f94['include'],function(_0x36aa12){return{'model':db[_0x36aa12[_0x7620('0x20')]],'as':_0x36aa12['as'],'attributes':_0x36aa12[_0x7620('0x1c')],'include':_0x36aa12[_0x7620('0x1e')]?_['map'](_0x36aa12[_0x7620('0x1e')],function(_0x43c885){return{'model':db[_0x43c885[_0x7620('0x20')]],'as':_0x43c885['as'],'attributes':_0x43c885['attributes']};}):[]};}):[]};}):[]:[]})[_0x7620('0xe')](function(_0x444168){logger[_0x7620('0xf')]('GetTemplate',_0x31eff7);logger['debug'](_0x7620('0x17'),_0x31eff7,JSON[_0x7620('0x12')](_0x444168));_0x304dc5(_0x444168);})[_0x7620('0x16')](function(_0xe8d208){logger[_0x7620('0x13')](_0x7620('0x17'),_0xe8d208[_0x7620('0x14')],_0x31eff7);_0x25aa31(_0xfb373e[_0x7620('0x13')](0x1f4,_0xe8d208[_0x7620('0x14')]));});});};
\ No newline at end of file
+var _0xbacb=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','map','model','lodash','util','moment','randomstring'];(function(_0x3ad648,_0x20d769){var _0xcf3ff3=function(_0x5b7b90){while(--_0x5b7b90){_0x3ad648['push'](_0x3ad648['shift']());}};_0xcf3ff3(++_0x20d769);}(_0xbacb,0xa1));var _0xbbac=function(_0x30ec06,_0x4c6acf){_0x30ec06=_0x30ec06-0x0;var _0x571d3a=_0xbacb[_0x30ec06];return _0x571d3a;};'use strict';var _=require(_0xbbac('0x0'));var util=require(_0xbbac('0x1'));var moment=require(_0xbbac('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbac('0x3'));var fs=require('fs');var Redis=require(_0xbbac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbac('0x5'));var logger=require(_0xbbac('0x6'))(_0xbbac('0x7'));var config=require(_0xbbac('0x8'));var jayson=require(_0xbbac('0x9'));var client=jayson[_0xbbac('0xa')][_0xbbac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21ec30,_0x1895b6,_0x2a9d51){return new BPromise(function(_0xad13fb,_0x73f68d){return client['request'](_0x21ec30,_0x2a9d51)[_0xbbac('0xc')](function(_0x346e3d){logger[_0xbbac('0xd')](_0xbbac('0xe'),_0x1895b6,_0xbbac('0xf'));logger[_0xbbac('0x10')](_0xbbac('0x11'),_0x1895b6,'request\x20sent',JSON[_0xbbac('0x12')](_0x346e3d));if(_0x346e3d[_0xbbac('0x13')]){if(_0x346e3d['error'][_0xbbac('0x14')]===0x1f4){logger[_0xbbac('0x13')](_0xbbac('0xe'),_0x1895b6,_0x346e3d['error'][_0xbbac('0x15')]);return _0x73f68d(_0x346e3d[_0xbbac('0x13')][_0xbbac('0x15')]);}logger[_0xbbac('0x13')](_0xbbac('0xe'),_0x1895b6,_0x346e3d[_0xbbac('0x13')][_0xbbac('0x15')]);return _0xad13fb(_0x346e3d['error'][_0xbbac('0x15')]);}else{logger[_0xbbac('0xd')](_0xbbac('0xe'),_0x1895b6,_0xbbac('0xf'));_0xad13fb(_0x346e3d['result'][_0xbbac('0x15')]);}})[_0xbbac('0x16')](function(_0x2cf840){logger['error'](_0xbbac('0xe'),_0x1895b6,_0x2cf840);_0x73f68d(_0x2cf840);});});}exports[_0xbbac('0x17')]=function(_0x223485){var _0x1d86fc=this;return new Promise(function(_0x56b56f,_0xa4d929){return db[_0xbbac('0x18')][_0xbbac('0x19')]({'raw':_0x223485[_0xbbac('0x1a')]?_0x223485[_0xbbac('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x223485['options']?_0x223485[_0xbbac('0x1a')][_0xbbac('0x1b')]||null:null,'attributes':_0x223485['options']?_0x223485[_0xbbac('0x1a')][_0xbbac('0x1c')]||null:null,'limit':_0x223485['options']?_0x223485[_0xbbac('0x1a')][_0xbbac('0x1d')]||null:null,'include':_0x223485[_0xbbac('0x1a')]?_0x223485[_0xbbac('0x1a')][_0xbbac('0x1e')]?_[_0xbbac('0x1f')](_0x223485[_0xbbac('0x1a')][_0xbbac('0x1e')],function(_0x2ef11e){return{'model':db[_0x2ef11e[_0xbbac('0x20')]],'as':_0x2ef11e['as'],'attributes':_0x2ef11e[_0xbbac('0x1c')],'include':_0x2ef11e[_0xbbac('0x1e')]?_[_0xbbac('0x1f')](_0x2ef11e['include'],function(_0x37da3b){return{'model':db[_0x37da3b[_0xbbac('0x20')]],'as':_0x37da3b['as'],'attributes':_0x37da3b[_0xbbac('0x1c')],'include':_0x37da3b['include']?_[_0xbbac('0x1f')](_0x37da3b[_0xbbac('0x1e')],function(_0x259b24){return{'model':db[_0x259b24[_0xbbac('0x20')]],'as':_0x259b24['as'],'attributes':_0x259b24[_0xbbac('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbbac('0xc')](function(_0xfbe376){logger['info'](_0xbbac('0x17'),_0x223485);logger[_0xbbac('0x10')]('GetTemplate',_0x223485,JSON[_0xbbac('0x12')](_0xfbe376));_0x56b56f(_0xfbe376);})['catch'](function(_0x49a4a6){logger[_0xbbac('0x13')](_0xbbac('0x17'),_0x49a4a6[_0xbbac('0x15')],_0x223485);_0xa4d929(_0x1d86fc[_0xbbac('0x13')](0x1f4,_0x49a4a6[_0xbbac('0x15')]));});});};
\ No newline at end of file