Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / template / template.rpc.js
index eddec85..eb6f76f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x943a=['attributes','limit','model','include','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','GetTemplate','options','raw'];(function(_0x9570fe,_0x579eac){var _0x207fc6=function(_0x529c1e){while(--_0x529c1e){_0x9570fe['push'](_0x9570fe['shift']());}};_0x207fc6(++_0x579eac);}(_0x943a,0xfd));var _0xa943=function(_0x5b3574,_0x5dea76){_0x5b3574=_0x5b3574-0x0;var _0x4ff4bc=_0x943a[_0x5b3574];return _0x4ff4bc;};'use strict';var _=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var moment=require(_0xa943('0x2'));var BPromise=require(_0xa943('0x3'));var rs=require(_0xa943('0x4'));var fs=require('fs');var Redis=require(_0xa943('0x5'));var db=require(_0xa943('0x6'))['db'];var utils=require(_0xa943('0x7'));var logger=require(_0xa943('0x8'))(_0xa943('0x9'));var config=require(_0xa943('0xa'));var jayson=require(_0xa943('0xb'));var client=jayson[_0xa943('0xc')][_0xa943('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d4bf0,_0x538c3e,_0x4b7b90){return new BPromise(function(_0x4efbf8,_0x409660){return client[_0xa943('0xe')](_0x5d4bf0,_0x4b7b90)[_0xa943('0xf')](function(_0x3542a6){logger[_0xa943('0x10')](_0xa943('0x11'),_0x538c3e,'request\x20sent');logger[_0xa943('0x12')]('Template,\x20%s,\x20%s,\x20%s',_0x538c3e,_0xa943('0x13'),JSON[_0xa943('0x14')](_0x3542a6));if(_0x3542a6[_0xa943('0x15')]){if(_0x3542a6[_0xa943('0x15')]['code']===0x1f4){logger[_0xa943('0x15')](_0xa943('0x11'),_0x538c3e,_0x3542a6[_0xa943('0x15')][_0xa943('0x16')]);return _0x409660(_0x3542a6['error']['message']);}logger[_0xa943('0x15')](_0xa943('0x11'),_0x538c3e,_0x3542a6[_0xa943('0x15')]['message']);return _0x4efbf8(_0x3542a6[_0xa943('0x15')]['message']);}else{logger[_0xa943('0x10')](_0xa943('0x11'),_0x538c3e,_0xa943('0x13'));_0x4efbf8(_0x3542a6['result'][_0xa943('0x16')]);}})['catch'](function(_0x2625c1){logger['error'](_0xa943('0x11'),_0x538c3e,_0x2625c1);_0x409660(_0x2625c1);});});}exports[_0xa943('0x17')]=function(_0x5e7137){var _0x27e3d2=this;return new Promise(function(_0xea9274,_0x288e74){return db['Template']['findAll']({'raw':_0x5e7137[_0xa943('0x18')]?_0x5e7137[_0xa943('0x18')][_0xa943('0x19')]===undefined?!![]:![]:!![],'where':_0x5e7137[_0xa943('0x18')]?_0x5e7137['options']['where']||null:null,'attributes':_0x5e7137[_0xa943('0x18')]?_0x5e7137[_0xa943('0x18')][_0xa943('0x1a')]||null:null,'limit':_0x5e7137[_0xa943('0x18')]?_0x5e7137[_0xa943('0x18')][_0xa943('0x1b')]||null:null,'include':_0x5e7137[_0xa943('0x18')]?_0x5e7137[_0xa943('0x18')]['include']?_['map'](_0x5e7137['options']['include'],function(_0x31298a){return{'model':db[_0x31298a[_0xa943('0x1c')]],'as':_0x31298a['as'],'attributes':_0x31298a[_0xa943('0x1a')],'include':_0x31298a[_0xa943('0x1d')]?_[_0xa943('0x1e')](_0x31298a[_0xa943('0x1d')],function(_0x2966b5){return{'model':db[_0x2966b5[_0xa943('0x1c')]],'as':_0x2966b5['as'],'attributes':_0x2966b5[_0xa943('0x1a')],'include':_0x2966b5[_0xa943('0x1d')]?_['map'](_0x2966b5[_0xa943('0x1d')],function(_0x2c288e){return{'model':db[_0x2c288e['model']],'as':_0x2c288e['as'],'attributes':_0x2c288e[_0xa943('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa943('0xf')](function(_0x2b7989){logger[_0xa943('0x10')](_0xa943('0x17'),_0x5e7137);logger['debug'](_0xa943('0x17'),_0x5e7137,JSON[_0xa943('0x14')](_0x2b7989));_0xea9274(_0x2b7989);})['catch'](function(_0x18cd4e){logger[_0xa943('0x15')](_0xa943('0x17'),_0x18cd4e[_0xa943('0x16')],_0x5e7137);_0x288e74(_0x27e3d2[_0xa943('0x15')](0x1f4,_0x18cd4e[_0xa943('0x16')]));});});};
\ 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