Built motion from commit ecdc8e66766c75b1b08288b0ea13eb12d42606b4. Version 3.0.0...
[motion-next.git] / server / api / jscriptyQuestionReport / jscriptyQuestionReport.controller.js
index 7aa80e0..c3e76a2 100644 (file)
@@ -1 +1 @@
-const a382_0x1c50=['json','update','filters','create','undefined','includeAll','index','destroy','nolimit','../../components/parsers/qs','options','status','limit','keys','VIRTUAL','intersection','send','describe','model','fieldName','count','api','../../config/logger','end','set','catch','fields','order','query','JscriptyQuestionReport','params','error','key','offset','pick','merge','name','sort','../../mysqldb','rawAttributes','map','findOne','filter','then','body','where','length','like','show','type','attributes'];(function(_0x1ffed5,_0x1c508c){const _0x32641f=function(_0x168828){while(--_0x168828){_0x1ffed5['push'](_0x1ffed5['shift']());}};_0x32641f(++_0x1c508c);}(a382_0x1c50,0xe5));const a382_0x3264=function(_0x1ffed5,_0x1c508c){_0x1ffed5=_0x1ffed5-0x0;let _0x32641f=a382_0x1c50[_0x1ffed5];return _0x32641f;};const _0x3b5028=a382_0x3264;'use strict';const _=require('lodash'),qs=require(_0x3b5028('0x23')),logger=require(_0x3b5028('0x30'))(_0x3b5028('0x2f')),db=require(_0x3b5028('0xd'))['db'],{Op}=require('sequelize');function respondWithResult(_0x168828,_0x51fcb3){return _0x51fcb3=_0x51fcb3||0xc8,function(_0x30af6f){const _0x3c4d57=a382_0x3264;if(_0x30af6f)return _0x168828['status'](_0x51fcb3)[_0x3c4d57('0x1a')](_0x30af6f);};}function respondWithFilteredResult(_0x6b2764,_0x33fabf){return function(_0x2b4bff){const _0x5dce73=a382_0x3264;if(_0x2b4bff){const _0xc27a21=_0x2b4bff['count'],_0x3f47a7=_0x33fabf['offset'];let _0x5a7b8c=_0x33fabf[_0x5dce73('0x8')]+_0x33fabf['limit'],_0x12f269;return _0x5a7b8c>=_0xc27a21?(_0x5a7b8c=_0xc27a21,_0x12f269=0xc8):_0x12f269=0xce,_0x6b2764[_0x5dce73('0x25')](_0x12f269),_0x6b2764[_0x5dce73('0x32')]('Content-Range',_0x3f47a7+'-'+_0x5a7b8c+'/'+_0xc27a21)[_0x5dce73('0x1a')](_0x2b4bff);}return null;};}function saveUpdates(_0x43cd76){return function(_0xe273a1){if(_0xe273a1)return _0xe273a1['update'](_0x43cd76)['then'](function(_0x3ccca1){return _0x3ccca1;});return null;};}function removeEntity(_0x5b979c){return function(_0x526a94){const _0x2c302b=a382_0x3264;if(_0x526a94)return _0x526a94['destroy']()[_0x2c302b('0x12')](function(){const _0x52ab8b=_0x2c302b;_0x5b979c[_0x52ab8b('0x25')](0xcc)[_0x52ab8b('0x31')]();});};}function handleEntityNotFound(_0x1f5c44){return function(_0x3bb606){return!_0x3bb606&&_0x1f5c44['sendStatus'](0x194),_0x3bb606;};}function handleError(_0x255dcf,_0x2596bb){return _0x2596bb=_0x2596bb||0x1f4,function(_0x498d86){const _0x413d5a=a382_0x3264;logger[_0x413d5a('0x6')](_0x498d86['stack']),_0x498d86[_0x413d5a('0xb')]&&delete _0x498d86['name'],_0x255dcf['status'](_0x2596bb)[_0x413d5a('0x2a')](_0x498d86);};}exports[_0x3b5028('0x20')]=function(_0x55f90f,_0x484e8a){const _0x404662=_0x3b5028;let _0x412d93={};const _0x5d4608={},_0x173951={'count':0x0,'rows':[]},_0x4d4e34=_[_0x404662('0xf')](db[_0x404662('0x4')][_0x404662('0xe')],function(_0x2388b2){const _0x5573a2=_0x404662;return{'name':_0x2388b2[_0x5573a2('0x2d')],'type':_0x2388b2[_0x5573a2('0x18')][_0x5573a2('0x7')]};});_0x5d4608[_0x404662('0x2c')]=_[_0x404662('0xf')](_0x4d4e34,_0x404662('0xb')),_0x5d4608[_0x404662('0x3')]=_[_0x404662('0x27')](_0x55f90f[_0x404662('0x3')]),_0x5d4608['filters']=_[_0x404662('0x29')](_0x5d4608[_0x404662('0x2c')],_0x5d4608[_0x404662('0x3')]),_0x412d93[_0x404662('0x19')]=_[_0x404662('0x29')](_0x5d4608['model'],qs[_0x404662('0x1')](_0x55f90f[_0x404662('0x3')][_0x404662('0x1')])),_0x412d93[_0x404662('0x19')]=_0x412d93['attributes'][_0x404662('0x15')]?_0x412d93[_0x404662('0x19')]:_0x5d4608[_0x404662('0x2c')];typeof _0x55f90f['query'][_0x404662('0x22')]===_0x404662('0x1e')&&(_0x412d93[_0x404662('0x26')]=qs[_0x404662('0x26')](_0x55f90f[_0x404662('0x3')][_0x404662('0x26')]),_0x412d93[_0x404662('0x8')]=qs[_0x404662('0x8')](_0x55f90f['query']['offset']));_0x412d93[_0x404662('0x2')]=qs[_0x404662('0xc')](_0x55f90f['query'][_0x404662('0xc')]),_0x412d93[_0x404662('0x14')]=qs[_0x404662('0x1c')](_[_0x404662('0x9')](_0x55f90f[_0x404662('0x3')],_0x5d4608['filters']),_0x4d4e34);_0x55f90f[_0x404662('0x3')][_0x404662('0x11')]&&(_0x412d93[_0x404662('0x14')]=_[_0x404662('0xa')](_0x412d93['where'],{[Op['or']]:_[_0x404662('0xf')](_0x4d4e34,function(_0x74f8e7){const _0x2c4037=_0x404662;if(_0x74f8e7[_0x2c4037('0x18')]!==_0x2c4037('0x28')){const _0x402b8b={};return _0x402b8b[_0x74f8e7[_0x2c4037('0xb')]]={[Op[_0x2c4037('0x16')]]:'%'+_0x55f90f[_0x2c4037('0x3')]['filter']+'%'},_0x402b8b;}})}));_0x412d93=_[_0x404662('0xa')]({},_0x412d93,_0x55f90f[_0x404662('0x24')]);const _0x5d47b9={'where':_0x412d93['where']};return db[_0x404662('0x4')][_0x404662('0x2e')](_0x5d47b9)[_0x404662('0x12')](function(_0x531b7c){const _0x48bab9=_0x404662;return _0x173951[_0x48bab9('0x2e')]=_0x531b7c,_0x55f90f['query'][_0x48bab9('0x1f')]&&(_0x412d93['include']=[{'all':!![]}]),db[_0x48bab9('0x4')]['findAll'](_0x412d93);})['then'](function(_0x3047c5){return _0x173951['rows']=_0x3047c5,_0x173951;})[_0x404662('0x12')](respondWithFilteredResult(_0x484e8a,_0x412d93))[_0x404662('0x0')](handleError(_0x484e8a,null));},exports[_0x3b5028('0x17')]=function(_0x103243,_0xb894a0){const _0x23498b=_0x3b5028;let _0x3ca6e1={'raw':!![],'where':{'id':_0x103243['params']['id']}};const _0x1b998f={};return _0x1b998f[_0x23498b('0x2c')]=_[_0x23498b('0x27')](db[_0x23498b('0x4')][_0x23498b('0xe')]),_0x1b998f[_0x23498b('0x3')]=_['keys'](_0x103243[_0x23498b('0x3')]),_0x1b998f['filters']=_[_0x23498b('0x29')](_0x1b998f['model'],_0x1b998f[_0x23498b('0x3')]),_0x3ca6e1[_0x23498b('0x19')]=_[_0x23498b('0x29')](_0x1b998f[_0x23498b('0x2c')],qs['fields'](_0x103243[_0x23498b('0x3')][_0x23498b('0x1')])),_0x3ca6e1[_0x23498b('0x19')]=_0x3ca6e1['attributes'][_0x23498b('0x15')]?_0x3ca6e1[_0x23498b('0x19')]:_0x1b998f[_0x23498b('0x2c')],_0x103243['query'][_0x23498b('0x1f')]&&(_0x3ca6e1['include']=[{'all':!![]}]),_0x3ca6e1=_[_0x23498b('0xa')]({},_0x3ca6e1,_0x103243['options']),db[_0x23498b('0x4')][_0x23498b('0x10')](_0x3ca6e1)[_0x23498b('0x12')](handleEntityNotFound(_0xb894a0,null))[_0x23498b('0x12')](respondWithResult(_0xb894a0,null))[_0x23498b('0x0')](handleError(_0xb894a0,null));},exports[_0x3b5028('0x1d')]=function(_0x5f2d42,_0x409b96){const _0x276da7=_0x3b5028;return db[_0x276da7('0x4')][_0x276da7('0x1d')](_0x5f2d42[_0x276da7('0x13')],{})[_0x276da7('0x12')](respondWithResult(_0x409b96,0xc9))[_0x276da7('0x0')](handleError(_0x409b96,null));},exports[_0x3b5028('0x1b')]=function(_0x2cb1a0,_0x261500){const _0x25a0b6=_0x3b5028;return _0x2cb1a0['body']['id']&&delete _0x2cb1a0[_0x25a0b6('0x13')]['id'],db[_0x25a0b6('0x4')][_0x25a0b6('0x10')]({'where':{'id':_0x2cb1a0[_0x25a0b6('0x5')]['id']}})[_0x25a0b6('0x12')](handleEntityNotFound(_0x261500,null))[_0x25a0b6('0x12')](saveUpdates(_0x2cb1a0[_0x25a0b6('0x13')],null))[_0x25a0b6('0x12')](respondWithResult(_0x261500,null))['catch'](handleError(_0x261500,null));},exports[_0x3b5028('0x21')]=function(_0x597306,_0x2856ef){const _0x2a8beb=_0x3b5028;return db['JscriptyQuestionReport'][_0x2a8beb('0x10')]({'where':{'id':_0x597306[_0x2a8beb('0x5')]['id']}})[_0x2a8beb('0x12')](handleEntityNotFound(_0x2856ef,null))[_0x2a8beb('0x12')](removeEntity(_0x2856ef,null))[_0x2a8beb('0x0')](handleError(_0x2856ef,null));},exports[_0x3b5028('0x2b')]=function(_0x4d8716,_0x4ed88a){const _0x31c690=_0x3b5028;return db['JscriptyQuestionReport'][_0x31c690('0x2b')]()[_0x31c690('0x12')](respondWithResult(_0x4ed88a,null))['catch'](handleError(_0x4ed88a,null));};
\ No newline at end of file
+const a382_0x2d7f=['JscriptyQuestionReport','describe','body','name','order','include','like','error','length','model','end','sendStatus','api','create','limit','status','filter','merge','fields','update','offset','key','nolimit','rawAttributes','then','send','findOne','../../components/parsers/qs','map','pick','undefined','where','includeAll','query','sort','fieldName','intersection','rows','keys','json','params','catch','stack','options','attributes','filters','findAll','type','destroy','count'];(function(_0x461528,_0x2d7f0c){const _0xb51160=function(_0x23e30c){while(--_0x23e30c){_0x461528['push'](_0x461528['shift']());}};_0xb51160(++_0x2d7f0c);}(a382_0x2d7f,0x1e9));const a382_0xb511=function(_0x461528,_0x2d7f0c){_0x461528=_0x461528-0x0;let _0xb51160=a382_0x2d7f[_0x461528];return _0xb51160;};const _0x3a0fb8=a382_0xb511;'use strict';const _=require('lodash'),qs=require(_0x3a0fb8('0x26')),logger=require('../../config/logger')(_0x3a0fb8('0x17')),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x23e30c,_0x809798){return _0x809798=_0x809798||0xc8,function(_0x396441){const _0x5cc06e=a382_0xb511;if(_0x396441)return _0x23e30c[_0x5cc06e('0x1a')](_0x809798)[_0x5cc06e('0x0')](_0x396441);};}function respondWithFilteredResult(_0x32e989,_0x49cdd9){return function(_0x166a21){const _0x23dc96=a382_0xb511;if(_0x166a21){const _0x24f576=_0x166a21['count'],_0x2a6754=_0x49cdd9[_0x23dc96('0x1f')];let _0xc75a57=_0x49cdd9[_0x23dc96('0x1f')]+_0x49cdd9[_0x23dc96('0x19')],_0xa3984f;return _0xc75a57>=_0x24f576?(_0xc75a57=_0x24f576,_0xa3984f=0xc8):_0xa3984f=0xce,_0x32e989[_0x23dc96('0x1a')](_0xa3984f),_0x32e989['set']('Content-Range',_0x2a6754+'-'+_0xc75a57+'/'+_0x24f576)[_0x23dc96('0x0')](_0x166a21);}return null;};}function saveUpdates(_0x2b587e){return function(_0x303a65){const _0x3d2ea1=a382_0xb511;if(_0x303a65)return _0x303a65[_0x3d2ea1('0x1e')](_0x2b587e)[_0x3d2ea1('0x23')](function(_0x440885){return _0x440885;});return null;};}function removeEntity(_0x5f3fa6){return function(_0x47b210){const _0x134939=a382_0xb511;if(_0x47b210)return _0x47b210[_0x134939('0x9')]()[_0x134939('0x23')](function(){const _0x588a7f=_0x134939;_0x5f3fa6[_0x588a7f('0x1a')](0xcc)[_0x588a7f('0x15')]();});};}function handleEntityNotFound(_0x4960a3){return function(_0x47f7b8){const _0x1c64e6=a382_0xb511;return!_0x47f7b8&&_0x4960a3[_0x1c64e6('0x16')](0x194),_0x47f7b8;};}function handleError(_0xa75083,_0xe9c326){return _0xe9c326=_0xe9c326||0x1f4,function(_0xafebc6){const _0x23cb2a=a382_0xb511;logger[_0x23cb2a('0x12')](_0xafebc6[_0x23cb2a('0x3')]),_0xafebc6[_0x23cb2a('0xe')]&&delete _0xafebc6[_0x23cb2a('0xe')],_0xa75083[_0x23cb2a('0x1a')](_0xe9c326)[_0x23cb2a('0x24')](_0xafebc6);};}exports['index']=function(_0x59ee5c,_0x133857){const _0x28457a=_0x3a0fb8;let _0x33f583={};const _0x3871f3={},_0x6864a5={'count':0x0,'rows':[]},_0xa571db=_[_0x28457a('0x27')](db[_0x28457a('0xb')][_0x28457a('0x22')],function(_0x3fd00e){const _0x48b31d=_0x28457a;return{'name':_0x3fd00e[_0x48b31d('0x2e')],'type':_0x3fd00e['type'][_0x48b31d('0x20')]};});_0x3871f3[_0x28457a('0x14')]=_[_0x28457a('0x27')](_0xa571db,_0x28457a('0xe')),_0x3871f3['query']=_[_0x28457a('0x31')](_0x59ee5c[_0x28457a('0x2c')]),_0x3871f3[_0x28457a('0x6')]=_['intersection'](_0x3871f3[_0x28457a('0x14')],_0x3871f3[_0x28457a('0x2c')]),_0x33f583[_0x28457a('0x5')]=_['intersection'](_0x3871f3[_0x28457a('0x14')],qs[_0x28457a('0x1d')](_0x59ee5c['query'][_0x28457a('0x1d')])),_0x33f583[_0x28457a('0x5')]=_0x33f583[_0x28457a('0x5')][_0x28457a('0x13')]?_0x33f583[_0x28457a('0x5')]:_0x3871f3['model'];typeof _0x59ee5c['query'][_0x28457a('0x21')]===_0x28457a('0x29')&&(_0x33f583[_0x28457a('0x19')]=qs[_0x28457a('0x19')](_0x59ee5c[_0x28457a('0x2c')][_0x28457a('0x19')]),_0x33f583['offset']=qs[_0x28457a('0x1f')](_0x59ee5c[_0x28457a('0x2c')][_0x28457a('0x1f')]));_0x33f583[_0x28457a('0xf')]=qs[_0x28457a('0x2d')](_0x59ee5c['query'][_0x28457a('0x2d')]),_0x33f583['where']=qs['filters'](_[_0x28457a('0x28')](_0x59ee5c[_0x28457a('0x2c')],_0x3871f3['filters']),_0xa571db);_0x59ee5c[_0x28457a('0x2c')]['filter']&&(_0x33f583[_0x28457a('0x2a')]=_[_0x28457a('0x1c')](_0x33f583[_0x28457a('0x2a')],{[Op['or']]:_[_0x28457a('0x27')](_0xa571db,function(_0x2a2d1d){const _0xb94d87=_0x28457a;if(_0x2a2d1d[_0xb94d87('0x8')]!=='VIRTUAL'){const _0x2ea6be={};return _0x2ea6be[_0x2a2d1d[_0xb94d87('0xe')]]={[Op[_0xb94d87('0x11')]]:'%'+_0x59ee5c[_0xb94d87('0x2c')][_0xb94d87('0x1b')]+'%'},_0x2ea6be;}})}));_0x33f583=_[_0x28457a('0x1c')]({},_0x33f583,_0x59ee5c[_0x28457a('0x4')]);const _0x38e458={'where':_0x33f583[_0x28457a('0x2a')]};return db[_0x28457a('0xb')][_0x28457a('0xa')](_0x38e458)[_0x28457a('0x23')](function(_0x527e89){const _0x293b4d=_0x28457a;return _0x6864a5[_0x293b4d('0xa')]=_0x527e89,_0x59ee5c[_0x293b4d('0x2c')][_0x293b4d('0x2b')]&&(_0x33f583[_0x293b4d('0x10')]=[{'all':!![]}]),db[_0x293b4d('0xb')][_0x293b4d('0x7')](_0x33f583);})[_0x28457a('0x23')](function(_0x2f91df){const _0x59e869=_0x28457a;return _0x6864a5[_0x59e869('0x30')]=_0x2f91df,_0x6864a5;})[_0x28457a('0x23')](respondWithFilteredResult(_0x133857,_0x33f583))[_0x28457a('0x2')](handleError(_0x133857,null));},exports['show']=function(_0x5c55b8,_0x21f85a){const _0x14981e=_0x3a0fb8;let _0x27f5a1={'raw':!![],'where':{'id':_0x5c55b8[_0x14981e('0x1')]['id']}};const _0x2f4497={};return _0x2f4497['model']=_[_0x14981e('0x31')](db[_0x14981e('0xb')][_0x14981e('0x22')]),_0x2f4497[_0x14981e('0x2c')]=_['keys'](_0x5c55b8['query']),_0x2f4497[_0x14981e('0x6')]=_[_0x14981e('0x2f')](_0x2f4497[_0x14981e('0x14')],_0x2f4497['query']),_0x27f5a1[_0x14981e('0x5')]=_[_0x14981e('0x2f')](_0x2f4497[_0x14981e('0x14')],qs[_0x14981e('0x1d')](_0x5c55b8[_0x14981e('0x2c')][_0x14981e('0x1d')])),_0x27f5a1[_0x14981e('0x5')]=_0x27f5a1['attributes']['length']?_0x27f5a1[_0x14981e('0x5')]:_0x2f4497[_0x14981e('0x14')],_0x5c55b8['query']['includeAll']&&(_0x27f5a1[_0x14981e('0x10')]=[{'all':!![]}]),_0x27f5a1=_['merge']({},_0x27f5a1,_0x5c55b8['options']),db['JscriptyQuestionReport'][_0x14981e('0x25')](_0x27f5a1)[_0x14981e('0x23')](handleEntityNotFound(_0x21f85a,null))[_0x14981e('0x23')](respondWithResult(_0x21f85a,null))['catch'](handleError(_0x21f85a,null));},exports[_0x3a0fb8('0x18')]=function(_0x118684,_0x437834){const _0x232f37=_0x3a0fb8;return db[_0x232f37('0xb')]['create'](_0x118684[_0x232f37('0xd')],{})[_0x232f37('0x23')](respondWithResult(_0x437834,0xc9))[_0x232f37('0x2')](handleError(_0x437834,null));},exports['update']=function(_0x160642,_0x12a157){const _0x457de6=_0x3a0fb8;return _0x160642['body']['id']&&delete _0x160642[_0x457de6('0xd')]['id'],db[_0x457de6('0xb')][_0x457de6('0x25')]({'where':{'id':_0x160642[_0x457de6('0x1')]['id']}})[_0x457de6('0x23')](handleEntityNotFound(_0x12a157,null))['then'](saveUpdates(_0x160642[_0x457de6('0xd')],null))[_0x457de6('0x23')](respondWithResult(_0x12a157,null))[_0x457de6('0x2')](handleError(_0x12a157,null));},exports[_0x3a0fb8('0x9')]=function(_0x5e9b8f,_0x109582){const _0x337e2e=_0x3a0fb8;return db[_0x337e2e('0xb')][_0x337e2e('0x25')]({'where':{'id':_0x5e9b8f['params']['id']}})[_0x337e2e('0x23')](handleEntityNotFound(_0x109582,null))[_0x337e2e('0x23')](removeEntity(_0x109582,null))['catch'](handleError(_0x109582,null));},exports[_0x3a0fb8('0xc')]=function(_0x2a275f,_0x2e34b0){const _0x3fcb16=_0x3a0fb8;return db[_0x3fcb16('0xb')]['describe']()['then'](respondWithResult(_0x2e34b0,null))['catch'](handleError(_0x2e34b0,null));};
\ No newline at end of file