Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / api / memberReport / memberReport.controller.js
index a899bb8..c9a0e8f 100644 (file)
@@ -1 +1 @@
-const a448_0x2137=['api','include','index','create','model','options','includeAll','set','end','sort','describe','pick','fields','attributes','merge','MemberReport','intersection','like','stack','lodash','keys','fieldName','limit','../../mysqldb','map','type','../../config/logger','catch','where','length','send','findAll','nolimit','filter','order','rows','query','findOne','body','rawAttributes','offset','params','name','destroy','then','status','json','update','Content-Range','filters','count'];(function(_0x2590c4,_0x2137c5){const _0x2c34b7=function(_0x27751e){while(--_0x27751e){_0x2590c4['push'](_0x2590c4['shift']());}};_0x2c34b7(++_0x2137c5);}(a448_0x2137,0xb0));const a448_0x2c34=function(_0x2590c4,_0x2137c5){_0x2590c4=_0x2590c4-0x0;let _0x2c34b7=a448_0x2137[_0x2590c4];return _0x2c34b7;};const _0x9ff06e=a448_0x2c34;'use strict';const _=require(_0x9ff06e('0x2f')),qs=require('../../components/parsers/qs'),logger=require(_0x9ff06e('0x3'))(_0x9ff06e('0x1c')),db=require(_0x9ff06e('0x0'))['db'],{Op}=require('sequelize');function respondWithResult(_0x27751e,_0x225f7b){return _0x225f7b=_0x225f7b||0xc8,function(_0xc94f32){const _0x2bfddf=a448_0x2c34;if(_0xc94f32)return _0x27751e[_0x2bfddf('0x16')](_0x225f7b)[_0x2bfddf('0x17')](_0xc94f32);};}function respondWithFilteredResult(_0x40a33f,_0x263642){return function(_0x238fad){const _0x2e9760=a448_0x2c34;if(_0x238fad){const _0x133cc5=_0x238fad[_0x2e9760('0x1b')],_0x5f54bc=_0x263642[_0x2e9760('0x11')];let _0x118489=_0x263642[_0x2e9760('0x11')]+_0x263642['limit'],_0x3b2f21;return _0x118489>=_0x133cc5?(_0x118489=_0x133cc5,_0x3b2f21=0xc8):_0x3b2f21=0xce,_0x40a33f[_0x2e9760('0x16')](_0x3b2f21),_0x40a33f[_0x2e9760('0x23')](_0x2e9760('0x19'),_0x5f54bc+'-'+_0x118489+'/'+_0x133cc5)[_0x2e9760('0x17')](_0x238fad);}return null;};}function saveUpdates(_0x3f20d3){return function(_0x556ecb){const _0x1b23c7=a448_0x2c34;if(_0x556ecb)return _0x556ecb[_0x1b23c7('0x18')](_0x3f20d3)[_0x1b23c7('0x15')](function(_0x21a66e){return _0x21a66e;});return null;};}function removeEntity(_0x5212b0){return function(_0x3839ff){const _0x3bf1e6=a448_0x2c34;if(_0x3839ff)return _0x3839ff[_0x3bf1e6('0x14')]()[_0x3bf1e6('0x15')](function(){const _0x301f25=_0x3bf1e6;_0x5212b0['status'](0xcc)[_0x301f25('0x24')]();});};}function handleEntityNotFound(_0x318c96){return function(_0x489679){return!_0x489679&&_0x318c96['sendStatus'](0x194),_0x489679;};}function handleError(_0x4c3bf1,_0x146a10){return _0x146a10=_0x146a10||0x1f4,function(_0x84afa6){const _0x5d569b=a448_0x2c34;logger['error'](_0x84afa6[_0x5d569b('0x2e')]),_0x84afa6[_0x5d569b('0x13')]&&delete _0x84afa6[_0x5d569b('0x13')],_0x4c3bf1[_0x5d569b('0x16')](_0x146a10)[_0x5d569b('0x7')](_0x84afa6);};}exports[_0x9ff06e('0x1e')]=function(_0x291ffb,_0x9ab201){const _0x199a11=_0x9ff06e;let _0x301690={};const _0x1ef8a6={},_0x16fab5={'count':0x0,'rows':[]},_0x3d8dd9=_['map'](db[_0x199a11('0x2b')][_0x199a11('0x10')],function(_0x49f897){const _0x3f8572=_0x199a11;return{'name':_0x49f897[_0x3f8572('0x31')],'type':_0x49f897[_0x3f8572('0x2')]['key']};});_0x1ef8a6[_0x199a11('0x20')]=_['map'](_0x3d8dd9,_0x199a11('0x13')),_0x1ef8a6['query']=_[_0x199a11('0x30')](_0x291ffb[_0x199a11('0xd')]),_0x1ef8a6['filters']=_['intersection'](_0x1ef8a6[_0x199a11('0x20')],_0x1ef8a6[_0x199a11('0xd')]),_0x301690[_0x199a11('0x29')]=_[_0x199a11('0x2c')](_0x1ef8a6[_0x199a11('0x20')],qs['fields'](_0x291ffb[_0x199a11('0xd')][_0x199a11('0x28')])),_0x301690[_0x199a11('0x29')]=_0x301690[_0x199a11('0x29')][_0x199a11('0x6')]?_0x301690['attributes']:_0x1ef8a6['model'];typeof _0x291ffb[_0x199a11('0xd')][_0x199a11('0x9')]==='undefined'&&(_0x301690[_0x199a11('0x32')]=qs[_0x199a11('0x32')](_0x291ffb['query'][_0x199a11('0x32')]),_0x301690[_0x199a11('0x11')]=qs[_0x199a11('0x11')](_0x291ffb[_0x199a11('0xd')]['offset']));_0x301690[_0x199a11('0xb')]=qs[_0x199a11('0x25')](_0x291ffb[_0x199a11('0xd')][_0x199a11('0x25')]),_0x301690['where']=qs[_0x199a11('0x1a')](_[_0x199a11('0x27')](_0x291ffb[_0x199a11('0xd')],_0x1ef8a6['filters']),_0x3d8dd9);_0x291ffb[_0x199a11('0xd')][_0x199a11('0xa')]&&(_0x301690[_0x199a11('0x5')]=_[_0x199a11('0x2a')](_0x301690['where'],{[Op['or']]:_[_0x199a11('0x1')](_0x3d8dd9,function(_0x2e9144){const _0x56d751=_0x199a11;if(_0x2e9144['type']!=='VIRTUAL'){const _0xe0e111={};return _0xe0e111[_0x2e9144[_0x56d751('0x13')]]={[Op[_0x56d751('0x2d')]]:'%'+_0x291ffb['query'][_0x56d751('0xa')]+'%'},_0xe0e111;}})}));_0x301690=_[_0x199a11('0x2a')]({},_0x301690,_0x291ffb[_0x199a11('0x21')]);const _0x21e6fe={'where':_0x301690[_0x199a11('0x5')]};return db[_0x199a11('0x2b')][_0x199a11('0x1b')](_0x21e6fe)[_0x199a11('0x15')](function(_0x56cc81){const _0x315a1a=_0x199a11;return _0x16fab5[_0x315a1a('0x1b')]=_0x56cc81,_0x291ffb[_0x315a1a('0xd')]['includeAll']&&(_0x301690[_0x315a1a('0x1d')]=[{'all':!![]}]),db['MemberReport'][_0x315a1a('0x8')](_0x301690);})[_0x199a11('0x15')](function(_0x53040d){const _0x35499c=_0x199a11;return _0x16fab5[_0x35499c('0xc')]=_0x53040d,_0x16fab5;})[_0x199a11('0x15')](respondWithFilteredResult(_0x9ab201,_0x301690))[_0x199a11('0x4')](handleError(_0x9ab201,null));},exports['show']=function(_0x4c1710,_0x569134){const _0x29b8ff=_0x9ff06e;let _0x4b2b6a={'raw':!![],'where':{'id':_0x4c1710[_0x29b8ff('0x12')]['id']}};const _0x2e8f91={};return _0x2e8f91[_0x29b8ff('0x20')]=_[_0x29b8ff('0x30')](db['MemberReport']['rawAttributes']),_0x2e8f91[_0x29b8ff('0xd')]=_[_0x29b8ff('0x30')](_0x4c1710[_0x29b8ff('0xd')]),_0x2e8f91['filters']=_['intersection'](_0x2e8f91['model'],_0x2e8f91[_0x29b8ff('0xd')]),_0x4b2b6a[_0x29b8ff('0x29')]=_[_0x29b8ff('0x2c')](_0x2e8f91[_0x29b8ff('0x20')],qs['fields'](_0x4c1710[_0x29b8ff('0xd')][_0x29b8ff('0x28')])),_0x4b2b6a['attributes']=_0x4b2b6a[_0x29b8ff('0x29')]['length']?_0x4b2b6a['attributes']:_0x2e8f91['model'],_0x4c1710['query'][_0x29b8ff('0x22')]&&(_0x4b2b6a[_0x29b8ff('0x1d')]=[{'all':!![]}]),_0x4b2b6a=_['merge']({},_0x4b2b6a,_0x4c1710[_0x29b8ff('0x21')]),db[_0x29b8ff('0x2b')][_0x29b8ff('0xe')](_0x4b2b6a)[_0x29b8ff('0x15')](handleEntityNotFound(_0x569134,null))[_0x29b8ff('0x15')](respondWithResult(_0x569134,null))['catch'](handleError(_0x569134,null));},exports[_0x9ff06e('0x1f')]=function(_0x55e62e,_0xb9b52){const _0x5684f1=_0x9ff06e;return db[_0x5684f1('0x2b')][_0x5684f1('0x1f')](_0x55e62e[_0x5684f1('0xf')],{})[_0x5684f1('0x15')](respondWithResult(_0xb9b52,0xc9))[_0x5684f1('0x4')](handleError(_0xb9b52,null));},exports[_0x9ff06e('0x18')]=function(_0x33d38f,_0x5dbb6f){const _0x10341e=_0x9ff06e;return _0x33d38f[_0x10341e('0xf')]['id']&&delete _0x33d38f['body']['id'],db[_0x10341e('0x2b')][_0x10341e('0xe')]({'where':{'id':_0x33d38f[_0x10341e('0x12')]['id']}})[_0x10341e('0x15')](handleEntityNotFound(_0x5dbb6f,null))[_0x10341e('0x15')](saveUpdates(_0x33d38f['body'],null))[_0x10341e('0x15')](respondWithResult(_0x5dbb6f,null))[_0x10341e('0x4')](handleError(_0x5dbb6f,null));},exports[_0x9ff06e('0x14')]=function(_0x2f1528,_0x1b69ef){const _0x3846cf=_0x9ff06e;return db[_0x3846cf('0x2b')][_0x3846cf('0xe')]({'where':{'id':_0x2f1528[_0x3846cf('0x12')]['id']}})[_0x3846cf('0x15')](handleEntityNotFound(_0x1b69ef,null))['then'](removeEntity(_0x1b69ef,null))[_0x3846cf('0x4')](handleError(_0x1b69ef,null));},exports[_0x9ff06e('0x26')]=function(_0x7c7116,_0x5a2b00){const _0x1c2a26=_0x9ff06e;return db[_0x1c2a26('0x2b')][_0x1c2a26('0x26')]()[_0x1c2a26('0x15')](respondWithResult(_0x5a2b00,null))['catch'](handleError(_0x5a2b00,null));};
\ No newline at end of file
+const a448_0xb10c=['then','type','merge','status','options','update','sequelize','json','sendStatus','show','stack','count','findAll','length','VIRTUAL','describe','../../mysqldb','rawAttributes','findOne','../../config/logger','include','lodash','body','offset','filters','pick','name','end','filter','includeAll','model','create','params','where','api','keys','MemberReport','query','limit','nolimit','intersection','map','rows','sort','destroy','../../components/parsers/qs','attributes','like','catch','fields','set'];(function(_0x4cd188,_0xb10c52){const _0x51872a=function(_0x1f0462){while(--_0x1f0462){_0x4cd188['push'](_0x4cd188['shift']());}};_0x51872a(++_0xb10c52);}(a448_0xb10c,0x73));const a448_0x5187=function(_0x4cd188,_0xb10c52){_0x4cd188=_0x4cd188-0x0;let _0x51872a=a448_0xb10c[_0x4cd188];return _0x51872a;};const _0x41ac0d=a448_0x5187;'use strict';const _=require(_0x41ac0d('0x8')),qs=require(_0x41ac0d('0x20')),logger=require(_0x41ac0d('0x6'))(_0x41ac0d('0x15')),db=require(_0x41ac0d('0x3'))['db'],{Op}=require(_0x41ac0d('0x2c'));function respondWithResult(_0x1f0462,_0x583eaf){return _0x583eaf=_0x583eaf||0xc8,function(_0x3ebde5){const _0x52c0a1=a448_0x5187;if(_0x3ebde5)return _0x1f0462['status'](_0x583eaf)[_0x52c0a1('0x2d')](_0x3ebde5);};}function respondWithFilteredResult(_0x15be21,_0x20dfde){return function(_0x436b40){const _0x3447e6=a448_0x5187;if(_0x436b40){const _0x414bd7=_0x436b40['count'],_0x302bf7=_0x20dfde[_0x3447e6('0xa')];let _0x144f54=_0x20dfde[_0x3447e6('0xa')]+_0x20dfde[_0x3447e6('0x19')],_0x45f869;return _0x144f54>=_0x414bd7?(_0x144f54=_0x414bd7,_0x45f869=0xc8):_0x45f869=0xce,_0x15be21[_0x3447e6('0x29')](_0x45f869),_0x15be21[_0x3447e6('0x25')]('Content-Range',_0x302bf7+'-'+_0x144f54+'/'+_0x414bd7)[_0x3447e6('0x2d')](_0x436b40);}return null;};}function saveUpdates(_0x343cbd){return function(_0x6736dc){const _0x5b81ac=a448_0x5187;if(_0x6736dc)return _0x6736dc[_0x5b81ac('0x2b')](_0x343cbd)[_0x5b81ac('0x26')](function(_0x382acb){return _0x382acb;});return null;};}function removeEntity(_0x4f310f){return function(_0x28d87e){const _0x599c71=a448_0x5187;if(_0x28d87e)return _0x28d87e[_0x599c71('0x1f')]()[_0x599c71('0x26')](function(){const _0x37e554=_0x599c71;_0x4f310f[_0x37e554('0x29')](0xcc)[_0x37e554('0xe')]();});};}function handleEntityNotFound(_0xc52e98){return function(_0x430814){const _0x28c112=a448_0x5187;return!_0x430814&&_0xc52e98[_0x28c112('0x2e')](0x194),_0x430814;};}function handleError(_0x18b50f,_0x46b342){return _0x46b342=_0x46b342||0x1f4,function(_0x130a64){const _0x4d361b=a448_0x5187;logger['error'](_0x130a64[_0x4d361b('0x30')]),_0x130a64['name']&&delete _0x130a64[_0x4d361b('0xd')],_0x18b50f['status'](_0x46b342)['send'](_0x130a64);};}exports['index']=function(_0x39fc72,_0x255419){const _0x9be5c9=_0x41ac0d;let _0xe7ebfa={};const _0x2ece53={},_0x477bdf={'count':0x0,'rows':[]},_0x557d4f=_[_0x9be5c9('0x1c')](db[_0x9be5c9('0x17')]['rawAttributes'],function(_0x13245d){const _0x50de7a=_0x9be5c9;return{'name':_0x13245d['fieldName'],'type':_0x13245d[_0x50de7a('0x27')]['key']};});_0x2ece53[_0x9be5c9('0x11')]=_[_0x9be5c9('0x1c')](_0x557d4f,_0x9be5c9('0xd')),_0x2ece53['query']=_[_0x9be5c9('0x16')](_0x39fc72[_0x9be5c9('0x18')]),_0x2ece53[_0x9be5c9('0xb')]=_['intersection'](_0x2ece53[_0x9be5c9('0x11')],_0x2ece53[_0x9be5c9('0x18')]),_0xe7ebfa[_0x9be5c9('0x21')]=_[_0x9be5c9('0x1b')](_0x2ece53[_0x9be5c9('0x11')],qs[_0x9be5c9('0x24')](_0x39fc72[_0x9be5c9('0x18')][_0x9be5c9('0x24')])),_0xe7ebfa[_0x9be5c9('0x21')]=_0xe7ebfa['attributes'][_0x9be5c9('0x0')]?_0xe7ebfa['attributes']:_0x2ece53[_0x9be5c9('0x11')];typeof _0x39fc72['query'][_0x9be5c9('0x1a')]==='undefined'&&(_0xe7ebfa[_0x9be5c9('0x19')]=qs[_0x9be5c9('0x19')](_0x39fc72[_0x9be5c9('0x18')]['limit']),_0xe7ebfa[_0x9be5c9('0xa')]=qs[_0x9be5c9('0xa')](_0x39fc72[_0x9be5c9('0x18')]['offset']));_0xe7ebfa['order']=qs[_0x9be5c9('0x1e')](_0x39fc72[_0x9be5c9('0x18')]['sort']),_0xe7ebfa[_0x9be5c9('0x14')]=qs[_0x9be5c9('0xb')](_[_0x9be5c9('0xc')](_0x39fc72[_0x9be5c9('0x18')],_0x2ece53['filters']),_0x557d4f);_0x39fc72[_0x9be5c9('0x18')][_0x9be5c9('0xf')]&&(_0xe7ebfa[_0x9be5c9('0x14')]=_[_0x9be5c9('0x28')](_0xe7ebfa[_0x9be5c9('0x14')],{[Op['or']]:_[_0x9be5c9('0x1c')](_0x557d4f,function(_0x337547){const _0x26b930=_0x9be5c9;if(_0x337547['type']!==_0x26b930('0x1')){const _0x1450e5={};return _0x1450e5[_0x337547['name']]={[Op[_0x26b930('0x22')]]:'%'+_0x39fc72[_0x26b930('0x18')][_0x26b930('0xf')]+'%'},_0x1450e5;}})}));_0xe7ebfa=_[_0x9be5c9('0x28')]({},_0xe7ebfa,_0x39fc72[_0x9be5c9('0x2a')]);const _0xe497c3={'where':_0xe7ebfa[_0x9be5c9('0x14')]};return db['MemberReport'][_0x9be5c9('0x31')](_0xe497c3)[_0x9be5c9('0x26')](function(_0xe31e37){const _0x5de60e=_0x9be5c9;return _0x477bdf['count']=_0xe31e37,_0x39fc72[_0x5de60e('0x18')]['includeAll']&&(_0xe7ebfa[_0x5de60e('0x7')]=[{'all':!![]}]),db[_0x5de60e('0x17')][_0x5de60e('0x32')](_0xe7ebfa);})[_0x9be5c9('0x26')](function(_0x5176b4){const _0x14e44c=_0x9be5c9;return _0x477bdf[_0x14e44c('0x1d')]=_0x5176b4,_0x477bdf;})[_0x9be5c9('0x26')](respondWithFilteredResult(_0x255419,_0xe7ebfa))[_0x9be5c9('0x23')](handleError(_0x255419,null));},exports[_0x41ac0d('0x2f')]=function(_0xb70e3a,_0x548ea7){const _0x43f0d7=_0x41ac0d;let _0x16bbd9={'raw':!![],'where':{'id':_0xb70e3a['params']['id']}};const _0x354fcf={};return _0x354fcf[_0x43f0d7('0x11')]=_[_0x43f0d7('0x16')](db[_0x43f0d7('0x17')][_0x43f0d7('0x4')]),_0x354fcf[_0x43f0d7('0x18')]=_[_0x43f0d7('0x16')](_0xb70e3a[_0x43f0d7('0x18')]),_0x354fcf['filters']=_[_0x43f0d7('0x1b')](_0x354fcf[_0x43f0d7('0x11')],_0x354fcf[_0x43f0d7('0x18')]),_0x16bbd9[_0x43f0d7('0x21')]=_['intersection'](_0x354fcf[_0x43f0d7('0x11')],qs[_0x43f0d7('0x24')](_0xb70e3a['query'][_0x43f0d7('0x24')])),_0x16bbd9[_0x43f0d7('0x21')]=_0x16bbd9[_0x43f0d7('0x21')]['length']?_0x16bbd9[_0x43f0d7('0x21')]:_0x354fcf[_0x43f0d7('0x11')],_0xb70e3a['query'][_0x43f0d7('0x10')]&&(_0x16bbd9[_0x43f0d7('0x7')]=[{'all':!![]}]),_0x16bbd9=_[_0x43f0d7('0x28')]({},_0x16bbd9,_0xb70e3a['options']),db[_0x43f0d7('0x17')]['findOne'](_0x16bbd9)[_0x43f0d7('0x26')](handleEntityNotFound(_0x548ea7,null))['then'](respondWithResult(_0x548ea7,null))[_0x43f0d7('0x23')](handleError(_0x548ea7,null));},exports[_0x41ac0d('0x12')]=function(_0x5594fd,_0x523d77){const _0x58b537=_0x41ac0d;return db[_0x58b537('0x17')]['create'](_0x5594fd[_0x58b537('0x9')],{})[_0x58b537('0x26')](respondWithResult(_0x523d77,0xc9))[_0x58b537('0x23')](handleError(_0x523d77,null));},exports['update']=function(_0x46d4c2,_0x55a9b6){const _0x371d5e=_0x41ac0d;return _0x46d4c2[_0x371d5e('0x9')]['id']&&delete _0x46d4c2['body']['id'],db[_0x371d5e('0x17')][_0x371d5e('0x5')]({'where':{'id':_0x46d4c2[_0x371d5e('0x13')]['id']}})[_0x371d5e('0x26')](handleEntityNotFound(_0x55a9b6,null))[_0x371d5e('0x26')](saveUpdates(_0x46d4c2[_0x371d5e('0x9')],null))[_0x371d5e('0x26')](respondWithResult(_0x55a9b6,null))[_0x371d5e('0x23')](handleError(_0x55a9b6,null));},exports['destroy']=function(_0xa81093,_0x17bbdf){const _0x24f91b=_0x41ac0d;return db[_0x24f91b('0x17')][_0x24f91b('0x5')]({'where':{'id':_0xa81093[_0x24f91b('0x13')]['id']}})['then'](handleEntityNotFound(_0x17bbdf,null))[_0x24f91b('0x26')](removeEntity(_0x17bbdf,null))[_0x24f91b('0x23')](handleError(_0x17bbdf,null));},exports[_0x41ac0d('0x2')]=function(_0x58cb26,_0xb3e0dc){const _0x14b4c4=_0x41ac0d;return db['MemberReport'][_0x14b4c4('0x2')]()[_0x14b4c4('0x26')](respondWithResult(_0xb3e0dc,null))[_0x14b4c4('0x23')](handleError(_0xb3e0dc,null));};
\ No newline at end of file