Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / api / cmHopperBlack / cmHopperBlack.rpc.js
index 05bab30..a174367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe72a=['CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','CmHopperBlack','findAll','options','raw','attributes','limit','include','model','map','GetCmHopperBlack','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xe72a,0x1a5));var _0xae72=function(_0x51454c,_0x321284){_0x51454c=_0x51454c-0x0;var _0x494e1d=_0xe72a[_0x51454c];return _0x494e1d;};'use strict';var _=require('lodash');var util=require(_0xae72('0x0'));var moment=require('moment');var BPromise=require(_0xae72('0x1'));var rs=require(_0xae72('0x2'));var fs=require('fs');var Redis=require(_0xae72('0x3'));var db=require(_0xae72('0x4'))['db'];var utils=require(_0xae72('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xae72('0x6'));var jayson=require(_0xae72('0x7'));var client=jayson[_0xae72('0x8')][_0xae72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41301a,_0xfe0b8d,_0x1fea1f){return new BPromise(function(_0x1a9372,_0x570c2a){return client['request'](_0x41301a,_0x1fea1f)[_0xae72('0xa')](function(_0x4ddddb){logger['info'](_0xae72('0xb'),_0xfe0b8d,_0xae72('0xc'));logger[_0xae72('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0xfe0b8d,'request\x20sent',JSON[_0xae72('0xe')](_0x4ddddb));if(_0x4ddddb['error']){if(_0x4ddddb['error'][_0xae72('0xf')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0xfe0b8d,_0x4ddddb[_0xae72('0x10')]['message']);return _0x570c2a(_0x4ddddb[_0xae72('0x10')]['message']);}logger[_0xae72('0x10')](_0xae72('0xb'),_0xfe0b8d,_0x4ddddb['error'][_0xae72('0x11')]);return _0x1a9372(_0x4ddddb[_0xae72('0x10')][_0xae72('0x11')]);}else{logger[_0xae72('0x12')](_0xae72('0xb'),_0xfe0b8d,_0xae72('0xc'));_0x1a9372(_0x4ddddb[_0xae72('0x13')][_0xae72('0x11')]);}})[_0xae72('0x14')](function(_0x18fdc5){logger['error'](_0xae72('0xb'),_0xfe0b8d,_0x18fdc5);_0x570c2a(_0x18fdc5);});});}exports['GetCmHopperBlack']=function(_0x26b436){var _0x396d6a=this;return new Promise(function(_0x503537,_0x3f6c19){return db[_0xae72('0x15')][_0xae72('0x16')]({'raw':_0x26b436[_0xae72('0x17')]?_0x26b436[_0xae72('0x17')][_0xae72('0x18')]===undefined?!![]:![]:!![],'where':_0x26b436[_0xae72('0x17')]?_0x26b436['options']['where']||null:null,'attributes':_0x26b436[_0xae72('0x17')]?_0x26b436[_0xae72('0x17')][_0xae72('0x19')]||null:null,'limit':_0x26b436[_0xae72('0x17')]?_0x26b436[_0xae72('0x17')][_0xae72('0x1a')]||null:null,'include':_0x26b436[_0xae72('0x17')]?_0x26b436['options'][_0xae72('0x1b')]?_['map'](_0x26b436[_0xae72('0x17')][_0xae72('0x1b')],function(_0x3e2c1e){return{'model':db[_0x3e2c1e[_0xae72('0x1c')]],'as':_0x3e2c1e['as'],'attributes':_0x3e2c1e[_0xae72('0x19')],'include':_0x3e2c1e[_0xae72('0x1b')]?_[_0xae72('0x1d')](_0x3e2c1e[_0xae72('0x1b')],function(_0x13b7df){return{'model':db[_0x13b7df[_0xae72('0x1c')]],'as':_0x13b7df['as'],'attributes':_0x13b7df[_0xae72('0x19')],'include':_0x13b7df['include']?_[_0xae72('0x1d')](_0x13b7df['include'],function(_0x417bc3){return{'model':db[_0x417bc3[_0xae72('0x1c')]],'as':_0x417bc3['as'],'attributes':_0x417bc3[_0xae72('0x19')]};}):[]};}):[]};}):[]:[]})[_0xae72('0xa')](function(_0x56cd3b){logger['info'](_0xae72('0x1e'),_0x26b436);logger['debug'](_0xae72('0x1e'),_0x26b436,JSON[_0xae72('0xe')](_0x56cd3b));_0x503537(_0x56cd3b);})[_0xae72('0x14')](function(_0x1f86ba){logger['error'](_0xae72('0x1e'),_0x1f86ba[_0xae72('0x11')],_0x26b436);_0x3f6c19(_0x396d6a['error'](0x1f4,_0x1f86ba[_0xae72('0x11')]));});});};exports[_0xae72('0x1f')]=function(_0x3162e2){var _0x244ae6=this;return new Promise(function(_0x4496a0,_0x2d6709){return db['CmHopperBlack'][_0xae72('0x20')](_0x3162e2[_0xae72('0x21')],{'raw':_0x3162e2[_0xae72('0x17')]?_0x3162e2['options'][_0xae72('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3162e2[_0xae72('0x17')]?_0x3162e2['options'][_0xae72('0x22')]||null:null,'attributes':_0x3162e2['options']?_0x3162e2['options']['attributes']||null:null,'limit':_0x3162e2[_0xae72('0x17')]?_0x3162e2[_0xae72('0x17')][_0xae72('0x1a')]||null:null})[_0xae72('0xa')](function(_0x17a543){logger[_0xae72('0x12')](_0xae72('0x1f'),_0x3162e2);logger[_0xae72('0xd')](_0xae72('0x1f'),_0x3162e2,JSON[_0xae72('0xe')](_0x17a543));_0x4496a0(_0x17a543);})[_0xae72('0x14')](function(_0x44edd2){logger['error']('UpdateCmHopperBlack',_0x44edd2['message'],_0x3162e2);_0x2d6709(_0x244ae6[_0xae72('0x10')](0x1f4,_0x44edd2[_0xae72('0x11')]));});});};exports[_0xae72('0x23')]=function(_0x4b835d){var _0x2f1aca=this;return new Promise(function(_0x41eb07,_0x1dd165){return db[_0xae72('0x15')]['destroy']({'where':_0x4b835d[_0xae72('0x17')]?_0x4b835d[_0xae72('0x17')][_0xae72('0x22')]||null:null})[_0xae72('0xa')](function(_0x28af47){logger[_0xae72('0x12')](_0xae72('0x23'),_0x4b835d);logger[_0xae72('0xd')](_0xae72('0x23'),_0x4b835d,JSON[_0xae72('0xe')](_0x28af47));_0x41eb07(_0x28af47);})[_0xae72('0x14')](function(_0x471a4d){logger['error'](_0xae72('0x23'),_0x471a4d[_0xae72('0x11')],_0x4b835d);_0x1dd165(_0x2f1aca[_0xae72('0x10')](0x1f4,_0x471a4d[_0xae72('0x11')]));});});};
\ No newline at end of file
+var _0xe67b=['request','then','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','include','model','map','UpdateCmHopperBlack','update','body','limit','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x5d33ef,_0x4f25c0){var _0x4b2c34=function(_0x95f453){while(--_0x95f453){_0x5d33ef['push'](_0x5d33ef['shift']());}};_0x4b2c34(++_0x4f25c0);}(_0xe67b,0x18d));var _0xbe67=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0xe67b[_0x2d364e];return _0x1b9312;};'use strict';var _=require('lodash');var util=require(_0xbe67('0x0'));var moment=require(_0xbe67('0x1'));var BPromise=require(_0xbe67('0x2'));var rs=require(_0xbe67('0x3'));var fs=require('fs');var Redis=require(_0xbe67('0x4'));var db=require(_0xbe67('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe67('0x6'));var config=require(_0xbe67('0x7'));var jayson=require(_0xbe67('0x8'));var client=jayson['client'][_0xbe67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233056,_0x133011,_0x59e7b1){return new BPromise(function(_0x1455eb,_0x150998){return client[_0xbe67('0xa')](_0x233056,_0x59e7b1)[_0xbe67('0xb')](function(_0x1d1d5e){logger['info'](_0xbe67('0xc'),_0x133011,'request\x20sent');logger[_0xbe67('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x133011,_0xbe67('0xe'),JSON[_0xbe67('0xf')](_0x1d1d5e));if(_0x1d1d5e[_0xbe67('0x10')]){if(_0x1d1d5e[_0xbe67('0x10')][_0xbe67('0x11')]===0x1f4){logger[_0xbe67('0x10')](_0xbe67('0xc'),_0x133011,_0x1d1d5e['error']['message']);return _0x150998(_0x1d1d5e[_0xbe67('0x10')][_0xbe67('0x12')]);}logger[_0xbe67('0x10')](_0xbe67('0xc'),_0x133011,_0x1d1d5e[_0xbe67('0x10')][_0xbe67('0x12')]);return _0x1455eb(_0x1d1d5e['error'][_0xbe67('0x12')]);}else{logger[_0xbe67('0x13')](_0xbe67('0xc'),_0x133011,_0xbe67('0xe'));_0x1455eb(_0x1d1d5e[_0xbe67('0x14')]['message']);}})[_0xbe67('0x15')](function(_0x165c93){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x133011,_0x165c93);_0x150998(_0x165c93);});});}exports[_0xbe67('0x16')]=function(_0x2b016e){var _0x46e41f=this;return new Promise(function(_0x591bbb,_0x30ac6d){return db[_0xbe67('0x17')][_0xbe67('0x18')]({'raw':_0x2b016e[_0xbe67('0x19')]?_0x2b016e[_0xbe67('0x19')][_0xbe67('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b016e['options']?_0x2b016e['options'][_0xbe67('0x1b')]||null:null,'attributes':_0x2b016e['options']?_0x2b016e[_0xbe67('0x19')][_0xbe67('0x1c')]||null:null,'limit':_0x2b016e[_0xbe67('0x19')]?_0x2b016e[_0xbe67('0x19')]['limit']||null:null,'include':_0x2b016e[_0xbe67('0x19')]?_0x2b016e[_0xbe67('0x19')]['include']?_['map'](_0x2b016e['options'][_0xbe67('0x1d')],function(_0x5ca172){return{'model':db[_0x5ca172[_0xbe67('0x1e')]],'as':_0x5ca172['as'],'attributes':_0x5ca172[_0xbe67('0x1c')],'include':_0x5ca172[_0xbe67('0x1d')]?_[_0xbe67('0x1f')](_0x5ca172[_0xbe67('0x1d')],function(_0x25c83c){return{'model':db[_0x25c83c['model']],'as':_0x25c83c['as'],'attributes':_0x25c83c['attributes'],'include':_0x25c83c['include']?_['map'](_0x25c83c[_0xbe67('0x1d')],function(_0x15eef){return{'model':db[_0x15eef[_0xbe67('0x1e')]],'as':_0x15eef['as'],'attributes':_0x15eef[_0xbe67('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a0e3b){logger[_0xbe67('0x13')](_0xbe67('0x16'),_0x2b016e);logger[_0xbe67('0xd')](_0xbe67('0x16'),_0x2b016e,JSON[_0xbe67('0xf')](_0x2a0e3b));_0x591bbb(_0x2a0e3b);})[_0xbe67('0x15')](function(_0x81e515){logger[_0xbe67('0x10')](_0xbe67('0x16'),_0x81e515[_0xbe67('0x12')],_0x2b016e);_0x30ac6d(_0x46e41f['error'](0x1f4,_0x81e515['message']));});});};exports[_0xbe67('0x20')]=function(_0x32ffc7){var _0x1fd0b6=this;return new Promise(function(_0xbbeb06,_0x39801f){return db[_0xbe67('0x17')][_0xbe67('0x21')](_0x32ffc7[_0xbe67('0x22')],{'raw':_0x32ffc7['options']?_0x32ffc7[_0xbe67('0x19')][_0xbe67('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32ffc7[_0xbe67('0x19')]?_0x32ffc7[_0xbe67('0x19')][_0xbe67('0x1b')]||null:null,'attributes':_0x32ffc7[_0xbe67('0x19')]?_0x32ffc7[_0xbe67('0x19')][_0xbe67('0x1c')]||null:null,'limit':_0x32ffc7['options']?_0x32ffc7[_0xbe67('0x19')][_0xbe67('0x23')]||null:null})[_0xbe67('0xb')](function(_0xff53a7){logger[_0xbe67('0x13')](_0xbe67('0x20'),_0x32ffc7);logger[_0xbe67('0xd')](_0xbe67('0x20'),_0x32ffc7,JSON['stringify'](_0xff53a7));_0xbbeb06(_0xff53a7);})[_0xbe67('0x15')](function(_0x23fb3a){logger['error'](_0xbe67('0x20'),_0x23fb3a['message'],_0x32ffc7);_0x39801f(_0x1fd0b6[_0xbe67('0x10')](0x1f4,_0x23fb3a[_0xbe67('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x23e964){var _0xeb5602=this;return new Promise(function(_0x2f4c63,_0x96427f){return db[_0xbe67('0x17')]['destroy']({'where':_0x23e964[_0xbe67('0x19')]?_0x23e964[_0xbe67('0x19')][_0xbe67('0x1b')]||null:null})[_0xbe67('0xb')](function(_0x58f14d){logger[_0xbe67('0x13')](_0xbe67('0x24'),_0x23e964);logger[_0xbe67('0xd')](_0xbe67('0x24'),_0x23e964,JSON['stringify'](_0x58f14d));_0x2f4c63(_0x58f14d);})[_0xbe67('0x15')](function(_0x5824e9){logger[_0xbe67('0x10')](_0xbe67('0x24'),_0x5824e9['message'],_0x23e964);_0x96427f(_0xeb5602[_0xbe67('0x10')](0x1f4,_0x5824e9[_0xbe67('0x12')]));});});};
\ No newline at end of file