Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / template / template.rpc.js
index bf8c8a3..85b0fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc2c=['request','then','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','catch','Template','options','raw','where','attributes','limit','include','map','model','info','GetTemplate','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xbc2c,0x79));var _0xcbc2=function(_0x4f11cb,_0x14e174){_0x4f11cb=_0x4f11cb-0x0;var _0x491488=_0xbc2c[_0x4f11cb];return _0x491488;};'use strict';var _=require(_0xcbc2('0x0'));var util=require(_0xcbc2('0x1'));var moment=require(_0xcbc2('0x2'));var BPromise=require(_0xcbc2('0x3'));var rs=require(_0xcbc2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbc2('0x5'))['db'];var utils=require(_0xcbc2('0x6'));var logger=require(_0xcbc2('0x7'))('rpc');var config=require(_0xcbc2('0x8'));var jayson=require(_0xcbc2('0x9'));var client=jayson['client'][_0xcbc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331392,_0x1a7f86,_0x4fe121){return new BPromise(function(_0x3430ba,_0x23bd60){return client[_0xcbc2('0xb')](_0x331392,_0x4fe121)[_0xcbc2('0xc')](function(_0x307876){logger['info']('Template,\x20%s,\x20%s',_0x1a7f86,'request\x20sent');logger[_0xcbc2('0xd')](_0xcbc2('0xe'),_0x1a7f86,_0xcbc2('0xf'),JSON[_0xcbc2('0x10')](_0x307876));if(_0x307876[_0xcbc2('0x11')]){if(_0x307876[_0xcbc2('0x11')][_0xcbc2('0x12')]===0x1f4){logger[_0xcbc2('0x11')](_0xcbc2('0x13'),_0x1a7f86,_0x307876[_0xcbc2('0x11')][_0xcbc2('0x14')]);return _0x23bd60(_0x307876[_0xcbc2('0x11')][_0xcbc2('0x14')]);}logger['error'](_0xcbc2('0x13'),_0x1a7f86,_0x307876[_0xcbc2('0x11')][_0xcbc2('0x14')]);return _0x3430ba(_0x307876[_0xcbc2('0x11')][_0xcbc2('0x14')]);}else{logger['info'](_0xcbc2('0x13'),_0x1a7f86,'request\x20sent');_0x3430ba(_0x307876['result'][_0xcbc2('0x14')]);}})[_0xcbc2('0x15')](function(_0x1c4417){logger['error'](_0xcbc2('0x13'),_0x1a7f86,_0x1c4417);_0x23bd60(_0x1c4417);});});}exports['GetTemplate']=function(_0xccb4fe){var _0x4a6117=this;return new Promise(function(_0xc361f7,_0x9f8a1c){return db[_0xcbc2('0x16')]['findAll']({'raw':_0xccb4fe[_0xcbc2('0x17')]?_0xccb4fe['options'][_0xcbc2('0x18')]===undefined?!![]:![]:!![],'where':_0xccb4fe['options']?_0xccb4fe[_0xcbc2('0x17')][_0xcbc2('0x19')]||null:null,'attributes':_0xccb4fe[_0xcbc2('0x17')]?_0xccb4fe['options'][_0xcbc2('0x1a')]||null:null,'limit':_0xccb4fe['options']?_0xccb4fe[_0xcbc2('0x17')][_0xcbc2('0x1b')]||null:null,'include':_0xccb4fe['options']?_0xccb4fe['options'][_0xcbc2('0x1c')]?_[_0xcbc2('0x1d')](_0xccb4fe[_0xcbc2('0x17')][_0xcbc2('0x1c')],function(_0x6cea08){return{'model':db[_0x6cea08[_0xcbc2('0x1e')]],'as':_0x6cea08['as'],'attributes':_0x6cea08[_0xcbc2('0x1a')],'include':_0x6cea08[_0xcbc2('0x1c')]?_[_0xcbc2('0x1d')](_0x6cea08[_0xcbc2('0x1c')],function(_0x18da3d){return{'model':db[_0x18da3d[_0xcbc2('0x1e')]],'as':_0x18da3d['as'],'attributes':_0x18da3d['attributes'],'include':_0x18da3d['include']?_[_0xcbc2('0x1d')](_0x18da3d['include'],function(_0x5862fc){return{'model':db[_0x5862fc[_0xcbc2('0x1e')]],'as':_0x5862fc['as'],'attributes':_0x5862fc[_0xcbc2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcbc2('0xc')](function(_0x5ef2e8){logger[_0xcbc2('0x1f')]('GetTemplate',_0xccb4fe);logger[_0xcbc2('0xd')](_0xcbc2('0x20'),_0xccb4fe,JSON[_0xcbc2('0x10')](_0x5ef2e8));_0xc361f7(_0x5ef2e8);})[_0xcbc2('0x15')](function(_0x5ec520){logger[_0xcbc2('0x11')](_0xcbc2('0x20'),_0x5ec520[_0xcbc2('0x14')],_0xccb4fe);_0x9f8a1c(_0x4a6117[_0xcbc2('0x11')](0x1f4,_0x5ec520['message']));});});};
\ No newline at end of file
+var _0x0f1a=['randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','Template,\x20%s,\x20%s','info','result','catch','Template','options','where','attributes','limit','include','model','map','then','GetTemplate','lodash','util','moment','bluebird'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x0f1a,0xdc));var _0xa0f1=function(_0x102123,_0x5c1a48){_0x102123=_0x102123-0x0;var _0x151fee=_0x0f1a[_0x102123];return _0x151fee;};'use strict';var _=require(_0xa0f1('0x0'));var util=require(_0xa0f1('0x1'));var moment=require(_0xa0f1('0x2'));var BPromise=require(_0xa0f1('0x3'));var rs=require(_0xa0f1('0x4'));var fs=require('fs');var Redis=require(_0xa0f1('0x5'));var db=require(_0xa0f1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0f1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0f1('0x8'));var client=jayson[_0xa0f1('0x9')][_0xa0f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x347758,_0x190632,_0x56b89f){return new BPromise(function(_0x284a00,_0x297eae){return client[_0xa0f1('0xb')](_0x347758,_0x56b89f)['then'](function(_0x36bee1){logger['info']('Template,\x20%s,\x20%s',_0x190632,_0xa0f1('0xc'));logger[_0xa0f1('0xd')](_0xa0f1('0xe'),_0x190632,_0xa0f1('0xc'),JSON['stringify'](_0x36bee1));if(_0x36bee1['error']){if(_0x36bee1[_0xa0f1('0xf')][_0xa0f1('0x10')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x190632,_0x36bee1[_0xa0f1('0xf')][_0xa0f1('0x11')]);return _0x297eae(_0x36bee1[_0xa0f1('0xf')][_0xa0f1('0x11')]);}logger[_0xa0f1('0xf')](_0xa0f1('0x12'),_0x190632,_0x36bee1[_0xa0f1('0xf')][_0xa0f1('0x11')]);return _0x284a00(_0x36bee1[_0xa0f1('0xf')][_0xa0f1('0x11')]);}else{logger[_0xa0f1('0x13')](_0xa0f1('0x12'),_0x190632,'request\x20sent');_0x284a00(_0x36bee1[_0xa0f1('0x14')]['message']);}})[_0xa0f1('0x15')](function(_0x47d3f0){logger[_0xa0f1('0xf')]('Template,\x20%s,\x20%s',_0x190632,_0x47d3f0);_0x297eae(_0x47d3f0);});});}exports['GetTemplate']=function(_0x35cb4e){var _0x6da96c=this;return new Promise(function(_0x4cc3b9,_0x18a351){return db[_0xa0f1('0x16')]['findAll']({'raw':_0x35cb4e[_0xa0f1('0x17')]?_0x35cb4e[_0xa0f1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x35cb4e['options']?_0x35cb4e[_0xa0f1('0x17')][_0xa0f1('0x18')]||null:null,'attributes':_0x35cb4e[_0xa0f1('0x17')]?_0x35cb4e[_0xa0f1('0x17')][_0xa0f1('0x19')]||null:null,'limit':_0x35cb4e[_0xa0f1('0x17')]?_0x35cb4e['options'][_0xa0f1('0x1a')]||null:null,'include':_0x35cb4e[_0xa0f1('0x17')]?_0x35cb4e['options'][_0xa0f1('0x1b')]?_['map'](_0x35cb4e[_0xa0f1('0x17')][_0xa0f1('0x1b')],function(_0x5146f8){return{'model':db[_0x5146f8[_0xa0f1('0x1c')]],'as':_0x5146f8['as'],'attributes':_0x5146f8[_0xa0f1('0x19')],'include':_0x5146f8[_0xa0f1('0x1b')]?_[_0xa0f1('0x1d')](_0x5146f8['include'],function(_0x400c67){return{'model':db[_0x400c67[_0xa0f1('0x1c')]],'as':_0x400c67['as'],'attributes':_0x400c67[_0xa0f1('0x19')],'include':_0x400c67[_0xa0f1('0x1b')]?_[_0xa0f1('0x1d')](_0x400c67['include'],function(_0x59b595){return{'model':db[_0x59b595[_0xa0f1('0x1c')]],'as':_0x59b595['as'],'attributes':_0x59b595['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0f1('0x1e')](function(_0x105589){logger[_0xa0f1('0x13')](_0xa0f1('0x1f'),_0x35cb4e);logger['debug'](_0xa0f1('0x1f'),_0x35cb4e,JSON['stringify'](_0x105589));_0x4cc3b9(_0x105589);})[_0xa0f1('0x15')](function(_0x15eb6a){logger[_0xa0f1('0xf')](_0xa0f1('0x1f'),_0x15eb6a['message'],_0x35cb4e);_0x18a351(_0x6da96c[_0xa0f1('0xf')](0x1f4,_0x15eb6a['message']));});});};
\ No newline at end of file