Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / template / template.rpc.js
index 6194c5d..2df9997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf78d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../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','options','where','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x4c0780,_0x354c3a){var _0x4753d7=function(_0x22549f){while(--_0x22549f){_0x4c0780['push'](_0x4c0780['shift']());}};_0x4753d7(++_0x354c3a);}(_0xf78d,0x133));var _0xdf78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf78d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf78('0x0'));var util=require(_0xdf78('0x1'));var moment=require(_0xdf78('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf78('0x3'));var fs=require('fs');var Redis=require(_0xdf78('0x4'));var db=require(_0xdf78('0x5'))['db'];var utils=require(_0xdf78('0x6'));var logger=require(_0xdf78('0x7'))('rpc');var config=require(_0xdf78('0x8'));var jayson=require(_0xdf78('0x9'));var client=jayson[_0xdf78('0xa')][_0xdf78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x179ce5,_0x50fdee,_0x228433){return new BPromise(function(_0x1e3444,_0x24434){return client['request'](_0x179ce5,_0x228433)[_0xdf78('0xc')](function(_0x53573c){logger[_0xdf78('0xd')](_0xdf78('0xe'),_0x50fdee,_0xdf78('0xf'));logger[_0xdf78('0x10')](_0xdf78('0x11'),_0x50fdee,_0xdf78('0xf'),JSON[_0xdf78('0x12')](_0x53573c));if(_0x53573c[_0xdf78('0x13')]){if(_0x53573c[_0xdf78('0x13')][_0xdf78('0x14')]===0x1f4){logger[_0xdf78('0x13')](_0xdf78('0xe'),_0x50fdee,_0x53573c[_0xdf78('0x13')][_0xdf78('0x15')]);return _0x24434(_0x53573c[_0xdf78('0x13')][_0xdf78('0x15')]);}logger['error'](_0xdf78('0xe'),_0x50fdee,_0x53573c[_0xdf78('0x13')][_0xdf78('0x15')]);return _0x1e3444(_0x53573c[_0xdf78('0x13')][_0xdf78('0x15')]);}else{logger[_0xdf78('0xd')](_0xdf78('0xe'),_0x50fdee,_0xdf78('0xf'));_0x1e3444(_0x53573c['result'][_0xdf78('0x15')]);}})[_0xdf78('0x16')](function(_0x260f49){logger[_0xdf78('0x13')]('Template,\x20%s,\x20%s',_0x50fdee,_0x260f49);_0x24434(_0x260f49);});});}exports[_0xdf78('0x17')]=function(_0x577db3){var _0x5a1ee1=this;return new Promise(function(_0x4e06a8,_0x252aed){return db['Template']['findAll']({'raw':_0x577db3[_0xdf78('0x18')]?_0x577db3['options']['raw']===undefined?!![]:![]:!![],'where':_0x577db3[_0xdf78('0x18')]?_0x577db3[_0xdf78('0x18')][_0xdf78('0x19')]||null:null,'attributes':_0x577db3[_0xdf78('0x18')]?_0x577db3[_0xdf78('0x18')][_0xdf78('0x1a')]||null:null,'limit':_0x577db3[_0xdf78('0x18')]?_0x577db3[_0xdf78('0x18')][_0xdf78('0x1b')]||null:null,'include':_0x577db3[_0xdf78('0x18')]?_0x577db3[_0xdf78('0x18')][_0xdf78('0x1c')]?_[_0xdf78('0x1d')](_0x577db3[_0xdf78('0x18')]['include'],function(_0x1a1d5a){return{'model':db[_0x1a1d5a[_0xdf78('0x1e')]],'as':_0x1a1d5a['as'],'attributes':_0x1a1d5a[_0xdf78('0x1a')],'include':_0x1a1d5a[_0xdf78('0x1c')]?_['map'](_0x1a1d5a['include'],function(_0xb1daf9){return{'model':db[_0xb1daf9['model']],'as':_0xb1daf9['as'],'attributes':_0xb1daf9[_0xdf78('0x1a')],'include':_0xb1daf9[_0xdf78('0x1c')]?_[_0xdf78('0x1d')](_0xb1daf9[_0xdf78('0x1c')],function(_0xf9f62e){return{'model':db[_0xf9f62e[_0xdf78('0x1e')]],'as':_0xf9f62e['as'],'attributes':_0xf9f62e[_0xdf78('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26b420){logger[_0xdf78('0xd')](_0xdf78('0x17'),_0x577db3);logger['debug'](_0xdf78('0x17'),_0x577db3,JSON[_0xdf78('0x12')](_0x26b420));_0x4e06a8(_0x26b420);})['catch'](function(_0x4a61ae){logger['error'](_0xdf78('0x17'),_0x4a61ae[_0xdf78('0x15')],_0x577db3);_0x252aed(_0x5a1ee1[_0xdf78('0x13')](0x1f4,_0x4a61ae[_0xdf78('0x15')]));});});};
\ No newline at end of file
+var _0x1ada=['options','raw','where','attributes','include','map','model','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template'];(function(_0x455b4e,_0x556818){var _0x4d0e47=function(_0x5daae1){while(--_0x5daae1){_0x455b4e['push'](_0x455b4e['shift']());}};_0x4d0e47(++_0x556818);}(_0x1ada,0x19b));var _0xa1ad=function(_0x2b3261,_0x593754){_0x2b3261=_0x2b3261-0x0;var _0x55bbea=_0x1ada[_0x2b3261];return _0x55bbea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa1ad('0x0'));var BPromise=require('bluebird');var rs=require(_0xa1ad('0x1'));var fs=require('fs');var Redis=require(_0xa1ad('0x2'));var db=require(_0xa1ad('0x3'))['db'];var utils=require(_0xa1ad('0x4'));var logger=require(_0xa1ad('0x5'))(_0xa1ad('0x6'));var config=require('../../config/environment');var jayson=require(_0xa1ad('0x7'));var client=jayson[_0xa1ad('0x8')][_0xa1ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f317e,_0x5a5882,_0x562373){return new BPromise(function(_0x580de2,_0x43e442){return client[_0xa1ad('0xa')](_0x4f317e,_0x562373)[_0xa1ad('0xb')](function(_0xdffa1a){logger[_0xa1ad('0xc')]('Template,\x20%s,\x20%s',_0x5a5882,_0xa1ad('0xd'));logger[_0xa1ad('0xe')](_0xa1ad('0xf'),_0x5a5882,_0xa1ad('0xd'),JSON['stringify'](_0xdffa1a));if(_0xdffa1a[_0xa1ad('0x10')]){if(_0xdffa1a[_0xa1ad('0x10')][_0xa1ad('0x11')]===0x1f4){logger[_0xa1ad('0x10')](_0xa1ad('0x12'),_0x5a5882,_0xdffa1a[_0xa1ad('0x10')]['message']);return _0x43e442(_0xdffa1a[_0xa1ad('0x10')][_0xa1ad('0x13')]);}logger['error'](_0xa1ad('0x12'),_0x5a5882,_0xdffa1a[_0xa1ad('0x10')]['message']);return _0x580de2(_0xdffa1a[_0xa1ad('0x10')][_0xa1ad('0x13')]);}else{logger[_0xa1ad('0xc')](_0xa1ad('0x12'),_0x5a5882,'request\x20sent');_0x580de2(_0xdffa1a['result'][_0xa1ad('0x13')]);}})[_0xa1ad('0x14')](function(_0x1383cb){logger[_0xa1ad('0x10')](_0xa1ad('0x12'),_0x5a5882,_0x1383cb);_0x43e442(_0x1383cb);});});}exports[_0xa1ad('0x15')]=function(_0x21ae37){var _0x781727=this;return new Promise(function(_0x4af16d,_0x138432){return db[_0xa1ad('0x16')]['findAll']({'raw':_0x21ae37[_0xa1ad('0x17')]?_0x21ae37[_0xa1ad('0x17')][_0xa1ad('0x18')]===undefined?!![]:![]:!![],'where':_0x21ae37[_0xa1ad('0x17')]?_0x21ae37[_0xa1ad('0x17')][_0xa1ad('0x19')]||null:null,'attributes':_0x21ae37[_0xa1ad('0x17')]?_0x21ae37[_0xa1ad('0x17')][_0xa1ad('0x1a')]||null:null,'limit':_0x21ae37['options']?_0x21ae37[_0xa1ad('0x17')]['limit']||null:null,'include':_0x21ae37[_0xa1ad('0x17')]?_0x21ae37[_0xa1ad('0x17')][_0xa1ad('0x1b')]?_[_0xa1ad('0x1c')](_0x21ae37[_0xa1ad('0x17')][_0xa1ad('0x1b')],function(_0x2c62f1){return{'model':db[_0x2c62f1[_0xa1ad('0x1d')]],'as':_0x2c62f1['as'],'attributes':_0x2c62f1[_0xa1ad('0x1a')],'include':_0x2c62f1['include']?_[_0xa1ad('0x1c')](_0x2c62f1[_0xa1ad('0x1b')],function(_0x4baf92){return{'model':db[_0x4baf92['model']],'as':_0x4baf92['as'],'attributes':_0x4baf92[_0xa1ad('0x1a')],'include':_0x4baf92[_0xa1ad('0x1b')]?_[_0xa1ad('0x1c')](_0x4baf92[_0xa1ad('0x1b')],function(_0x4d94b9){return{'model':db[_0x4d94b9[_0xa1ad('0x1d')]],'as':_0x4d94b9['as'],'attributes':_0x4d94b9[_0xa1ad('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa1ad('0xb')](function(_0x5179df){logger['info']('GetTemplate',_0x21ae37);logger[_0xa1ad('0xe')]('GetTemplate',_0x21ae37,JSON[_0xa1ad('0x1e')](_0x5179df));_0x4af16d(_0x5179df);})['catch'](function(_0x278745){logger['error'](_0xa1ad('0x15'),_0x278745[_0xa1ad('0x13')],_0x21ae37);_0x138432(_0x781727[_0xa1ad('0x10')](0x1f4,_0x278745[_0xa1ad('0x13')]));});});};
\ No newline at end of file