Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / api / smsTransferReport / smsTransferReport.controller.js
index d2dfbc5..2f5142d 100644 (file)
@@ -1 +1 @@
-const a579_0x193e=['filters','merge','set','fields','where','end','like','include','undefined','../../config/logger','status','name','nolimit','findAll','keys','rows','catch','update','send','params','type','../../mysqldb','create','count','SmsTransferReport','attributes','key','VIRTUAL','includeAll','lodash','length','destroy','../../components/parsers/qs','stack','findOne','then','model','sequelize','sendStatus','intersection','rawAttributes','query','fieldName','sort','map','describe','pick','error','limit','filter','json','body','options','index','offset'];(function(_0x4e30b6,_0x193e9b){const _0x2e5e4b=function(_0x15450b){while(--_0x15450b){_0x4e30b6['push'](_0x4e30b6['shift']());}};_0x2e5e4b(++_0x193e9b);}(a579_0x193e,0xb1));const a579_0x2e5e=function(_0x4e30b6,_0x193e9b){_0x4e30b6=_0x4e30b6-0x0;let _0x2e5e4b=a579_0x193e[_0x4e30b6];return _0x2e5e4b;};const _0x4c5886=a579_0x2e5e;'use strict';const _=require(_0x4c5886('0x11')),qs=require(_0x4c5886('0x14')),logger=require(_0x4c5886('0x34'))('api'),db=require(_0x4c5886('0x9'))['db'],{Op}=require(_0x4c5886('0x19'));function respondWithResult(_0x15450b,_0x245a51){return _0x245a51=_0x245a51||0xc8,function(_0x55dd7d){const _0x2e32fb=a579_0x2e5e;if(_0x55dd7d)return _0x15450b[_0x2e32fb('0x35')](_0x245a51)[_0x2e32fb('0x26')](_0x55dd7d);};}function respondWithFilteredResult(_0x31ce96,_0x45f3ad){return function(_0x2c5021){const _0x5259c5=a579_0x2e5e;if(_0x2c5021){const _0x191dbb=_0x2c5021[_0x5259c5('0xb')],_0x167288=_0x45f3ad['offset'];let _0x4415ef=_0x45f3ad[_0x5259c5('0x2a')]+_0x45f3ad[_0x5259c5('0x24')],_0x1a9bbc;return _0x4415ef>=_0x191dbb?(_0x4415ef=_0x191dbb,_0x1a9bbc=0xc8):_0x1a9bbc=0xce,_0x31ce96[_0x5259c5('0x35')](_0x1a9bbc),_0x31ce96[_0x5259c5('0x2d')]('Content-Range',_0x167288+'-'+_0x4415ef+'/'+_0x191dbb)[_0x5259c5('0x26')](_0x2c5021);}return null;};}function saveUpdates(_0x1bd64e){return function(_0x389294){const _0x37fe12=a579_0x2e5e;if(_0x389294)return _0x389294['update'](_0x1bd64e)[_0x37fe12('0x17')](function(_0x5ece6c){return _0x5ece6c;});return null;};}function removeEntity(_0x540392){return function(_0x48ea34){const _0x49c968=a579_0x2e5e;if(_0x48ea34)return _0x48ea34[_0x49c968('0x13')]()[_0x49c968('0x17')](function(){const _0x39d171=_0x49c968;_0x540392[_0x39d171('0x35')](0xcc)[_0x39d171('0x30')]();});};}function handleEntityNotFound(_0x1a13f3){return function(_0x182862){const _0x20af86=a579_0x2e5e;return!_0x182862&&_0x1a13f3[_0x20af86('0x1a')](0x194),_0x182862;};}function handleError(_0x375f90,_0x2f8578){return _0x2f8578=_0x2f8578||0x1f4,function(_0x158336){const _0x4c7330=a579_0x2e5e;logger[_0x4c7330('0x23')](_0x158336[_0x4c7330('0x15')]),_0x158336[_0x4c7330('0x36')]&&delete _0x158336[_0x4c7330('0x36')],_0x375f90[_0x4c7330('0x35')](_0x2f8578)[_0x4c7330('0x6')](_0x158336);};}exports[_0x4c5886('0x29')]=function(_0x16f07b,_0x3b97e3){const _0x258361=_0x4c5886;let _0x4c2bce={};const _0x357e37={},_0x2f99ab={'count':0x0,'rows':[]},_0x42e56c=_['map'](db[_0x258361('0xc')][_0x258361('0x1c')],function(_0xa635fd){const _0x236bc3=_0x258361;return{'name':_0xa635fd[_0x236bc3('0x1e')],'type':_0xa635fd[_0x236bc3('0x8')][_0x236bc3('0xe')]};});_0x357e37[_0x258361('0x18')]=_[_0x258361('0x20')](_0x42e56c,_0x258361('0x36')),_0x357e37['query']=_[_0x258361('0x2')](_0x16f07b['query']),_0x357e37['filters']=_[_0x258361('0x1b')](_0x357e37[_0x258361('0x18')],_0x357e37[_0x258361('0x1d')]),_0x4c2bce[_0x258361('0xd')]=_[_0x258361('0x1b')](_0x357e37[_0x258361('0x18')],qs[_0x258361('0x2e')](_0x16f07b[_0x258361('0x1d')][_0x258361('0x2e')])),_0x4c2bce[_0x258361('0xd')]=_0x4c2bce[_0x258361('0xd')][_0x258361('0x12')]?_0x4c2bce[_0x258361('0xd')]:_0x357e37[_0x258361('0x18')];typeof _0x16f07b[_0x258361('0x1d')][_0x258361('0x0')]===_0x258361('0x33')&&(_0x4c2bce['limit']=qs[_0x258361('0x24')](_0x16f07b[_0x258361('0x1d')][_0x258361('0x24')]),_0x4c2bce['offset']=qs['offset'](_0x16f07b['query'][_0x258361('0x2a')]));_0x4c2bce['order']=qs['sort'](_0x16f07b[_0x258361('0x1d')][_0x258361('0x1f')]),_0x4c2bce[_0x258361('0x2f')]=qs[_0x258361('0x2b')](_[_0x258361('0x22')](_0x16f07b['query'],_0x357e37[_0x258361('0x2b')]),_0x42e56c);_0x16f07b[_0x258361('0x1d')][_0x258361('0x25')]&&(_0x4c2bce['where']=_['merge'](_0x4c2bce[_0x258361('0x2f')],{[Op['or']]:_['map'](_0x42e56c,function(_0x56d6ef){const _0x3e69fc=_0x258361;if(_0x56d6ef[_0x3e69fc('0x8')]!==_0x3e69fc('0xf')){const _0x2ffda5={};return _0x2ffda5[_0x56d6ef[_0x3e69fc('0x36')]]={[Op[_0x3e69fc('0x31')]]:'%'+_0x16f07b['query'][_0x3e69fc('0x25')]+'%'},_0x2ffda5;}})}));_0x4c2bce=_['merge']({},_0x4c2bce,_0x16f07b[_0x258361('0x28')]);const _0x2e3cd3={'where':_0x4c2bce[_0x258361('0x2f')]};return db[_0x258361('0xc')][_0x258361('0xb')](_0x2e3cd3)[_0x258361('0x17')](function(_0x5e8c9b){const _0xaa3487=_0x258361;return _0x2f99ab[_0xaa3487('0xb')]=_0x5e8c9b,_0x16f07b[_0xaa3487('0x1d')][_0xaa3487('0x10')]&&(_0x4c2bce[_0xaa3487('0x32')]=[{'all':!![]}]),db[_0xaa3487('0xc')][_0xaa3487('0x1')](_0x4c2bce);})['then'](function(_0x174454){const _0x7f23ad=_0x258361;return _0x2f99ab[_0x7f23ad('0x3')]=_0x174454,_0x2f99ab;})[_0x258361('0x17')](respondWithFilteredResult(_0x3b97e3,_0x4c2bce))[_0x258361('0x4')](handleError(_0x3b97e3,null));},exports['show']=function(_0x36afee,_0x66b086){const _0x213177=_0x4c5886;let _0x292f03={'raw':!![],'where':{'id':_0x36afee[_0x213177('0x7')]['id']}};const _0x15ef4f={};return _0x15ef4f[_0x213177('0x18')]=_[_0x213177('0x2')](db[_0x213177('0xc')][_0x213177('0x1c')]),_0x15ef4f['query']=_['keys'](_0x36afee['query']),_0x15ef4f[_0x213177('0x2b')]=_[_0x213177('0x1b')](_0x15ef4f[_0x213177('0x18')],_0x15ef4f['query']),_0x292f03[_0x213177('0xd')]=_[_0x213177('0x1b')](_0x15ef4f[_0x213177('0x18')],qs[_0x213177('0x2e')](_0x36afee[_0x213177('0x1d')][_0x213177('0x2e')])),_0x292f03[_0x213177('0xd')]=_0x292f03[_0x213177('0xd')][_0x213177('0x12')]?_0x292f03[_0x213177('0xd')]:_0x15ef4f['model'],_0x36afee[_0x213177('0x1d')][_0x213177('0x10')]&&(_0x292f03[_0x213177('0x32')]=[{'all':!![]}]),_0x292f03=_[_0x213177('0x2c')]({},_0x292f03,_0x36afee[_0x213177('0x28')]),db[_0x213177('0xc')]['findOne'](_0x292f03)['then'](handleEntityNotFound(_0x66b086,null))[_0x213177('0x17')](respondWithResult(_0x66b086,null))['catch'](handleError(_0x66b086,null));},exports[_0x4c5886('0xa')]=function(_0x3472fb,_0x46e152){const _0x699371=_0x4c5886;return db[_0x699371('0xc')][_0x699371('0xa')](_0x3472fb[_0x699371('0x27')],{})[_0x699371('0x17')](respondWithResult(_0x46e152,0xc9))['catch'](handleError(_0x46e152,null));},exports[_0x4c5886('0x5')]=function(_0xeaa5b6,_0x33b363){const _0xa6c0a5=_0x4c5886;return _0xeaa5b6[_0xa6c0a5('0x27')]['id']&&delete _0xeaa5b6[_0xa6c0a5('0x27')]['id'],db['SmsTransferReport'][_0xa6c0a5('0x16')]({'where':{'id':_0xeaa5b6[_0xa6c0a5('0x7')]['id']}})[_0xa6c0a5('0x17')](handleEntityNotFound(_0x33b363,null))[_0xa6c0a5('0x17')](saveUpdates(_0xeaa5b6[_0xa6c0a5('0x27')],null))['then'](respondWithResult(_0x33b363,null))[_0xa6c0a5('0x4')](handleError(_0x33b363,null));},exports['destroy']=function(_0x32064c,_0x584f6b){const _0x505836=_0x4c5886;return db[_0x505836('0xc')]['findOne']({'where':{'id':_0x32064c[_0x505836('0x7')]['id']}})['then'](handleEntityNotFound(_0x584f6b,null))[_0x505836('0x17')](removeEntity(_0x584f6b,null))['catch'](handleError(_0x584f6b,null));},exports[_0x4c5886('0x21')]=function(_0xc507ef,_0x9ce900){const _0x3bc536=_0x4c5886;return db[_0x3bc536('0xc')]['describe']()[_0x3bc536('0x17')](respondWithResult(_0x9ce900,null))['catch'](handleError(_0x9ce900,null));};
\ No newline at end of file
+const a579_0x9b4f=['show','update','type','keys','findOne','create','send','offset','status','fields','../../components/parsers/qs','map','sort','rows','destroy','catch','length','where','nolimit','error','Content-Range','body','filter','../../mysqldb','model','sequelize','stack','end','findAll','includeAll','name','filters','params','intersection','limit','merge','then','include','json','set','count','like','key','rawAttributes','attributes','describe','order','index','SmsTransferReport','../../config/logger','query','api','options'];(function(_0x34c657,_0x9b4ffb){const _0x161ca9=function(_0x55ad2a){while(--_0x55ad2a){_0x34c657['push'](_0x34c657['shift']());}};_0x161ca9(++_0x9b4ffb);}(a579_0x9b4f,0x71));const a579_0x161c=function(_0x34c657,_0x9b4ffb){_0x34c657=_0x34c657-0x0;let _0x161ca9=a579_0x9b4f[_0x34c657];return _0x161ca9;};const _0xf2116b=a579_0x161c;'use strict';const _=require('lodash'),qs=require(_0xf2116b('0x3')),logger=require(_0xf2116b('0x2a'))(_0xf2116b('0x2c')),db=require(_0xf2116b('0x10'))['db'],{Op}=require(_0xf2116b('0x12'));function respondWithResult(_0x55ad2a,_0x5dc5ad){return _0x5dc5ad=_0x5dc5ad||0xc8,function(_0xbbecd1){const _0x489e09=a579_0x161c;if(_0xbbecd1)return _0x55ad2a[_0x489e09('0x1')](_0x5dc5ad)[_0x489e09('0x1f')](_0xbbecd1);};}function respondWithFilteredResult(_0x25398b,_0x3da63a){return function(_0x19dc27){const _0x552dad=a579_0x161c;if(_0x19dc27){const _0x356fd6=_0x19dc27[_0x552dad('0x21')],_0x77fabd=_0x3da63a[_0x552dad('0x0')];let _0x542ac5=_0x3da63a['offset']+_0x3da63a[_0x552dad('0x1b')],_0x51cdd7;return _0x542ac5>=_0x356fd6?(_0x542ac5=_0x356fd6,_0x51cdd7=0xc8):_0x51cdd7=0xce,_0x25398b[_0x552dad('0x1')](_0x51cdd7),_0x25398b[_0x552dad('0x20')](_0x552dad('0xd'),_0x77fabd+'-'+_0x542ac5+'/'+_0x356fd6)[_0x552dad('0x1f')](_0x19dc27);}return null;};}function saveUpdates(_0x28c227){return function(_0x36a59f){const _0x1afc82=a579_0x161c;if(_0x36a59f)return _0x36a59f[_0x1afc82('0x2f')](_0x28c227)['then'](function(_0xd4eb05){return _0xd4eb05;});return null;};}function removeEntity(_0x2ebe46){return function(_0x3417d3){const _0x1dbee2=a579_0x161c;if(_0x3417d3)return _0x3417d3[_0x1dbee2('0x7')]()[_0x1dbee2('0x1d')](function(){const _0xaff65=_0x1dbee2;_0x2ebe46['status'](0xcc)[_0xaff65('0x14')]();});};}function handleEntityNotFound(_0x5c21b7){return function(_0x55701){return!_0x55701&&_0x5c21b7['sendStatus'](0x194),_0x55701;};}function handleError(_0x219c41,_0x46549){return _0x46549=_0x46549||0x1f4,function(_0x5b364f){const _0x218820=a579_0x161c;logger[_0x218820('0xc')](_0x5b364f[_0x218820('0x13')]),_0x5b364f[_0x218820('0x17')]&&delete _0x5b364f[_0x218820('0x17')],_0x219c41[_0x218820('0x1')](_0x46549)[_0x218820('0x34')](_0x5b364f);};}exports[_0xf2116b('0x28')]=function(_0x1a1f94,_0x3d4fe8){const _0x31dd8a=_0xf2116b;let _0x33bdf={};const _0x25e9f2={},_0x118e49={'count':0x0,'rows':[]},_0x8f822c=_['map'](db[_0x31dd8a('0x29')][_0x31dd8a('0x24')],function(_0x271473){const _0x1b624f=_0x31dd8a;return{'name':_0x271473['fieldName'],'type':_0x271473['type'][_0x1b624f('0x23')]};});_0x25e9f2[_0x31dd8a('0x11')]=_[_0x31dd8a('0x4')](_0x8f822c,_0x31dd8a('0x17')),_0x25e9f2[_0x31dd8a('0x2b')]=_[_0x31dd8a('0x31')](_0x1a1f94['query']),_0x25e9f2[_0x31dd8a('0x18')]=_[_0x31dd8a('0x1a')](_0x25e9f2[_0x31dd8a('0x11')],_0x25e9f2[_0x31dd8a('0x2b')]),_0x33bdf[_0x31dd8a('0x25')]=_[_0x31dd8a('0x1a')](_0x25e9f2[_0x31dd8a('0x11')],qs[_0x31dd8a('0x2')](_0x1a1f94[_0x31dd8a('0x2b')][_0x31dd8a('0x2')])),_0x33bdf['attributes']=_0x33bdf[_0x31dd8a('0x25')]['length']?_0x33bdf[_0x31dd8a('0x25')]:_0x25e9f2[_0x31dd8a('0x11')];typeof _0x1a1f94[_0x31dd8a('0x2b')][_0x31dd8a('0xb')]==='undefined'&&(_0x33bdf[_0x31dd8a('0x1b')]=qs['limit'](_0x1a1f94[_0x31dd8a('0x2b')][_0x31dd8a('0x1b')]),_0x33bdf[_0x31dd8a('0x0')]=qs[_0x31dd8a('0x0')](_0x1a1f94[_0x31dd8a('0x2b')]['offset']));_0x33bdf[_0x31dd8a('0x27')]=qs[_0x31dd8a('0x5')](_0x1a1f94[_0x31dd8a('0x2b')][_0x31dd8a('0x5')]),_0x33bdf[_0x31dd8a('0xa')]=qs[_0x31dd8a('0x18')](_['pick'](_0x1a1f94[_0x31dd8a('0x2b')],_0x25e9f2['filters']),_0x8f822c);_0x1a1f94[_0x31dd8a('0x2b')][_0x31dd8a('0xf')]&&(_0x33bdf[_0x31dd8a('0xa')]=_[_0x31dd8a('0x1c')](_0x33bdf[_0x31dd8a('0xa')],{[Op['or']]:_[_0x31dd8a('0x4')](_0x8f822c,function(_0xefd4e1){const _0x530e15=_0x31dd8a;if(_0xefd4e1[_0x530e15('0x30')]!=='VIRTUAL'){const _0x443000={};return _0x443000[_0xefd4e1[_0x530e15('0x17')]]={[Op[_0x530e15('0x22')]]:'%'+_0x1a1f94[_0x530e15('0x2b')][_0x530e15('0xf')]+'%'},_0x443000;}})}));_0x33bdf=_[_0x31dd8a('0x1c')]({},_0x33bdf,_0x1a1f94['options']);const _0x17b05f={'where':_0x33bdf[_0x31dd8a('0xa')]};return db[_0x31dd8a('0x29')][_0x31dd8a('0x21')](_0x17b05f)[_0x31dd8a('0x1d')](function(_0x1808d8){const _0x5518b4=_0x31dd8a;return _0x118e49[_0x5518b4('0x21')]=_0x1808d8,_0x1a1f94['query'][_0x5518b4('0x16')]&&(_0x33bdf['include']=[{'all':!![]}]),db[_0x5518b4('0x29')][_0x5518b4('0x15')](_0x33bdf);})[_0x31dd8a('0x1d')](function(_0x4b7a43){const _0x1d5c4e=_0x31dd8a;return _0x118e49[_0x1d5c4e('0x6')]=_0x4b7a43,_0x118e49;})[_0x31dd8a('0x1d')](respondWithFilteredResult(_0x3d4fe8,_0x33bdf))['catch'](handleError(_0x3d4fe8,null));},exports[_0xf2116b('0x2e')]=function(_0x1ad151,_0x37ba6a){const _0x167199=_0xf2116b;let _0x53c2bb={'raw':!![],'where':{'id':_0x1ad151[_0x167199('0x19')]['id']}};const _0x1376dd={};return _0x1376dd[_0x167199('0x11')]=_[_0x167199('0x31')](db['SmsTransferReport'][_0x167199('0x24')]),_0x1376dd['query']=_['keys'](_0x1ad151['query']),_0x1376dd['filters']=_['intersection'](_0x1376dd[_0x167199('0x11')],_0x1376dd[_0x167199('0x2b')]),_0x53c2bb[_0x167199('0x25')]=_[_0x167199('0x1a')](_0x1376dd[_0x167199('0x11')],qs[_0x167199('0x2')](_0x1ad151[_0x167199('0x2b')][_0x167199('0x2')])),_0x53c2bb[_0x167199('0x25')]=_0x53c2bb[_0x167199('0x25')][_0x167199('0x9')]?_0x53c2bb['attributes']:_0x1376dd['model'],_0x1ad151[_0x167199('0x2b')]['includeAll']&&(_0x53c2bb[_0x167199('0x1e')]=[{'all':!![]}]),_0x53c2bb=_[_0x167199('0x1c')]({},_0x53c2bb,_0x1ad151[_0x167199('0x2d')]),db['SmsTransferReport']['findOne'](_0x53c2bb)[_0x167199('0x1d')](handleEntityNotFound(_0x37ba6a,null))[_0x167199('0x1d')](respondWithResult(_0x37ba6a,null))[_0x167199('0x8')](handleError(_0x37ba6a,null));},exports[_0xf2116b('0x33')]=function(_0x308e0a,_0x218695){const _0x3b7acf=_0xf2116b;return db[_0x3b7acf('0x29')][_0x3b7acf('0x33')](_0x308e0a[_0x3b7acf('0xe')],{})[_0x3b7acf('0x1d')](respondWithResult(_0x218695,0xc9))[_0x3b7acf('0x8')](handleError(_0x218695,null));},exports[_0xf2116b('0x2f')]=function(_0x25d3c7,_0x3c9dcc){const _0x3ffbae=_0xf2116b;return _0x25d3c7['body']['id']&&delete _0x25d3c7[_0x3ffbae('0xe')]['id'],db[_0x3ffbae('0x29')][_0x3ffbae('0x32')]({'where':{'id':_0x25d3c7[_0x3ffbae('0x19')]['id']}})[_0x3ffbae('0x1d')](handleEntityNotFound(_0x3c9dcc,null))['then'](saveUpdates(_0x25d3c7[_0x3ffbae('0xe')],null))[_0x3ffbae('0x1d')](respondWithResult(_0x3c9dcc,null))[_0x3ffbae('0x8')](handleError(_0x3c9dcc,null));},exports['destroy']=function(_0xde8626,_0x13fb6b){const _0x2f19fe=_0xf2116b;return db[_0x2f19fe('0x29')][_0x2f19fe('0x32')]({'where':{'id':_0xde8626[_0x2f19fe('0x19')]['id']}})['then'](handleEntityNotFound(_0x13fb6b,null))[_0x2f19fe('0x1d')](removeEntity(_0x13fb6b,null))[_0x2f19fe('0x8')](handleError(_0x13fb6b,null));},exports[_0xf2116b('0x26')]=function(_0x2f3a89,_0x318a90){const _0x4dddd5=_0xf2116b;return db[_0x4dddd5('0x29')][_0x4dddd5('0x26')]()[_0x4dddd5('0x1d')](respondWithResult(_0x318a90,null))[_0x4dddd5('0x8')](handleError(_0x318a90,null));};
\ No newline at end of file