Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / template / template.rpc.js
index 1456fa6..f592761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb6a=['error','code','message','result','catch','Template','findAll','options','raw','attributes','include','map','model','then','GetTemplate','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a53f0,_0x166510){var _0x124977=function(_0x57114e){while(--_0x57114e){_0x1a53f0['push'](_0x1a53f0['shift']());}};_0x124977(++_0x166510);}(_0xbb6a,0x76));var _0xabb6=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xbb6a[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xabb6('0x0'));var BPromise=require(_0xabb6('0x1'));var rs=require(_0xabb6('0x2'));var fs=require('fs');var Redis=require(_0xabb6('0x3'));var db=require(_0xabb6('0x4'))['db'];var utils=require(_0xabb6('0x5'));var logger=require(_0xabb6('0x6'))(_0xabb6('0x7'));var config=require(_0xabb6('0x8'));var jayson=require(_0xabb6('0x9'));var client=jayson[_0xabb6('0xa')][_0xabb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3428be,_0x497042,_0x2fe92d){return new BPromise(function(_0x5d4bbd,_0x205faa){return client[_0xabb6('0xc')](_0x3428be,_0x2fe92d)['then'](function(_0x2498e5){logger[_0xabb6('0xd')](_0xabb6('0xe'),_0x497042,_0xabb6('0xf'));logger['debug'](_0xabb6('0x10'),_0x497042,_0xabb6('0xf'),JSON[_0xabb6('0x11')](_0x2498e5));if(_0x2498e5[_0xabb6('0x12')]){if(_0x2498e5[_0xabb6('0x12')][_0xabb6('0x13')]===0x1f4){logger[_0xabb6('0x12')](_0xabb6('0xe'),_0x497042,_0x2498e5[_0xabb6('0x12')][_0xabb6('0x14')]);return _0x205faa(_0x2498e5[_0xabb6('0x12')][_0xabb6('0x14')]);}logger[_0xabb6('0x12')](_0xabb6('0xe'),_0x497042,_0x2498e5[_0xabb6('0x12')][_0xabb6('0x14')]);return _0x5d4bbd(_0x2498e5['error'][_0xabb6('0x14')]);}else{logger[_0xabb6('0xd')](_0xabb6('0xe'),_0x497042,'request\x20sent');_0x5d4bbd(_0x2498e5[_0xabb6('0x15')][_0xabb6('0x14')]);}})[_0xabb6('0x16')](function(_0x3c5696){logger[_0xabb6('0x12')](_0xabb6('0xe'),_0x497042,_0x3c5696);_0x205faa(_0x3c5696);});});}exports['GetTemplate']=function(_0x4b9435){var _0x585b76=this;return new Promise(function(_0x52bfa1,_0x4c8483){return db[_0xabb6('0x17')][_0xabb6('0x18')]({'raw':_0x4b9435[_0xabb6('0x19')]?_0x4b9435[_0xabb6('0x19')][_0xabb6('0x1a')]===undefined?!![]:![]:!![],'where':_0x4b9435[_0xabb6('0x19')]?_0x4b9435['options']['where']||null:null,'attributes':_0x4b9435[_0xabb6('0x19')]?_0x4b9435[_0xabb6('0x19')][_0xabb6('0x1b')]||null:null,'limit':_0x4b9435[_0xabb6('0x19')]?_0x4b9435[_0xabb6('0x19')]['limit']||null:null,'include':_0x4b9435[_0xabb6('0x19')]?_0x4b9435[_0xabb6('0x19')][_0xabb6('0x1c')]?_[_0xabb6('0x1d')](_0x4b9435[_0xabb6('0x19')][_0xabb6('0x1c')],function(_0x2cf653){return{'model':db[_0x2cf653[_0xabb6('0x1e')]],'as':_0x2cf653['as'],'attributes':_0x2cf653['attributes'],'include':_0x2cf653[_0xabb6('0x1c')]?_[_0xabb6('0x1d')](_0x2cf653[_0xabb6('0x1c')],function(_0x1bb094){return{'model':db[_0x1bb094[_0xabb6('0x1e')]],'as':_0x1bb094['as'],'attributes':_0x1bb094[_0xabb6('0x1b')],'include':_0x1bb094[_0xabb6('0x1c')]?_[_0xabb6('0x1d')](_0x1bb094['include'],function(_0x4302c0){return{'model':db[_0x4302c0['model']],'as':_0x4302c0['as'],'attributes':_0x4302c0['attributes']};}):[]};}):[]};}):[]:[]})[_0xabb6('0x1f')](function(_0x17ec1f){logger['info'](_0xabb6('0x20'),_0x4b9435);logger[_0xabb6('0x21')](_0xabb6('0x20'),_0x4b9435,JSON[_0xabb6('0x11')](_0x17ec1f));_0x52bfa1(_0x17ec1f);})['catch'](function(_0x112abb){logger[_0xabb6('0x12')](_0xabb6('0x20'),_0x112abb[_0xabb6('0x14')],_0x4b9435);_0x4c8483(_0x585b76['error'](0x1f4,_0x112abb['message']));});});};
\ 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