Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / template / template.rpc.js
index f287a2e..eb6f76f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b5=['error','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x41ea22,_0x3b31f4){var _0x9694d3=function(_0x19a86d){while(--_0x19a86d){_0x41ea22['push'](_0x41ea22['shift']());}};_0x9694d3(++_0x3b31f4);}(_0x02b5,0x11e));var _0x502b=function(_0x1cade3,_0x3d9775){_0x1cade3=_0x1cade3-0x0;var _0x15b255=_0x02b5[_0x1cade3];return _0x15b255;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var moment=require(_0x502b('0x2'));var BPromise=require(_0x502b('0x3'));var rs=require(_0x502b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x502b('0x5'))['db'];var utils=require(_0x502b('0x6'));var logger=require(_0x502b('0x7'))(_0x502b('0x8'));var config=require('../../config/environment');var jayson=require(_0x502b('0x9'));var client=jayson['client'][_0x502b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5564c1,_0x1af1ec,_0x4ca785){return new BPromise(function(_0x20d55d,_0x589f4f){return client[_0x502b('0xb')](_0x5564c1,_0x4ca785)[_0x502b('0xc')](function(_0x5b0a3f){logger[_0x502b('0xd')](_0x502b('0xe'),_0x1af1ec,_0x502b('0xf'));logger[_0x502b('0x10')](_0x502b('0x11'),_0x1af1ec,'request\x20sent',JSON[_0x502b('0x12')](_0x5b0a3f));if(_0x5b0a3f['error']){if(_0x5b0a3f['error'][_0x502b('0x13')]===0x1f4){logger['error'](_0x502b('0xe'),_0x1af1ec,_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);return _0x589f4f(_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);}logger[_0x502b('0x14')](_0x502b('0xe'),_0x1af1ec,_0x5b0a3f[_0x502b('0x14')]['message']);return _0x20d55d(_0x5b0a3f[_0x502b('0x14')][_0x502b('0x15')]);}else{logger[_0x502b('0xd')](_0x502b('0xe'),_0x1af1ec,_0x502b('0xf'));_0x20d55d(_0x5b0a3f[_0x502b('0x16')][_0x502b('0x15')]);}})[_0x502b('0x17')](function(_0x56d05a){logger['error'](_0x502b('0xe'),_0x1af1ec,_0x56d05a);_0x589f4f(_0x56d05a);});});}exports[_0x502b('0x18')]=function(_0x126602){var _0x57a06f=this;return new Promise(function(_0x3c9546,_0x7cb0ae){return db[_0x502b('0x19')]['findAll']({'raw':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1b')]===undefined?!![]:![]:!![],'where':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1c')]||null:null,'attributes':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1d')]||null:null,'limit':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1e')]||null:null,'include':_0x126602[_0x502b('0x1a')]?_0x126602[_0x502b('0x1a')][_0x502b('0x1f')]?_[_0x502b('0x20')](_0x126602[_0x502b('0x1a')][_0x502b('0x1f')],function(_0x4a0aa3){return{'model':db[_0x4a0aa3[_0x502b('0x21')]],'as':_0x4a0aa3['as'],'attributes':_0x4a0aa3[_0x502b('0x1d')],'include':_0x4a0aa3[_0x502b('0x1f')]?_[_0x502b('0x20')](_0x4a0aa3[_0x502b('0x1f')],function(_0x2e11fe){return{'model':db[_0x2e11fe[_0x502b('0x21')]],'as':_0x2e11fe['as'],'attributes':_0x2e11fe[_0x502b('0x1d')],'include':_0x2e11fe[_0x502b('0x1f')]?_[_0x502b('0x20')](_0x2e11fe['include'],function(_0x33dcfa){return{'model':db[_0x33dcfa['model']],'as':_0x33dcfa['as'],'attributes':_0x33dcfa[_0x502b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x502b('0xc')](function(_0x48e4c7){logger[_0x502b('0xd')](_0x502b('0x18'),_0x126602);logger[_0x502b('0x10')]('GetTemplate',_0x126602,JSON[_0x502b('0x12')](_0x48e4c7));_0x3c9546(_0x48e4c7);})[_0x502b('0x17')](function(_0x704384){logger[_0x502b('0x14')](_0x502b('0x18'),_0x704384[_0x502b('0x15')],_0x126602);_0x7cb0ae(_0x57a06f['error'](0x1f4,_0x704384[_0x502b('0x15')]));});});};
\ No newline at end of file
+var _0x28f5=['then','GetTemplate','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','request','info','debug','stringify','error','code','Template,\x20%s,\x20%s','message','request\x20sent','result','findAll','options','where','attributes','limit','include','map','model'];(function(_0x57175f,_0x166203){var _0xa036b4=function(_0x39eab6){while(--_0x39eab6){_0x57175f['push'](_0x57175f['shift']());}};_0xa036b4(++_0x166203);}(_0x28f5,0xab));var _0x528f=function(_0x23a65d,_0x3dec3f){_0x23a65d=_0x23a65d-0x0;var _0x314320=_0x28f5[_0x23a65d];return _0x314320;};'use strict';var _=require(_0x528f('0x0'));var util=require('util');var moment=require(_0x528f('0x1'));var BPromise=require(_0x528f('0x2'));var rs=require(_0x528f('0x3'));var fs=require('fs');var Redis=require(_0x528f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x528f('0x5'));var config=require('../../config/environment');var jayson=require(_0x528f('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30e6cf,_0x8f05f1,_0x463ae4){return new BPromise(function(_0xc93747,_0x26520a){return client[_0x528f('0x7')](_0x30e6cf,_0x463ae4)['then'](function(_0x20676e){logger[_0x528f('0x8')]('Template,\x20%s,\x20%s',_0x8f05f1,'request\x20sent');logger[_0x528f('0x9')]('Template,\x20%s,\x20%s,\x20%s',_0x8f05f1,'request\x20sent',JSON[_0x528f('0xa')](_0x20676e));if(_0x20676e[_0x528f('0xb')]){if(_0x20676e[_0x528f('0xb')][_0x528f('0xc')]===0x1f4){logger['error']('Template,\x20%s,\x20%s',_0x8f05f1,_0x20676e[_0x528f('0xb')]['message']);return _0x26520a(_0x20676e['error']['message']);}logger[_0x528f('0xb')](_0x528f('0xd'),_0x8f05f1,_0x20676e[_0x528f('0xb')][_0x528f('0xe')]);return _0xc93747(_0x20676e[_0x528f('0xb')][_0x528f('0xe')]);}else{logger[_0x528f('0x8')](_0x528f('0xd'),_0x8f05f1,_0x528f('0xf'));_0xc93747(_0x20676e[_0x528f('0x10')][_0x528f('0xe')]);}})['catch'](function(_0xfd363d){logger[_0x528f('0xb')](_0x528f('0xd'),_0x8f05f1,_0xfd363d);_0x26520a(_0xfd363d);});});}exports['GetTemplate']=function(_0x282679){var _0x2207dc=this;return new Promise(function(_0x549e5a,_0x3e1d3f){return db['Template'][_0x528f('0x11')]({'raw':_0x282679[_0x528f('0x12')]?_0x282679[_0x528f('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x282679['options']?_0x282679[_0x528f('0x12')][_0x528f('0x13')]||null:null,'attributes':_0x282679[_0x528f('0x12')]?_0x282679[_0x528f('0x12')][_0x528f('0x14')]||null:null,'limit':_0x282679[_0x528f('0x12')]?_0x282679[_0x528f('0x12')][_0x528f('0x15')]||null:null,'include':_0x282679[_0x528f('0x12')]?_0x282679[_0x528f('0x12')][_0x528f('0x16')]?_[_0x528f('0x17')](_0x282679[_0x528f('0x12')][_0x528f('0x16')],function(_0xfbb19d){return{'model':db[_0xfbb19d[_0x528f('0x18')]],'as':_0xfbb19d['as'],'attributes':_0xfbb19d[_0x528f('0x14')],'include':_0xfbb19d['include']?_[_0x528f('0x17')](_0xfbb19d[_0x528f('0x16')],function(_0x290397){return{'model':db[_0x290397[_0x528f('0x18')]],'as':_0x290397['as'],'attributes':_0x290397[_0x528f('0x14')],'include':_0x290397[_0x528f('0x16')]?_[_0x528f('0x17')](_0x290397['include'],function(_0x2dd1db){return{'model':db[_0x2dd1db[_0x528f('0x18')]],'as':_0x2dd1db['as'],'attributes':_0x2dd1db[_0x528f('0x14')]};}):[]};}):[]};}):[]:[]})[_0x528f('0x19')](function(_0x50a408){logger[_0x528f('0x8')](_0x528f('0x1a'),_0x282679);logger[_0x528f('0x9')](_0x528f('0x1a'),_0x282679,JSON[_0x528f('0xa')](_0x50a408));_0x549e5a(_0x50a408);})[_0x528f('0x1b')](function(_0x18a2ea){logger[_0x528f('0xb')](_0x528f('0x1a'),_0x18a2ea[_0x528f('0xe')],_0x282679);_0x3e1d3f(_0x2207dc[_0x528f('0xb')](0x1f4,_0x18a2ea[_0x528f('0xe')]));});});};
\ No newline at end of file