Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / api / cmHopperBlack / cmHopperBlack.rpc.js
index 2168b1f..d24f874 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40fe=['code','error','message','info','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model','map','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e3388,_0x3fb285){var _0x477d8b=function(_0x11b31c){while(--_0x11b31c){_0x3e3388['push'](_0x3e3388['shift']());}};_0x477d8b(++_0x3fb285);}(_0x40fe,0xf7));var _0xe40f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x40fe[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xe40f('0x0'));var util=require(_0xe40f('0x1'));var moment=require(_0xe40f('0x2'));var BPromise=require('bluebird');var rs=require(_0xe40f('0x3'));var fs=require('fs');var Redis=require(_0xe40f('0x4'));var db=require(_0xe40f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe40f('0x6'))(_0xe40f('0x7'));var config=require(_0xe40f('0x8'));var jayson=require(_0xe40f('0x9'));var client=jayson[_0xe40f('0xa')][_0xe40f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543ceb,_0x2fb36d,_0x260869){return new BPromise(function(_0x398084,_0x2a7731){return client[_0xe40f('0xc')](_0x543ceb,_0x260869)[_0xe40f('0xd')](function(_0x36f19e){logger['info'](_0xe40f('0xe'),_0x2fb36d,_0xe40f('0xf'));logger[_0xe40f('0x10')](_0xe40f('0x11'),_0x2fb36d,_0xe40f('0xf'),JSON[_0xe40f('0x12')](_0x36f19e));if(_0x36f19e['error']){if(_0x36f19e['error'][_0xe40f('0x13')]===0x1f4){logger[_0xe40f('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x2fb36d,_0x36f19e['error'][_0xe40f('0x15')]);return _0x2a7731(_0x36f19e[_0xe40f('0x14')][_0xe40f('0x15')]);}logger['error'](_0xe40f('0xe'),_0x2fb36d,_0x36f19e[_0xe40f('0x14')][_0xe40f('0x15')]);return _0x398084(_0x36f19e[_0xe40f('0x14')][_0xe40f('0x15')]);}else{logger[_0xe40f('0x16')](_0xe40f('0xe'),_0x2fb36d,_0xe40f('0xf'));_0x398084(_0x36f19e['result'][_0xe40f('0x15')]);}})[_0xe40f('0x17')](function(_0x2e97d4){logger[_0xe40f('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x2fb36d,_0x2e97d4);_0x2a7731(_0x2e97d4);});});}exports[_0xe40f('0x18')]=function(_0x221a8f){var _0x510fc2=this;return new Promise(function(_0x790ffd,_0x33e8c2){return db[_0xe40f('0x19')]['findAll']({'raw':_0x221a8f[_0xe40f('0x1a')]?_0x221a8f[_0xe40f('0x1a')][_0xe40f('0x1b')]===undefined?!![]:![]:!![],'where':_0x221a8f[_0xe40f('0x1a')]?_0x221a8f['options'][_0xe40f('0x1c')]||null:null,'attributes':_0x221a8f[_0xe40f('0x1a')]?_0x221a8f[_0xe40f('0x1a')][_0xe40f('0x1d')]||null:null,'limit':_0x221a8f[_0xe40f('0x1a')]?_0x221a8f[_0xe40f('0x1a')][_0xe40f('0x1e')]||null:null,'include':_0x221a8f[_0xe40f('0x1a')]?_0x221a8f[_0xe40f('0x1a')][_0xe40f('0x1f')]?_['map'](_0x221a8f[_0xe40f('0x1a')][_0xe40f('0x1f')],function(_0x31e9cb){return{'model':db[_0x31e9cb[_0xe40f('0x20')]],'as':_0x31e9cb['as'],'attributes':_0x31e9cb[_0xe40f('0x1d')],'include':_0x31e9cb['include']?_[_0xe40f('0x21')](_0x31e9cb[_0xe40f('0x1f')],function(_0x44bf8f){return{'model':db[_0x44bf8f[_0xe40f('0x20')]],'as':_0x44bf8f['as'],'attributes':_0x44bf8f[_0xe40f('0x1d')],'include':_0x44bf8f['include']?_[_0xe40f('0x21')](_0x44bf8f[_0xe40f('0x1f')],function(_0x30e879){return{'model':db[_0x30e879[_0xe40f('0x20')]],'as':_0x30e879['as'],'attributes':_0x30e879[_0xe40f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe40f('0xd')](function(_0x4218d1){logger[_0xe40f('0x16')](_0xe40f('0x18'),_0x221a8f);logger[_0xe40f('0x10')]('GetCmHopperBlack',_0x221a8f,JSON['stringify'](_0x4218d1));_0x790ffd(_0x4218d1);})[_0xe40f('0x17')](function(_0x177abe){logger[_0xe40f('0x14')](_0xe40f('0x18'),_0x177abe[_0xe40f('0x15')],_0x221a8f);_0x33e8c2(_0x510fc2[_0xe40f('0x14')](0x1f4,_0x177abe[_0xe40f('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x5c3b79){var _0x368ac3=this;return new Promise(function(_0x4832a4,_0x21e38d){return db[_0xe40f('0x19')][_0xe40f('0x22')](_0x5c3b79[_0xe40f('0x23')],{'raw':_0x5c3b79[_0xe40f('0x1a')]?_0x5c3b79[_0xe40f('0x1a')][_0xe40f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c3b79['options']?_0x5c3b79[_0xe40f('0x1a')][_0xe40f('0x1c')]||null:null,'attributes':_0x5c3b79['options']?_0x5c3b79[_0xe40f('0x1a')][_0xe40f('0x1d')]||null:null,'limit':_0x5c3b79['options']?_0x5c3b79[_0xe40f('0x1a')][_0xe40f('0x1e')]||null:null})['then'](function(_0x3f9ebd){logger[_0xe40f('0x16')](_0xe40f('0x24'),_0x5c3b79);logger[_0xe40f('0x10')]('UpdateCmHopperBlack',_0x5c3b79,JSON[_0xe40f('0x12')](_0x3f9ebd));_0x4832a4(_0x3f9ebd);})[_0xe40f('0x17')](function(_0xa7b088){logger[_0xe40f('0x14')](_0xe40f('0x24'),_0xa7b088[_0xe40f('0x15')],_0x5c3b79);_0x21e38d(_0x368ac3[_0xe40f('0x14')](0x1f4,_0xa7b088[_0xe40f('0x15')]));});});};exports[_0xe40f('0x25')]=function(_0x596600){var _0x5ddd00=this;return new Promise(function(_0x1c7a36,_0x143263){return db[_0xe40f('0x19')]['destroy']({'where':_0x596600[_0xe40f('0x1a')]?_0x596600[_0xe40f('0x1a')][_0xe40f('0x1c')]||null:null})[_0xe40f('0xd')](function(_0x574abd){logger[_0xe40f('0x16')](_0xe40f('0x25'),_0x596600);logger['debug'](_0xe40f('0x25'),_0x596600,JSON[_0xe40f('0x12')](_0x574abd));_0x1c7a36(_0x574abd);})[_0xe40f('0x17')](function(_0x40cc3b){logger[_0xe40f('0x14')](_0xe40f('0x25'),_0x40cc3b['message'],_0x596600);_0x143263(_0x5ddd00[_0xe40f('0x14')](0x1f4,_0x40cc3b[_0xe40f('0x15')]));});});};
\ No newline at end of file
+var _0xd576=['limit','include','model','map','GetCmHopperBlack','CmHopperBlack','body','then','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','raw','options','where','attributes'];(function(_0x2b097c,_0x26e0eb){var _0x335df=function(_0x3c3346){while(--_0x3c3346){_0x2b097c['push'](_0x2b097c['shift']());}};_0x335df(++_0x26e0eb);}(_0xd576,0x1eb));var _0x6d57=function(_0x4bfdb3,_0x3e761f){_0x4bfdb3=_0x4bfdb3-0x0;var _0x1d5082=_0xd576[_0x4bfdb3];return _0x1d5082;};'use strict';var _=require(_0x6d57('0x0'));var util=require(_0x6d57('0x1'));var moment=require(_0x6d57('0x2'));var BPromise=require(_0x6d57('0x3'));var rs=require(_0x6d57('0x4'));var fs=require('fs');var Redis=require(_0x6d57('0x5'));var db=require(_0x6d57('0x6'))['db'];var utils=require(_0x6d57('0x7'));var logger=require(_0x6d57('0x8'))(_0x6d57('0x9'));var config=require(_0x6d57('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6d57('0xb')][_0x6d57('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16de92,_0x3b480f,_0x351244){return new BPromise(function(_0x5ea273,_0x2c490d){return client[_0x6d57('0xd')](_0x16de92,_0x351244)['then'](function(_0x433f81){logger['info'](_0x6d57('0xe'),_0x3b480f,_0x6d57('0xf'));logger[_0x6d57('0x10')](_0x6d57('0x11'),_0x3b480f,_0x6d57('0xf'),JSON[_0x6d57('0x12')](_0x433f81));if(_0x433f81['error']){if(_0x433f81[_0x6d57('0x13')]['code']===0x1f4){logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x3b480f,_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);return _0x2c490d(_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);}logger[_0x6d57('0x13')](_0x6d57('0xe'),_0x3b480f,_0x433f81[_0x6d57('0x13')]['message']);return _0x5ea273(_0x433f81[_0x6d57('0x13')][_0x6d57('0x14')]);}else{logger[_0x6d57('0x15')](_0x6d57('0xe'),_0x3b480f,_0x6d57('0xf'));_0x5ea273(_0x433f81[_0x6d57('0x16')][_0x6d57('0x14')]);}})[_0x6d57('0x17')](function(_0x5c8368){logger['error'](_0x6d57('0xe'),_0x3b480f,_0x5c8368);_0x2c490d(_0x5c8368);});});}exports['GetCmHopperBlack']=function(_0x441396){var _0x101831=this;return new Promise(function(_0xa20e78,_0x5145ae){return db['CmHopperBlack'][_0x6d57('0x18')]({'raw':_0x441396['options']?_0x441396['options'][_0x6d57('0x19')]===undefined?!![]:![]:!![],'where':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1b')]||null:null,'attributes':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1c')]||null:null,'limit':_0x441396[_0x6d57('0x1a')]?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1d')]||null:null,'include':_0x441396['options']?_0x441396[_0x6d57('0x1a')][_0x6d57('0x1e')]?_['map'](_0x441396['options'][_0x6d57('0x1e')],function(_0x3d3163){return{'model':db[_0x3d3163[_0x6d57('0x1f')]],'as':_0x3d3163['as'],'attributes':_0x3d3163['attributes'],'include':_0x3d3163[_0x6d57('0x1e')]?_[_0x6d57('0x20')](_0x3d3163['include'],function(_0x3352d4){return{'model':db[_0x3352d4[_0x6d57('0x1f')]],'as':_0x3352d4['as'],'attributes':_0x3352d4[_0x6d57('0x1c')],'include':_0x3352d4[_0x6d57('0x1e')]?_[_0x6d57('0x20')](_0x3352d4[_0x6d57('0x1e')],function(_0x442161){return{'model':db[_0x442161[_0x6d57('0x1f')]],'as':_0x442161['as'],'attributes':_0x442161['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x129481){logger[_0x6d57('0x15')]('GetCmHopperBlack',_0x441396);logger[_0x6d57('0x10')](_0x6d57('0x21'),_0x441396,JSON[_0x6d57('0x12')](_0x129481));_0xa20e78(_0x129481);})['catch'](function(_0x5bf8ed){logger[_0x6d57('0x13')](_0x6d57('0x21'),_0x5bf8ed[_0x6d57('0x14')],_0x441396);_0x5145ae(_0x101831[_0x6d57('0x13')](0x1f4,_0x5bf8ed['message']));});});};exports['UpdateCmHopperBlack']=function(_0x2f35df){var _0x348485=this;return new Promise(function(_0x25e6f4,_0x1da17b){return db[_0x6d57('0x22')]['update'](_0x2f35df[_0x6d57('0x23')],{'raw':_0x2f35df[_0x6d57('0x1a')]?_0x2f35df['options'][_0x6d57('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f35df['options']?_0x2f35df[_0x6d57('0x1a')]['where']||null:null,'attributes':_0x2f35df[_0x6d57('0x1a')]?_0x2f35df['options']['attributes']||null:null,'limit':_0x2f35df['options']?_0x2f35df['options']['limit']||null:null})[_0x6d57('0x24')](function(_0x1d2bfe){logger['info'](_0x6d57('0x25'),_0x2f35df);logger['debug'](_0x6d57('0x25'),_0x2f35df,JSON[_0x6d57('0x12')](_0x1d2bfe));_0x25e6f4(_0x1d2bfe);})[_0x6d57('0x17')](function(_0x4a0a66){logger[_0x6d57('0x13')]('UpdateCmHopperBlack',_0x4a0a66[_0x6d57('0x14')],_0x2f35df);_0x1da17b(_0x348485[_0x6d57('0x13')](0x1f4,_0x4a0a66[_0x6d57('0x14')]));});});};exports[_0x6d57('0x26')]=function(_0x348746){var _0x3bd1ea=this;return new Promise(function(_0x32ea03,_0x4cb232){return db[_0x6d57('0x22')][_0x6d57('0x27')]({'where':_0x348746[_0x6d57('0x1a')]?_0x348746[_0x6d57('0x1a')][_0x6d57('0x1b')]||null:null})['then'](function(_0x4ae1aa){logger[_0x6d57('0x15')](_0x6d57('0x26'),_0x348746);logger['debug'](_0x6d57('0x26'),_0x348746,JSON[_0x6d57('0x12')](_0x4ae1aa));_0x32ea03(_0x4ae1aa);})[_0x6d57('0x17')](function(_0x1f46ae){logger[_0x6d57('0x13')]('DestroyCmHopperBlack',_0x1f46ae[_0x6d57('0x14')],_0x348746);_0x4cb232(_0x3bd1ea[_0x6d57('0x13')](0x1f4,_0x1f46ae[_0x6d57('0x14')]));});});};
\ No newline at end of file