c36d3baa485cfa7afc506947b3c33018bd40b72a
[motion-next.git] / server / api / cmHopperBlack / cmHopperBlack.rpc.js
1 const a144_0x50ec=['options','raw','where','update','stringify','attributes','../../config/logger','lodash','catch','UpdateCmHopperBlack','limit','body','destroy','map','GetCmHopperBlack','message','error','then','model','rpc','debug','DestroyCmHopperBlack','CmHopperBlack','include','../../mysqldb','findAll'];(function(_0xb98b2a,_0x50ecb6){const _0x56f5a8=function(_0x13ef95){while(--_0x13ef95){_0xb98b2a['push'](_0xb98b2a['shift']());}};_0x56f5a8(++_0x50ecb6);}(a144_0x50ec,0x16c));const a144_0x56f5=function(_0xb98b2a,_0x50ecb6){_0xb98b2a=_0xb98b2a-0x0;let _0x56f5a8=a144_0x50ec[_0xb98b2a];return _0x56f5a8;};const _0x32d5a0=a144_0x56f5;'use strict';const _=require(_0x32d5a0('0x7')),db=require(_0x32d5a0('0x18'))['db'],logger=require(_0x32d5a0('0x6'))(_0x32d5a0('0x13'));exports['GetCmHopperBlack']=function(_0x13ef95){const _0x287185=this;return new Promise(function(_0x1e4a92,_0x6e007a){const _0x438ac9=a144_0x56f5;return db['CmHopperBlack'][_0x438ac9('0x19')]({'raw':_0x13ef95[_0x438ac9('0x0')]?_0x13ef95[_0x438ac9('0x0')][_0x438ac9('0x1')]===undefined?!![]:![]:!![],'where':_0x13ef95[_0x438ac9('0x0')]?_0x13ef95['options'][_0x438ac9('0x2')]||null:null,'attributes':_0x13ef95['options']?_0x13ef95[_0x438ac9('0x0')]['attributes']||null:null,'limit':_0x13ef95['options']?_0x13ef95[_0x438ac9('0x0')][_0x438ac9('0xa')]||null:null,'include':_0x13ef95['options']?_0x13ef95[_0x438ac9('0x0')][_0x438ac9('0x17')]?_[_0x438ac9('0xd')](_0x13ef95[_0x438ac9('0x0')][_0x438ac9('0x17')],function(_0x257642){const _0x2e7293=_0x438ac9;return{'model':db[_0x257642[_0x2e7293('0x12')]],'as':_0x257642['as'],'attributes':_0x257642[_0x2e7293('0x5')],'include':_0x257642[_0x2e7293('0x17')]?_[_0x2e7293('0xd')](_0x257642['include'],function(_0xda2bb9){const _0xff5e06=_0x2e7293;return{'model':db[_0xda2bb9[_0xff5e06('0x12')]],'as':_0xda2bb9['as'],'attributes':_0xda2bb9[_0xff5e06('0x5')],'include':_0xda2bb9[_0xff5e06('0x17')]?_['map'](_0xda2bb9[_0xff5e06('0x17')],function(_0x23af9a){const _0x4973bd=_0xff5e06;return{'model':db[_0x23af9a[_0x4973bd('0x12')]],'as':_0x23af9a['as'],'attributes':_0x23af9a['attributes']};}):[]};}):[]};}):[]:[]})[_0x438ac9('0x11')](function(_0x420481){const _0x1b5b2b=_0x438ac9;logger['info'](_0x1b5b2b('0xe'),_0x13ef95),logger[_0x1b5b2b('0x14')](_0x1b5b2b('0xe'),_0x13ef95,JSON[_0x1b5b2b('0x4')](_0x420481)),_0x1e4a92(_0x420481);})[_0x438ac9('0x8')](function(_0x457c7d){const _0x4d9644=_0x438ac9;logger['error'](_0x4d9644('0xe'),_0x457c7d['message'],_0x13ef95),_0x6e007a(_0x287185[_0x4d9644('0x10')](0x1f4,_0x457c7d[_0x4d9644('0xf')]));});});},exports[_0x32d5a0('0x9')]=function(_0x383da0){const _0x46f21a=this;return new Promise(function(_0x91c26e,_0x522918){const _0xc11dc7=a144_0x56f5;return db[_0xc11dc7('0x16')][_0xc11dc7('0x3')](_0x383da0[_0xc11dc7('0xb')],{'raw':_0x383da0['options']?_0x383da0[_0xc11dc7('0x0')][_0xc11dc7('0x1')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x383da0['options']?_0x383da0[_0xc11dc7('0x0')][_0xc11dc7('0x2')]||null:null,'attributes':_0x383da0['options']?_0x383da0[_0xc11dc7('0x0')]['attributes']||null:null,'limit':_0x383da0[_0xc11dc7('0x0')]?_0x383da0[_0xc11dc7('0x0')][_0xc11dc7('0xa')]||null:null})[_0xc11dc7('0x11')](function(_0x4595f6){const _0x1ad642=_0xc11dc7;logger['info'](_0x1ad642('0x9'),_0x383da0),logger[_0x1ad642('0x14')]('UpdateCmHopperBlack',_0x383da0,JSON[_0x1ad642('0x4')](_0x4595f6)),_0x91c26e(_0x4595f6);})[_0xc11dc7('0x8')](function(_0x1f8431){const _0x264c22=_0xc11dc7;logger['error'](_0x264c22('0x9'),_0x1f8431[_0x264c22('0xf')],_0x383da0),_0x522918(_0x46f21a[_0x264c22('0x10')](0x1f4,_0x1f8431['message']));});});},exports[_0x32d5a0('0x15')]=function(_0x40df56){const _0x276a75=this;return new Promise(function(_0x164141,_0x15b682){const _0x2c0e6b=a144_0x56f5;return db[_0x2c0e6b('0x16')][_0x2c0e6b('0xc')]({'where':_0x40df56[_0x2c0e6b('0x0')]?_0x40df56[_0x2c0e6b('0x0')][_0x2c0e6b('0x2')]||null:null})['then'](function(_0xaae0c){const _0x3195e1=_0x2c0e6b;logger['info']('DestroyCmHopperBlack',_0x40df56),logger[_0x3195e1('0x14')](_0x3195e1('0x15'),_0x40df56,JSON[_0x3195e1('0x4')](_0xaae0c)),_0x164141(_0xaae0c);})[_0x2c0e6b('0x8')](function(_0xafa40a){const _0x2ce43a=_0x2c0e6b;logger[_0x2ce43a('0x10')](_0x2ce43a('0x15'),_0xafa40a[_0x2ce43a('0xf')],_0x40df56),_0x15b682(_0x276a75[_0x2ce43a('0x10')](0x1f4,_0xafa40a[_0x2ce43a('0xf')]));});});};