Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / smsTransferReport / smsTransferReport.controller.js
index b2720e1..86cc0b8 100644 (file)
@@ -1 +1 @@
-const a579_0x2cf2=['describe','catch','merge','filter','show','key','body','model','sendStatus','lodash','name','end','fields','attributes','findOne','status','set','../../config/logger','includeAll','VIRTUAL','then','like','keys','destroy','rows','intersection','SmsTransferReport','map','rawAttributes','options','count','params','limit','api','../../components/parsers/qs','where','fieldName','filters','offset','sort','send','../../mysqldb','length','query','include','sequelize','update','json','create','Content-Range','stack','undefined','type'];(function(_0x13c2ea,_0x2cf29d){const _0x5b215b=function(_0x122df2){while(--_0x122df2){_0x13c2ea['push'](_0x13c2ea['shift']());}};_0x5b215b(++_0x2cf29d);}(a579_0x2cf2,0x1b5));const a579_0x5b21=function(_0x13c2ea,_0x2cf29d){_0x13c2ea=_0x13c2ea-0x0;let _0x5b215b=a579_0x2cf2[_0x13c2ea];return _0x5b215b;};const _0x2078c3=a579_0x5b21;'use strict';const _=require(_0x2078c3('0x31')),qs=require(_0x2078c3('0x15')),logger=require(_0x2078c3('0x4'))(_0x2078c3('0x14')),db=require(_0x2078c3('0x1c'))['db'],{Op}=require(_0x2078c3('0x20'));function respondWithResult(_0x122df2,_0x52324e){return _0x52324e=_0x52324e||0xc8,function(_0x1d4cf9){const _0x1f45c2=a579_0x5b21;if(_0x1d4cf9)return _0x122df2[_0x1f45c2('0x2')](_0x52324e)[_0x1f45c2('0x22')](_0x1d4cf9);};}function respondWithFilteredResult(_0x5c7900,_0x131c27){return function(_0x2e6a37){const _0x583eb4=a579_0x5b21;if(_0x2e6a37){const _0x29ab46=_0x2e6a37[_0x583eb4('0x11')],_0x458c59=_0x131c27[_0x583eb4('0x19')];let _0xfb4995=_0x131c27['offset']+_0x131c27['limit'],_0x4575f0;return _0xfb4995>=_0x29ab46?(_0xfb4995=_0x29ab46,_0x4575f0=0xc8):_0x4575f0=0xce,_0x5c7900[_0x583eb4('0x2')](_0x4575f0),_0x5c7900[_0x583eb4('0x3')](_0x583eb4('0x24'),_0x458c59+'-'+_0xfb4995+'/'+_0x29ab46)['json'](_0x2e6a37);}return null;};}function saveUpdates(_0x5b37bd){return function(_0x3b9af9){const _0x381cdb=a579_0x5b21;if(_0x3b9af9)return _0x3b9af9[_0x381cdb('0x21')](_0x5b37bd)[_0x381cdb('0x7')](function(_0x5433d0){return _0x5433d0;});return null;};}function removeEntity(_0x4a9d0a){return function(_0x3944a7){const _0x5e7a33=a579_0x5b21;if(_0x3944a7)return _0x3944a7[_0x5e7a33('0xa')]()[_0x5e7a33('0x7')](function(){const _0x526ae4=_0x5e7a33;_0x4a9d0a[_0x526ae4('0x2')](0xcc)[_0x526ae4('0x33')]();});};}function handleEntityNotFound(_0x10cefd){return function(_0x2a8c32){const _0xfaa15a=a579_0x5b21;return!_0x2a8c32&&_0x10cefd[_0xfaa15a('0x30')](0x194),_0x2a8c32;};}function handleError(_0x14ecae,_0x4f0812){return _0x4f0812=_0x4f0812||0x1f4,function(_0x2d5ab7){const _0x21d5c8=a579_0x5b21;logger['error'](_0x2d5ab7[_0x21d5c8('0x25')]),_0x2d5ab7[_0x21d5c8('0x32')]&&delete _0x2d5ab7[_0x21d5c8('0x32')],_0x14ecae[_0x21d5c8('0x2')](_0x4f0812)[_0x21d5c8('0x1b')](_0x2d5ab7);};}exports['index']=function(_0x5b56fa,_0x533a6c){const _0x364cf4=_0x2078c3;let _0x5eabae={};const _0x3b2afc={},_0x6b551e={'count':0x0,'rows':[]},_0x5cbc00=_[_0x364cf4('0xe')](db[_0x364cf4('0xd')][_0x364cf4('0xf')],function(_0xf7feae){const _0x3bf83c=_0x364cf4;return{'name':_0xf7feae[_0x3bf83c('0x17')],'type':_0xf7feae['type'][_0x3bf83c('0x2d')]};});_0x3b2afc[_0x364cf4('0x2f')]=_['map'](_0x5cbc00,'name'),_0x3b2afc[_0x364cf4('0x1e')]=_[_0x364cf4('0x9')](_0x5b56fa['query']),_0x3b2afc[_0x364cf4('0x18')]=_[_0x364cf4('0xc')](_0x3b2afc['model'],_0x3b2afc['query']),_0x5eabae[_0x364cf4('0x0')]=_[_0x364cf4('0xc')](_0x3b2afc[_0x364cf4('0x2f')],qs['fields'](_0x5b56fa[_0x364cf4('0x1e')][_0x364cf4('0x34')])),_0x5eabae['attributes']=_0x5eabae[_0x364cf4('0x0')][_0x364cf4('0x1d')]?_0x5eabae[_0x364cf4('0x0')]:_0x3b2afc[_0x364cf4('0x2f')];typeof _0x5b56fa[_0x364cf4('0x1e')]['nolimit']===_0x364cf4('0x26')&&(_0x5eabae[_0x364cf4('0x13')]=qs['limit'](_0x5b56fa['query'][_0x364cf4('0x13')]),_0x5eabae[_0x364cf4('0x19')]=qs[_0x364cf4('0x19')](_0x5b56fa[_0x364cf4('0x1e')][_0x364cf4('0x19')]));_0x5eabae['order']=qs[_0x364cf4('0x1a')](_0x5b56fa[_0x364cf4('0x1e')][_0x364cf4('0x1a')]),_0x5eabae['where']=qs['filters'](_['pick'](_0x5b56fa[_0x364cf4('0x1e')],_0x3b2afc[_0x364cf4('0x18')]),_0x5cbc00);_0x5b56fa[_0x364cf4('0x1e')][_0x364cf4('0x2b')]&&(_0x5eabae['where']=_[_0x364cf4('0x2a')](_0x5eabae[_0x364cf4('0x16')],{[Op['or']]:_[_0x364cf4('0xe')](_0x5cbc00,function(_0x240264){const _0x83d0cf=_0x364cf4;if(_0x240264[_0x83d0cf('0x27')]!==_0x83d0cf('0x6')){const _0xb1ceb3={};return _0xb1ceb3[_0x240264[_0x83d0cf('0x32')]]={[Op[_0x83d0cf('0x8')]]:'%'+_0x5b56fa['query'][_0x83d0cf('0x2b')]+'%'},_0xb1ceb3;}})}));_0x5eabae=_[_0x364cf4('0x2a')]({},_0x5eabae,_0x5b56fa[_0x364cf4('0x10')]);const _0xe7a187={'where':_0x5eabae['where']};return db[_0x364cf4('0xd')][_0x364cf4('0x11')](_0xe7a187)[_0x364cf4('0x7')](function(_0x3ff3e9){const _0x8ce13=_0x364cf4;return _0x6b551e[_0x8ce13('0x11')]=_0x3ff3e9,_0x5b56fa[_0x8ce13('0x1e')][_0x8ce13('0x5')]&&(_0x5eabae[_0x8ce13('0x1f')]=[{'all':!![]}]),db[_0x8ce13('0xd')]['findAll'](_0x5eabae);})[_0x364cf4('0x7')](function(_0x447a2a){const _0xef40a8=_0x364cf4;return _0x6b551e[_0xef40a8('0xb')]=_0x447a2a,_0x6b551e;})[_0x364cf4('0x7')](respondWithFilteredResult(_0x533a6c,_0x5eabae))['catch'](handleError(_0x533a6c,null));},exports[_0x2078c3('0x2c')]=function(_0x480367,_0x365e5c){const _0x5cc538=_0x2078c3;let _0x1104f0={'raw':!![],'where':{'id':_0x480367['params']['id']}};const _0x26a302={};return _0x26a302[_0x5cc538('0x2f')]=_[_0x5cc538('0x9')](db['SmsTransferReport']['rawAttributes']),_0x26a302['query']=_[_0x5cc538('0x9')](_0x480367[_0x5cc538('0x1e')]),_0x26a302[_0x5cc538('0x18')]=_[_0x5cc538('0xc')](_0x26a302['model'],_0x26a302[_0x5cc538('0x1e')]),_0x1104f0[_0x5cc538('0x0')]=_[_0x5cc538('0xc')](_0x26a302[_0x5cc538('0x2f')],qs[_0x5cc538('0x34')](_0x480367[_0x5cc538('0x1e')][_0x5cc538('0x34')])),_0x1104f0[_0x5cc538('0x0')]=_0x1104f0[_0x5cc538('0x0')][_0x5cc538('0x1d')]?_0x1104f0['attributes']:_0x26a302[_0x5cc538('0x2f')],_0x480367['query'][_0x5cc538('0x5')]&&(_0x1104f0[_0x5cc538('0x1f')]=[{'all':!![]}]),_0x1104f0=_['merge']({},_0x1104f0,_0x480367[_0x5cc538('0x10')]),db[_0x5cc538('0xd')][_0x5cc538('0x1')](_0x1104f0)[_0x5cc538('0x7')](handleEntityNotFound(_0x365e5c,null))[_0x5cc538('0x7')](respondWithResult(_0x365e5c,null))['catch'](handleError(_0x365e5c,null));},exports[_0x2078c3('0x23')]=function(_0x5e2016,_0x3c926f){const _0x124045=_0x2078c3;return db['SmsTransferReport'][_0x124045('0x23')](_0x5e2016[_0x124045('0x2e')],{})[_0x124045('0x7')](respondWithResult(_0x3c926f,0xc9))['catch'](handleError(_0x3c926f,null));},exports[_0x2078c3('0x21')]=function(_0x3f0e1e,_0x1eafcd){const _0x1a4eef=_0x2078c3;return _0x3f0e1e[_0x1a4eef('0x2e')]['id']&&delete _0x3f0e1e['body']['id'],db['SmsTransferReport'][_0x1a4eef('0x1')]({'where':{'id':_0x3f0e1e[_0x1a4eef('0x12')]['id']}})[_0x1a4eef('0x7')](handleEntityNotFound(_0x1eafcd,null))[_0x1a4eef('0x7')](saveUpdates(_0x3f0e1e['body'],null))[_0x1a4eef('0x7')](respondWithResult(_0x1eafcd,null))[_0x1a4eef('0x29')](handleError(_0x1eafcd,null));},exports[_0x2078c3('0xa')]=function(_0x199a60,_0x46613c){const _0x5b907b=_0x2078c3;return db[_0x5b907b('0xd')]['findOne']({'where':{'id':_0x199a60['params']['id']}})[_0x5b907b('0x7')](handleEntityNotFound(_0x46613c,null))[_0x5b907b('0x7')](removeEntity(_0x46613c,null))['catch'](handleError(_0x46613c,null));},exports[_0x2078c3('0x28')]=function(_0x323e22,_0xca6dfd){const _0x13d511=_0x2078c3;return db[_0x13d511('0xd')][_0x13d511('0x28')]()[_0x13d511('0x7')](respondWithResult(_0xca6dfd,null))[_0x13d511('0x29')](handleError(_0xca6dfd,null));};
\ No newline at end of file
+const a579_0x49a3=['../../mysqldb','limit','sendStatus','stack','send','show','filter','intersection','then','include','sort','attributes','destroy','where','body','status','offset','VIRTUAL','order','rawAttributes','findOne','SmsTransferReport','Content-Range','options','../../components/parsers/qs','update','fieldName','error','params','type','pick','end','includeAll','merge','../../config/logger','name','create','model','undefined','map','api','describe','count','query','fields','filters','catch','index','keys','findAll'];(function(_0x4273a4,_0x49a312){const _0xd560e7=function(_0x1b660f){while(--_0x1b660f){_0x4273a4['push'](_0x4273a4['shift']());}};_0xd560e7(++_0x49a312);}(a579_0x49a3,0x146));const a579_0xd560=function(_0x4273a4,_0x49a312){_0x4273a4=_0x4273a4-0x0;let _0xd560e7=a579_0x49a3[_0x4273a4];return _0xd560e7;};const _0xd40b0=a579_0xd560;'use strict';const _=require('lodash'),qs=require(_0xd40b0('0x30')),logger=require(_0xd40b0('0x8'))(_0xd40b0('0xe')),db=require(_0xd40b0('0x18'))['db'],{Op}=require('sequelize');function respondWithResult(_0x1b660f,_0x1a2c80){return _0x1a2c80=_0x1a2c80||0xc8,function(_0x172e68){const _0x1fef9d=a579_0xd560;if(_0x172e68)return _0x1b660f[_0x1fef9d('0x27')](_0x1a2c80)['json'](_0x172e68);};}function respondWithFilteredResult(_0x144a58,_0x112b77){return function(_0xdedab0){const _0x13d259=a579_0xd560;if(_0xdedab0){const _0x2b8770=_0xdedab0['count'],_0x570ea5=_0x112b77[_0x13d259('0x28')];let _0x462225=_0x112b77[_0x13d259('0x28')]+_0x112b77[_0x13d259('0x19')],_0x22b1d9;return _0x462225>=_0x2b8770?(_0x462225=_0x2b8770,_0x22b1d9=0xc8):_0x22b1d9=0xce,_0x144a58[_0x13d259('0x27')](_0x22b1d9),_0x144a58['set'](_0x13d259('0x2e'),_0x570ea5+'-'+_0x462225+'/'+_0x2b8770)['json'](_0xdedab0);}return null;};}function saveUpdates(_0x58de23){return function(_0x51b6f1){const _0x2bef2b=a579_0xd560;if(_0x51b6f1)return _0x51b6f1['update'](_0x58de23)[_0x2bef2b('0x20')](function(_0x17a596){return _0x17a596;});return null;};}function removeEntity(_0xa4dcb4){return function(_0x5319bb){if(_0x5319bb)return _0x5319bb['destroy']()['then'](function(){const _0x402d23=a579_0xd560;_0xa4dcb4[_0x402d23('0x27')](0xcc)[_0x402d23('0x5')]();});};}function handleEntityNotFound(_0x40bd61){return function(_0x580002){const _0x2dbc8b=a579_0xd560;return!_0x580002&&_0x40bd61[_0x2dbc8b('0x1a')](0x194),_0x580002;};}function handleError(_0x450862,_0x3814df){return _0x3814df=_0x3814df||0x1f4,function(_0x56e9d9){const _0x26138e=a579_0xd560;logger[_0x26138e('0x1')](_0x56e9d9[_0x26138e('0x1b')]),_0x56e9d9[_0x26138e('0x9')]&&delete _0x56e9d9[_0x26138e('0x9')],_0x450862['status'](_0x3814df)[_0x26138e('0x1c')](_0x56e9d9);};}exports[_0xd40b0('0x15')]=function(_0x203e5a,_0x5bbc1c){const _0x3d399e=_0xd40b0;let _0x3e6ce7={};const _0x18d2c9={},_0x16dbc0={'count':0x0,'rows':[]},_0x3eb9e3=_[_0x3d399e('0xd')](db[_0x3d399e('0x2d')][_0x3d399e('0x2b')],function(_0x1d73ad){const _0x5c0246=_0x3d399e;return{'name':_0x1d73ad[_0x5c0246('0x0')],'type':_0x1d73ad['type']['key']};});_0x18d2c9['model']=_['map'](_0x3eb9e3,_0x3d399e('0x9')),_0x18d2c9['query']=_[_0x3d399e('0x16')](_0x203e5a[_0x3d399e('0x11')]),_0x18d2c9[_0x3d399e('0x13')]=_[_0x3d399e('0x1f')](_0x18d2c9[_0x3d399e('0xb')],_0x18d2c9[_0x3d399e('0x11')]),_0x3e6ce7[_0x3d399e('0x23')]=_[_0x3d399e('0x1f')](_0x18d2c9[_0x3d399e('0xb')],qs['fields'](_0x203e5a[_0x3d399e('0x11')][_0x3d399e('0x12')])),_0x3e6ce7[_0x3d399e('0x23')]=_0x3e6ce7[_0x3d399e('0x23')]['length']?_0x3e6ce7[_0x3d399e('0x23')]:_0x18d2c9[_0x3d399e('0xb')];typeof _0x203e5a[_0x3d399e('0x11')]['nolimit']===_0x3d399e('0xc')&&(_0x3e6ce7[_0x3d399e('0x19')]=qs[_0x3d399e('0x19')](_0x203e5a[_0x3d399e('0x11')][_0x3d399e('0x19')]),_0x3e6ce7['offset']=qs[_0x3d399e('0x28')](_0x203e5a[_0x3d399e('0x11')][_0x3d399e('0x28')]));_0x3e6ce7[_0x3d399e('0x2a')]=qs[_0x3d399e('0x22')](_0x203e5a[_0x3d399e('0x11')][_0x3d399e('0x22')]),_0x3e6ce7[_0x3d399e('0x25')]=qs[_0x3d399e('0x13')](_[_0x3d399e('0x4')](_0x203e5a[_0x3d399e('0x11')],_0x18d2c9[_0x3d399e('0x13')]),_0x3eb9e3);_0x203e5a[_0x3d399e('0x11')][_0x3d399e('0x1e')]&&(_0x3e6ce7[_0x3d399e('0x25')]=_['merge'](_0x3e6ce7[_0x3d399e('0x25')],{[Op['or']]:_[_0x3d399e('0xd')](_0x3eb9e3,function(_0x13be96){const _0x358d8f=_0x3d399e;if(_0x13be96[_0x358d8f('0x3')]!==_0x358d8f('0x29')){const _0xd9f6c1={};return _0xd9f6c1[_0x13be96[_0x358d8f('0x9')]]={[Op['like']]:'%'+_0x203e5a[_0x358d8f('0x11')][_0x358d8f('0x1e')]+'%'},_0xd9f6c1;}})}));_0x3e6ce7=_[_0x3d399e('0x7')]({},_0x3e6ce7,_0x203e5a[_0x3d399e('0x2f')]);const _0x5d8406={'where':_0x3e6ce7[_0x3d399e('0x25')]};return db[_0x3d399e('0x2d')][_0x3d399e('0x10')](_0x5d8406)[_0x3d399e('0x20')](function(_0x54ca44){const _0x3e126b=_0x3d399e;return _0x16dbc0[_0x3e126b('0x10')]=_0x54ca44,_0x203e5a[_0x3e126b('0x11')]['includeAll']&&(_0x3e6ce7['include']=[{'all':!![]}]),db[_0x3e126b('0x2d')][_0x3e126b('0x17')](_0x3e6ce7);})[_0x3d399e('0x20')](function(_0x32edfd){return _0x16dbc0['rows']=_0x32edfd,_0x16dbc0;})[_0x3d399e('0x20')](respondWithFilteredResult(_0x5bbc1c,_0x3e6ce7))[_0x3d399e('0x14')](handleError(_0x5bbc1c,null));},exports[_0xd40b0('0x1d')]=function(_0x39ab35,_0x57bd29){const _0x4ac74c=_0xd40b0;let _0x4f56d0={'raw':!![],'where':{'id':_0x39ab35[_0x4ac74c('0x2')]['id']}};const _0x1fd637={};return _0x1fd637[_0x4ac74c('0xb')]=_[_0x4ac74c('0x16')](db[_0x4ac74c('0x2d')][_0x4ac74c('0x2b')]),_0x1fd637[_0x4ac74c('0x11')]=_['keys'](_0x39ab35[_0x4ac74c('0x11')]),_0x1fd637[_0x4ac74c('0x13')]=_[_0x4ac74c('0x1f')](_0x1fd637[_0x4ac74c('0xb')],_0x1fd637[_0x4ac74c('0x11')]),_0x4f56d0[_0x4ac74c('0x23')]=_[_0x4ac74c('0x1f')](_0x1fd637['model'],qs[_0x4ac74c('0x12')](_0x39ab35[_0x4ac74c('0x11')][_0x4ac74c('0x12')])),_0x4f56d0[_0x4ac74c('0x23')]=_0x4f56d0['attributes']['length']?_0x4f56d0[_0x4ac74c('0x23')]:_0x1fd637[_0x4ac74c('0xb')],_0x39ab35[_0x4ac74c('0x11')][_0x4ac74c('0x6')]&&(_0x4f56d0[_0x4ac74c('0x21')]=[{'all':!![]}]),_0x4f56d0=_[_0x4ac74c('0x7')]({},_0x4f56d0,_0x39ab35[_0x4ac74c('0x2f')]),db[_0x4ac74c('0x2d')]['findOne'](_0x4f56d0)['then'](handleEntityNotFound(_0x57bd29,null))[_0x4ac74c('0x20')](respondWithResult(_0x57bd29,null))[_0x4ac74c('0x14')](handleError(_0x57bd29,null));},exports['create']=function(_0x415e45,_0x52e4ec){const _0x1db50a=_0xd40b0;return db['SmsTransferReport'][_0x1db50a('0xa')](_0x415e45[_0x1db50a('0x26')],{})[_0x1db50a('0x20')](respondWithResult(_0x52e4ec,0xc9))[_0x1db50a('0x14')](handleError(_0x52e4ec,null));},exports[_0xd40b0('0x31')]=function(_0x4ed0b6,_0x514af3){const _0x106a63=_0xd40b0;return _0x4ed0b6['body']['id']&&delete _0x4ed0b6[_0x106a63('0x26')]['id'],db[_0x106a63('0x2d')][_0x106a63('0x2c')]({'where':{'id':_0x4ed0b6[_0x106a63('0x2')]['id']}})[_0x106a63('0x20')](handleEntityNotFound(_0x514af3,null))['then'](saveUpdates(_0x4ed0b6[_0x106a63('0x26')],null))['then'](respondWithResult(_0x514af3,null))[_0x106a63('0x14')](handleError(_0x514af3,null));},exports[_0xd40b0('0x24')]=function(_0xaf0abc,_0x2ab14b){const _0x82903d=_0xd40b0;return db[_0x82903d('0x2d')][_0x82903d('0x2c')]({'where':{'id':_0xaf0abc[_0x82903d('0x2')]['id']}})[_0x82903d('0x20')](handleEntityNotFound(_0x2ab14b,null))[_0x82903d('0x20')](removeEntity(_0x2ab14b,null))[_0x82903d('0x14')](handleError(_0x2ab14b,null));},exports[_0xd40b0('0xf')]=function(_0x724520,_0xf563ba){const _0x255daf=_0xd40b0;return db['SmsTransferReport'][_0x255daf('0xf')]()['then'](respondWithResult(_0xf563ba,null))['catch'](handleError(_0xf563ba,null));};
\ No newline at end of file