Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / template / template.rpc.js
index 9c73f80..5c97427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7604=['limit','include','map','model','debug','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes'];(function(_0x420937,_0x46f200){var _0x163b02=function(_0x6006e2){while(--_0x6006e2){_0x420937['push'](_0x420937['shift']());}};_0x163b02(++_0x46f200);}(_0x7604,0x1f4));var _0x4760=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7604[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x4760('0x0'));var util=require('util');var moment=require(_0x4760('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4760('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4760('0x3'));var logger=require(_0x4760('0x4'))(_0x4760('0x5'));var config=require(_0x4760('0x6'));var jayson=require(_0x4760('0x7'));var client=jayson[_0x4760('0x8')][_0x4760('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b4f96,_0x2fb102,_0x2c57b3){return new BPromise(function(_0x5f039b,_0x347262){return client[_0x4760('0xa')](_0x4b4f96,_0x2c57b3)[_0x4760('0xb')](function(_0x1dfeaa){logger[_0x4760('0xc')](_0x4760('0xd'),_0x2fb102,_0x4760('0xe'));logger['debug'](_0x4760('0xf'),_0x2fb102,_0x4760('0xe'),JSON[_0x4760('0x10')](_0x1dfeaa));if(_0x1dfeaa['error']){if(_0x1dfeaa[_0x4760('0x11')][_0x4760('0x12')]===0x1f4){logger['error'](_0x4760('0xd'),_0x2fb102,_0x1dfeaa['error'][_0x4760('0x13')]);return _0x347262(_0x1dfeaa[_0x4760('0x11')][_0x4760('0x13')]);}logger[_0x4760('0x11')](_0x4760('0xd'),_0x2fb102,_0x1dfeaa[_0x4760('0x11')][_0x4760('0x13')]);return _0x5f039b(_0x1dfeaa['error'][_0x4760('0x13')]);}else{logger[_0x4760('0xc')](_0x4760('0xd'),_0x2fb102,_0x4760('0xe'));_0x5f039b(_0x1dfeaa[_0x4760('0x14')]['message']);}})[_0x4760('0x15')](function(_0x61f1bb){logger[_0x4760('0x11')](_0x4760('0xd'),_0x2fb102,_0x61f1bb);_0x347262(_0x61f1bb);});});}exports[_0x4760('0x16')]=function(_0x5b276d){var _0x1a77d9=this;return new Promise(function(_0x5a4629,_0x2e3cab){return db[_0x4760('0x17')]['findAll']({'raw':_0x5b276d[_0x4760('0x18')]?_0x5b276d[_0x4760('0x18')][_0x4760('0x19')]===undefined?!![]:![]:!![],'where':_0x5b276d[_0x4760('0x18')]?_0x5b276d[_0x4760('0x18')][_0x4760('0x1a')]||null:null,'attributes':_0x5b276d[_0x4760('0x18')]?_0x5b276d[_0x4760('0x18')][_0x4760('0x1b')]||null:null,'limit':_0x5b276d[_0x4760('0x18')]?_0x5b276d[_0x4760('0x18')][_0x4760('0x1c')]||null:null,'include':_0x5b276d[_0x4760('0x18')]?_0x5b276d[_0x4760('0x18')][_0x4760('0x1d')]?_[_0x4760('0x1e')](_0x5b276d[_0x4760('0x18')]['include'],function(_0x105297){return{'model':db[_0x105297[_0x4760('0x1f')]],'as':_0x105297['as'],'attributes':_0x105297[_0x4760('0x1b')],'include':_0x105297[_0x4760('0x1d')]?_[_0x4760('0x1e')](_0x105297[_0x4760('0x1d')],function(_0x1728dd){return{'model':db[_0x1728dd[_0x4760('0x1f')]],'as':_0x1728dd['as'],'attributes':_0x1728dd['attributes'],'include':_0x1728dd['include']?_[_0x4760('0x1e')](_0x1728dd[_0x4760('0x1d')],function(_0x124352){return{'model':db[_0x124352[_0x4760('0x1f')]],'as':_0x124352['as'],'attributes':_0x124352[_0x4760('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4760('0xb')](function(_0x333a9a){logger[_0x4760('0xc')](_0x4760('0x16'),_0x5b276d);logger[_0x4760('0x20')](_0x4760('0x16'),_0x5b276d,JSON[_0x4760('0x10')](_0x333a9a));_0x5a4629(_0x333a9a);})[_0x4760('0x15')](function(_0x2a668f){logger['error']('GetTemplate',_0x2a668f[_0x4760('0x13')],_0x5b276d);_0x2e3cab(_0x1a77d9[_0x4760('0x11')](0x1f4,_0x2a668f[_0x4760('0x13')]));});});};
\ No newline at end of file
+var _0x5eee=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTemplate','Template','options','raw','attributes','include','map','model','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5eee,0xb9));var _0xe5ee=function(_0x292c76,_0x23cd33){_0x292c76=_0x292c76-0x0;var _0x45c83a=_0x5eee[_0x292c76];return _0x45c83a;};'use strict';var _=require(_0xe5ee('0x0'));var util=require(_0xe5ee('0x1'));var moment=require(_0xe5ee('0x2'));var BPromise=require(_0xe5ee('0x3'));var rs=require(_0xe5ee('0x4'));var fs=require('fs');var Redis=require(_0xe5ee('0x5'));var db=require(_0xe5ee('0x6'))['db'];var utils=require(_0xe5ee('0x7'));var logger=require(_0xe5ee('0x8'))(_0xe5ee('0x9'));var config=require('../../config/environment');var jayson=require(_0xe5ee('0xa'));var client=jayson[_0xe5ee('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd32f,_0x1ca5fa,_0x36fb6d){return new BPromise(function(_0x1a5ec9,_0x55b49a){return client['request'](_0x4fd32f,_0x36fb6d)[_0xe5ee('0xc')](function(_0x200f3e){logger['info'](_0xe5ee('0xd'),_0x1ca5fa,_0xe5ee('0xe'));logger[_0xe5ee('0xf')](_0xe5ee('0x10'),_0x1ca5fa,'request\x20sent',JSON[_0xe5ee('0x11')](_0x200f3e));if(_0x200f3e[_0xe5ee('0x12')]){if(_0x200f3e['error']['code']===0x1f4){logger['error'](_0xe5ee('0xd'),_0x1ca5fa,_0x200f3e['error']['message']);return _0x55b49a(_0x200f3e[_0xe5ee('0x12')][_0xe5ee('0x13')]);}logger[_0xe5ee('0x12')](_0xe5ee('0xd'),_0x1ca5fa,_0x200f3e['error']['message']);return _0x1a5ec9(_0x200f3e[_0xe5ee('0x12')][_0xe5ee('0x13')]);}else{logger[_0xe5ee('0x14')](_0xe5ee('0xd'),_0x1ca5fa,_0xe5ee('0xe'));_0x1a5ec9(_0x200f3e[_0xe5ee('0x15')][_0xe5ee('0x13')]);}})[_0xe5ee('0x16')](function(_0x1102a6){logger['error'](_0xe5ee('0xd'),_0x1ca5fa,_0x1102a6);_0x55b49a(_0x1102a6);});});}exports[_0xe5ee('0x17')]=function(_0x1cba2c){var _0x478c1d=this;return new Promise(function(_0x5bbf66,_0x4adf95){return db[_0xe5ee('0x18')]['findAll']({'raw':_0x1cba2c[_0xe5ee('0x19')]?_0x1cba2c[_0xe5ee('0x19')][_0xe5ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x1cba2c['options']?_0x1cba2c[_0xe5ee('0x19')]['where']||null:null,'attributes':_0x1cba2c['options']?_0x1cba2c['options'][_0xe5ee('0x1b')]||null:null,'limit':_0x1cba2c[_0xe5ee('0x19')]?_0x1cba2c[_0xe5ee('0x19')]['limit']||null:null,'include':_0x1cba2c[_0xe5ee('0x19')]?_0x1cba2c['options'][_0xe5ee('0x1c')]?_[_0xe5ee('0x1d')](_0x1cba2c[_0xe5ee('0x19')][_0xe5ee('0x1c')],function(_0x348084){return{'model':db[_0x348084[_0xe5ee('0x1e')]],'as':_0x348084['as'],'attributes':_0x348084['attributes'],'include':_0x348084[_0xe5ee('0x1c')]?_[_0xe5ee('0x1d')](_0x348084[_0xe5ee('0x1c')],function(_0x5cbe64){return{'model':db[_0x5cbe64[_0xe5ee('0x1e')]],'as':_0x5cbe64['as'],'attributes':_0x5cbe64[_0xe5ee('0x1b')],'include':_0x5cbe64[_0xe5ee('0x1c')]?_[_0xe5ee('0x1d')](_0x5cbe64[_0xe5ee('0x1c')],function(_0x330eb){return{'model':db[_0x330eb['model']],'as':_0x330eb['as'],'attributes':_0x330eb[_0xe5ee('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe5ee('0xc')](function(_0x25c988){logger[_0xe5ee('0x14')](_0xe5ee('0x17'),_0x1cba2c);logger[_0xe5ee('0xf')](_0xe5ee('0x17'),_0x1cba2c,JSON[_0xe5ee('0x11')](_0x25c988));_0x5bbf66(_0x25c988);})[_0xe5ee('0x16')](function(_0x206ab7){logger[_0xe5ee('0x12')]('GetTemplate',_0x206ab7[_0xe5ee('0x13')],_0x1cba2c);_0x4adf95(_0x478c1d[_0xe5ee('0x12')](0x1f4,_0x206ab7['message']));});});};
\ No newline at end of file