Built motion from commit 65070aa.|0.0.108
[motion.git] / server / api / report_sms_room / report_sms_room.controller.js
1 var _0xd4cd=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x52\x6F\x6F\x6D","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x55\x73\x65\x72","\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x6F\x70\x65\x6E","\x63\x61\x74\x63\x68","\x4F\x50\x45\x4E","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x6E\x65\x77","\x4E\x45\x57","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x69\x6E\x64\x65\x78","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65"];_0xd4cd[0];var _=require(_0xd4cd[1]);var Util=require(_0xd4cd[2]);var ReportSmsRoom=require(_0xd4cd[4])[_0xd4cd[3]];var SmsRoom=require(_0xd4cd[4])[_0xd4cd[5]];var ReportSmsRoomHistory=require(_0xd4cd[4])[_0xd4cd[7]][_0xd4cd[6]];var User=require(_0xd4cd[4])[_0xd4cd[8]];var SmsQueue=require(_0xd4cd[4])[_0xd4cd[9]];function handleError(_0xf534x9,_0xf534xa){_0xf534xa=_0xf534xa||500;return function(_0xf534xb){_0xf534x9[_0xd4cd[11]](_0xf534xa)[_0xd4cd[10]](_0xf534xb)}}function responseWithResult(_0xf534x9,_0xf534xa){_0xf534xa=_0xf534xa||200;return function(_0xf534xd){if(_0xf534xd){_0xf534x9[_0xd4cd[11]](_0xf534xa)[_0xd4cd[12]](_0xf534xd)}}}function responseWithoutResult(_0xf534x9,_0xf534xa){_0xf534xa=_0xf534xa||204;return function(){_0xf534x9[_0xd4cd[13]](_0xf534xa)}}function handleEntityNotFound(_0xf534x9){return function(_0xf534xd){if(!_0xf534xd){_0xf534x9[_0xd4cd[11]](404)[_0xd4cd[14]]();return null};return _0xf534xd}}function saveUpdates(_0xf534x11){return function(_0xf534xd){return _0xf534xd[_0xd4cd[16]](_0xf534x11)[_0xd4cd[15]](function(_0xf534x12){return _0xf534x12})}}function removeEntity(_0xf534x9){return function(_0xf534xd){if(_0xf534xd){return _0xf534xd[_0xd4cd[17]]()[_0xd4cd[15]](function(){_0xf534x9[_0xd4cd[11]](204)[_0xd4cd[14]]()})}}}function getSmsQueues(_0xf534x15){return function(){switch(_0xf534x15[_0xd4cd[26]]){case _0xd4cd[25]:return User[_0xd4cd[24]](_0xf534x15[_0xd4cd[18]],{attributes:[_0xd4cd[18]]})[_0xd4cd[15]](Util[_0xd4cd[23]]({},{attributes:[_0xd4cd[18]],include:[{raw:true,model:User,attributes:[_0xd4cd[18]]}]}))[_0xd4cd[15]](function(_0xf534x16){var _0xf534x17=[];_0xf534x16[_0xd4cd[22]][_0xd4cd[21]](function(_0xf534x18){_0xf534x17=_[_0xd4cd[20]](_0xf534x17,_[_0xd4cd[19]](_0xf534x18.Users,_0xd4cd[18]))});return {where:{$or:{queue:_[_0xd4cd[19]](_0xf534x16[_0xd4cd[22]],_0xd4cd[18]),memberid:_0xf534x17}}}});default:return {}}}}exports[_0xd4cd[27]]=function(_0xf534x19,_0xf534x9){return Promise[_0xd4cd[32]]([])[_0xd4cd[15]](getSmsQueues(_0xf534x19[_0xd4cd[25]]))[_0xd4cd[15]](function(_0xf534x1b){return SmsRoom[_0xd4cd[31]](_[_0xd4cd[30]]({where:{status:_0xd4cd[29]}},_0xf534x1b))})[_0xd4cd[15]](function(_0xf534x1a){return _0xf534x9[_0xd4cd[11]](200)[_0xd4cd[10]]({value:_0xf534x1a})})[_0xd4cd[28]](handleError(_0xf534x9))};exports[_0xd4cd[33]]=function(_0xf534x19,_0xf534x9){return Promise[_0xd4cd[32]]([])[_0xd4cd[15]](getSmsQueues(_0xf534x19[_0xd4cd[25]]))[_0xd4cd[15]](function(_0xf534x1b){return SmsRoom[_0xd4cd[31]](_[_0xd4cd[30]]({where:{status:_0xd4cd[34]}},_0xf534x1b))})[_0xd4cd[15]](function(_0xf534x1a){return _0xf534x9[_0xd4cd[11]](200)[_0xd4cd[10]]({value:_0xf534x1a})})[_0xd4cd[28]](handleError(_0xf534x9))};exports[_0xd4cd[35]]=function(_0xf534x19,_0xf534x9){return Promise[_0xd4cd[32]]([])[_0xd4cd[15]](getSmsQueues(_0xf534x19[_0xd4cd[25]]))[_0xd4cd[15]](function(_0xf534x1b){return SmsRoom[_0xd4cd[31]](_[_0xd4cd[30]]({where:{status:_0xd4cd[36]}},_0xf534x1b))})[_0xd4cd[15]](function(_0xf534x1a){return _0xf534x9[_0xd4cd[11]](200)[_0xd4cd[10]]({value:_0xf534x1a})})[_0xd4cd[28]](handleError(_0xf534x9))};exports[_0xd4cd[37]]=function(_0xf534x19,_0xf534x9){return Promise[_0xd4cd[32]]([])[_0xd4cd[15]](getSmsQueues(_0xf534x19[_0xd4cd[25]]))[_0xd4cd[15]](function(_0xf534x1b){return SmsRoom[_0xd4cd[31]](_[_0xd4cd[30]]({where:{status:_0xd4cd[38]}},_0xf534x1b))})[_0xd4cd[15]](function(_0xf534x1a){return _0xf534x9[_0xd4cd[11]](200)[_0xd4cd[10]]({value:_0xf534x1a})})[_0xd4cd[28]](handleError(_0xf534x9))};exports[_0xd4cd[39]]=function(_0xf534x19,_0xf534x9,_0xf534x1c){return ReportSmsRoom[_0xd4cd[42]](Util[_0xd4cd[41]](_0xf534x19[_0xd4cd[40]]))[_0xd4cd[15]](function(_0xf534x1d){return _0xf534x9[_0xd4cd[11]](200)[_0xd4cd[10]](_0xf534x1d)})[_0xd4cd[28]](handleError(_0xf534x9))};exports[_0xd4cd[43]]=function(_0xf534x19,_0xf534x9){return ReportSmsRoomHistory[_0xd4cd[43]]()[_0xd4cd[15]](responseWithResult(_0xf534x9))[_0xd4cd[28]](handleError(_0xf534x9))}