Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / cmHopperBlack / cmHopperBlack.rpc.js
index 4732d10..ce52e79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cc9=['moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','raw','options','where','attributes','include','map','model','debug','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9cc9,0x16a));var _0x99cc=function(_0x1953ed,_0xf2b731){_0x1953ed=_0x1953ed-0x0;var _0x9f7d37=_0x9cc9[_0x1953ed];return _0x9f7d37;};'use strict';var _=require('lodash');var util=require(_0x99cc('0x0'));var moment=require(_0x99cc('0x1'));var BPromise=require(_0x99cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99cc('0x4'));var config=require(_0x99cc('0x5'));var jayson=require(_0x99cc('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a808f,_0x251af5,_0x2e3660){return new BPromise(function(_0x51dd46,_0x4701a9){return client[_0x99cc('0x7')](_0x4a808f,_0x2e3660)[_0x99cc('0x8')](function(_0x2fffd2){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x251af5,_0x99cc('0x9'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x251af5,_0x99cc('0x9'),JSON[_0x99cc('0xa')](_0x2fffd2));if(_0x2fffd2[_0x99cc('0xb')]){if(_0x2fffd2[_0x99cc('0xb')][_0x99cc('0xc')]===0x1f4){logger[_0x99cc('0xb')](_0x99cc('0xd'),_0x251af5,_0x2fffd2[_0x99cc('0xb')][_0x99cc('0xe')]);return _0x4701a9(_0x2fffd2[_0x99cc('0xb')][_0x99cc('0xe')]);}logger[_0x99cc('0xb')](_0x99cc('0xd'),_0x251af5,_0x2fffd2[_0x99cc('0xb')]['message']);return _0x51dd46(_0x2fffd2[_0x99cc('0xb')][_0x99cc('0xe')]);}else{logger[_0x99cc('0xf')](_0x99cc('0xd'),_0x251af5,_0x99cc('0x9'));_0x51dd46(_0x2fffd2[_0x99cc('0x10')]['message']);}})[_0x99cc('0x11')](function(_0x5544ba){logger['error'](_0x99cc('0xd'),_0x251af5,_0x5544ba);_0x4701a9(_0x5544ba);});});}exports[_0x99cc('0x12')]=function(_0x764abd){var _0x1160a9=this;return new Promise(function(_0x4107f4,_0xfbe741){return db[_0x99cc('0x13')]['findAll']({'raw':_0x764abd['options']?_0x764abd['options'][_0x99cc('0x14')]===undefined?!![]:![]:!![],'where':_0x764abd[_0x99cc('0x15')]?_0x764abd[_0x99cc('0x15')][_0x99cc('0x16')]||null:null,'attributes':_0x764abd[_0x99cc('0x15')]?_0x764abd[_0x99cc('0x15')][_0x99cc('0x17')]||null:null,'limit':_0x764abd['options']?_0x764abd[_0x99cc('0x15')]['limit']||null:null,'include':_0x764abd[_0x99cc('0x15')]?_0x764abd[_0x99cc('0x15')][_0x99cc('0x18')]?_[_0x99cc('0x19')](_0x764abd[_0x99cc('0x15')][_0x99cc('0x18')],function(_0x242eae){return{'model':db[_0x242eae['model']],'as':_0x242eae['as'],'attributes':_0x242eae[_0x99cc('0x17')],'include':_0x242eae[_0x99cc('0x18')]?_[_0x99cc('0x19')](_0x242eae[_0x99cc('0x18')],function(_0x464463){return{'model':db[_0x464463[_0x99cc('0x1a')]],'as':_0x464463['as'],'attributes':_0x464463[_0x99cc('0x17')],'include':_0x464463[_0x99cc('0x18')]?_[_0x99cc('0x19')](_0x464463[_0x99cc('0x18')],function(_0x3101d8){return{'model':db[_0x3101d8[_0x99cc('0x1a')]],'as':_0x3101d8['as'],'attributes':_0x3101d8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xeb6656){logger['info'](_0x99cc('0x12'),_0x764abd);logger[_0x99cc('0x1b')]('GetCmHopperBlack',_0x764abd,JSON[_0x99cc('0xa')](_0xeb6656));_0x4107f4(_0xeb6656);})[_0x99cc('0x11')](function(_0x3ecfae){logger[_0x99cc('0xb')](_0x99cc('0x12'),_0x3ecfae[_0x99cc('0xe')],_0x764abd);_0xfbe741(_0x1160a9[_0x99cc('0xb')](0x1f4,_0x3ecfae[_0x99cc('0xe')]));});});};exports[_0x99cc('0x1c')]=function(_0x38925e){var _0x247325=this;return new Promise(function(_0x3f290f,_0x335bec){return db['CmHopperBlack'][_0x99cc('0x1d')](_0x38925e['body'],{'raw':_0x38925e[_0x99cc('0x15')]?_0x38925e[_0x99cc('0x15')][_0x99cc('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38925e[_0x99cc('0x15')]?_0x38925e[_0x99cc('0x15')][_0x99cc('0x16')]||null:null,'attributes':_0x38925e[_0x99cc('0x15')]?_0x38925e[_0x99cc('0x15')][_0x99cc('0x17')]||null:null,'limit':_0x38925e[_0x99cc('0x15')]?_0x38925e[_0x99cc('0x15')][_0x99cc('0x1e')]||null:null})[_0x99cc('0x8')](function(_0x2eda73){logger[_0x99cc('0xf')]('UpdateCmHopperBlack',_0x38925e);logger[_0x99cc('0x1b')](_0x99cc('0x1c'),_0x38925e,JSON['stringify'](_0x2eda73));_0x3f290f(_0x2eda73);})[_0x99cc('0x11')](function(_0x239f33){logger['error'](_0x99cc('0x1c'),_0x239f33[_0x99cc('0xe')],_0x38925e);_0x335bec(_0x247325[_0x99cc('0xb')](0x1f4,_0x239f33['message']));});});};exports[_0x99cc('0x1f')]=function(_0x404424){var _0x23233a=this;return new Promise(function(_0x3b2b3f,_0x26c63d){return db[_0x99cc('0x13')][_0x99cc('0x20')]({'where':_0x404424[_0x99cc('0x15')]?_0x404424[_0x99cc('0x15')][_0x99cc('0x16')]||null:null})['then'](function(_0x1fb042){logger[_0x99cc('0xf')](_0x99cc('0x1f'),_0x404424);logger[_0x99cc('0x1b')](_0x99cc('0x1f'),_0x404424,JSON[_0x99cc('0xa')](_0x1fb042));_0x3b2b3f(_0x1fb042);})[_0x99cc('0x11')](function(_0x40a072){logger[_0x99cc('0xb')]('DestroyCmHopperBlack',_0x40a072[_0x99cc('0xe')],_0x404424);_0x26c63d(_0x23233a[_0x99cc('0xb')](0x1f4,_0x40a072[_0x99cc('0xe')]));});});};
\ No newline at end of file
+var _0x8ef5=['../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x9df86,_0x1b8e6b){var _0x2e4b5d=function(_0x153df9){while(--_0x153df9){_0x9df86['push'](_0x9df86['shift']());}};_0x2e4b5d(++_0x1b8e6b);}(_0x8ef5,0x169));var _0x58ef=function(_0x567466,_0x542caf){_0x567466=_0x567466-0x0;var _0x5959af=_0x8ef5[_0x567466];return _0x5959af;};'use strict';var _=require(_0x58ef('0x0'));var util=require(_0x58ef('0x1'));var moment=require(_0x58ef('0x2'));var BPromise=require(_0x58ef('0x3'));var rs=require(_0x58ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ef('0x5'))['db'];var utils=require(_0x58ef('0x6'));var logger=require('../../config/logger')(_0x58ef('0x7'));var config=require(_0x58ef('0x8'));var jayson=require(_0x58ef('0x9'));var client=jayson[_0x58ef('0xa')][_0x58ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3725c5,_0x219dbe,_0x347f02){return new BPromise(function(_0x306fdc,_0x67e3cf){return client[_0x58ef('0xc')](_0x3725c5,_0x347f02)[_0x58ef('0xd')](function(_0x492f5f){logger[_0x58ef('0xe')](_0x58ef('0xf'),_0x219dbe,_0x58ef('0x10'));logger[_0x58ef('0x11')](_0x58ef('0x12'),_0x219dbe,'request\x20sent',JSON[_0x58ef('0x13')](_0x492f5f));if(_0x492f5f[_0x58ef('0x14')]){if(_0x492f5f['error'][_0x58ef('0x15')]===0x1f4){logger[_0x58ef('0x14')](_0x58ef('0xf'),_0x219dbe,_0x492f5f[_0x58ef('0x14')][_0x58ef('0x16')]);return _0x67e3cf(_0x492f5f[_0x58ef('0x14')][_0x58ef('0x16')]);}logger[_0x58ef('0x14')](_0x58ef('0xf'),_0x219dbe,_0x492f5f[_0x58ef('0x14')][_0x58ef('0x16')]);return _0x306fdc(_0x492f5f[_0x58ef('0x14')][_0x58ef('0x16')]);}else{logger[_0x58ef('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x219dbe,_0x58ef('0x10'));_0x306fdc(_0x492f5f[_0x58ef('0x17')][_0x58ef('0x16')]);}})['catch'](function(_0x3b3694){logger[_0x58ef('0x14')](_0x58ef('0xf'),_0x219dbe,_0x3b3694);_0x67e3cf(_0x3b3694);});});}exports[_0x58ef('0x18')]=function(_0x11d4b0){var _0x30ea67=this;return new Promise(function(_0x23dd55,_0x4da454){return db[_0x58ef('0x19')][_0x58ef('0x1a')]({'raw':_0x11d4b0[_0x58ef('0x1b')]?_0x11d4b0['options'][_0x58ef('0x1c')]===undefined?!![]:![]:!![],'where':_0x11d4b0[_0x58ef('0x1b')]?_0x11d4b0[_0x58ef('0x1b')][_0x58ef('0x1d')]||null:null,'attributes':_0x11d4b0['options']?_0x11d4b0[_0x58ef('0x1b')]['attributes']||null:null,'limit':_0x11d4b0[_0x58ef('0x1b')]?_0x11d4b0['options'][_0x58ef('0x1e')]||null:null,'include':_0x11d4b0[_0x58ef('0x1b')]?_0x11d4b0[_0x58ef('0x1b')][_0x58ef('0x1f')]?_[_0x58ef('0x20')](_0x11d4b0['options']['include'],function(_0x1de61d){return{'model':db[_0x1de61d[_0x58ef('0x21')]],'as':_0x1de61d['as'],'attributes':_0x1de61d[_0x58ef('0x22')],'include':_0x1de61d[_0x58ef('0x1f')]?_[_0x58ef('0x20')](_0x1de61d[_0x58ef('0x1f')],function(_0x5e8c4e){return{'model':db[_0x5e8c4e[_0x58ef('0x21')]],'as':_0x5e8c4e['as'],'attributes':_0x5e8c4e[_0x58ef('0x22')],'include':_0x5e8c4e[_0x58ef('0x1f')]?_[_0x58ef('0x20')](_0x5e8c4e['include'],function(_0x28fe6a){return{'model':db[_0x28fe6a[_0x58ef('0x21')]],'as':_0x28fe6a['as'],'attributes':_0x28fe6a[_0x58ef('0x22')]};}):[]};}):[]};}):[]:[]})[_0x58ef('0xd')](function(_0x215d88){logger['info'](_0x58ef('0x18'),_0x11d4b0);logger[_0x58ef('0x11')]('GetCmHopperBlack',_0x11d4b0,JSON[_0x58ef('0x13')](_0x215d88));_0x23dd55(_0x215d88);})[_0x58ef('0x23')](function(_0x3ccf38){logger[_0x58ef('0x14')](_0x58ef('0x18'),_0x3ccf38[_0x58ef('0x16')],_0x11d4b0);_0x4da454(_0x30ea67[_0x58ef('0x14')](0x1f4,_0x3ccf38[_0x58ef('0x16')]));});});};exports[_0x58ef('0x24')]=function(_0x32d49d){var _0x4f49b7=this;return new Promise(function(_0x1214a8,_0x396b6a){return db[_0x58ef('0x19')][_0x58ef('0x25')](_0x32d49d[_0x58ef('0x26')],{'raw':_0x32d49d['options']?_0x32d49d[_0x58ef('0x1b')][_0x58ef('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32d49d['options']?_0x32d49d[_0x58ef('0x1b')][_0x58ef('0x1d')]||null:null,'attributes':_0x32d49d[_0x58ef('0x1b')]?_0x32d49d[_0x58ef('0x1b')][_0x58ef('0x22')]||null:null,'limit':_0x32d49d[_0x58ef('0x1b')]?_0x32d49d[_0x58ef('0x1b')][_0x58ef('0x1e')]||null:null})[_0x58ef('0xd')](function(_0x514120){logger[_0x58ef('0xe')](_0x58ef('0x24'),_0x32d49d);logger[_0x58ef('0x11')](_0x58ef('0x24'),_0x32d49d,JSON[_0x58ef('0x13')](_0x514120));_0x1214a8(_0x514120);})[_0x58ef('0x23')](function(_0xda1ca9){logger[_0x58ef('0x14')](_0x58ef('0x24'),_0xda1ca9['message'],_0x32d49d);_0x396b6a(_0x4f49b7[_0x58ef('0x14')](0x1f4,_0xda1ca9[_0x58ef('0x16')]));});});};exports[_0x58ef('0x27')]=function(_0x7ea85b){var _0x4fd02c=this;return new Promise(function(_0x2a9341,_0x1ea285){return db['CmHopperBlack'][_0x58ef('0x28')]({'where':_0x7ea85b[_0x58ef('0x1b')]?_0x7ea85b[_0x58ef('0x1b')][_0x58ef('0x1d')]||null:null})['then'](function(_0x21d0fd){logger['info'](_0x58ef('0x27'),_0x7ea85b);logger['debug'](_0x58ef('0x27'),_0x7ea85b,JSON[_0x58ef('0x13')](_0x21d0fd));_0x2a9341(_0x21d0fd);})[_0x58ef('0x23')](function(_0x63b992){logger[_0x58ef('0x14')](_0x58ef('0x27'),_0x63b992[_0x58ef('0x16')],_0x7ea85b);_0x1ea285(_0x4fd02c['error'](0x1f4,_0x63b992[_0x58ef('0x16')]));});});};
\ No newline at end of file