Built motion from commit 27e0a5d.|1.0.8
[motion.git] / server / api / sms_queue / sms_queue.controller.js
index 10c6bb1..b88887b 100644 (file)
@@ -1 +1 @@
-var _0x8260=["\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","\x53\x6D\x73\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\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\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x67\x65\x6E\x74\x73","\x62\x6F\x64\x79","\x70\x65\x6E\x61\x6C\x74\x79","\x61\x64\x64\x55\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72\x73","\x53\x6D\x73\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x65\x72\x72","\x65\x72\x72\x6F\x72","\x71\x75\x65\x75\x65","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x8260[0];var _=require(_0x8260[1]);var Util=require(_0x8260[2]);var SmsQueue=require(_0x8260[4])[_0x8260[3]];var User=require(_0x8260[4])[_0x8260[5]];var sequelize=require(_0x8260[4])[_0x8260[6]];var UserHasSmsQueue=require(_0x8260[4])[_0x8260[7]];function handleError(_0x1a20x8,_0x1a20x9){return _0x1a20x8[_0x8260[9]](500)[_0x8260[8]](_0x1a20x9)}exports[_0x8260[10]]= function(_0x1a20xa,_0x1a20x8){switch(_0x1a20xa[_0x8260[16]][_0x8260[22]]){case _0x8260[16]:return User[_0x8260[17]](_0x1a20xa[_0x8260[16]][_0x8260[15]],{attributes:[_0x8260[15]]})[_0x8260[12]](Util[_0x8260[14]](_0x1a20xa[_0x8260[13]]))[_0x8260[12]](function(_0x1a20xb){_0x1a20x8[_0x8260[9]](200)[_0x8260[8]](_0x1a20xb)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)});default:return SmsQueue[_0x8260[21]](_0x8260[20])[_0x8260[19]](Util[_0x8260[18]](_0x1a20xa[_0x8260[13]]))[_0x8260[12]](function(_0x1a20xb){_0x1a20x8[_0x8260[9]](200)[_0x8260[8]](_0x1a20xb)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})}};exports[_0x8260[23]]= function(_0x1a20xa,_0x1a20x8){return SmsQueue[_0x8260[21]](_0x8260[20])[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xc){if(!_0x1a20xc){return _0x1a20x8[_0x8260[24]](404)};return _0x1a20x8[_0x8260[8]](_0x1a20xc)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[26]]= function(_0x1a20xa,_0x1a20x8){return SmsQueue[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xe){if(!_0x1a20xe){return _0x1a20x8[_0x8260[24]](404)};return _0x1a20xe[_0x8260[32]]({where:{role:_0x8260[28]},attributes:[_0x8260[15],_0x8260[29],_0x8260[30],_0x8260[31]]})})[_0x8260[12]](function(_0x1a20xd){return _0x1a20x8[_0x8260[9]](200)[_0x8260[8]]({rows:_0x1a20xd,count:_0x1a20xd[_0x8260[27]]})})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[33]]= function(_0x1a20xa,_0x1a20x8){var _0x1a20xf;return SmsQueue[_0x8260[33]](_0x1a20xa[_0x8260[37]])[_0x8260[12]](function(_0x1a20xc){_0x1a20xf= _0x1a20xc;if(_0x1a20xa[_0x8260[37]][_0x8260[36]]){return _0x1a20xf[_0x8260[39]](_0x1a20xa[_0x8260[37]][_0x8260[36]],{penalty:_0x1a20xa[_0x8260[37]][_0x8260[38]]|| 0,queue:_0x1a20xf[_0x8260[29]]})}})[_0x8260[12]](function(){return _0x1a20x8[_0x8260[9]](201)[_0x8260[8]](_0x1a20xf)})[_0x8260[11]](sequelize.UniqueConstraintError,function(_0x1a20x9){return Util[_0x8260[35]][_0x8260[34]](_0x1a20x8,_0x1a20x9)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[40]]= function(_0x1a20xa,_0x1a20x8){if(_0x1a20xa[_0x8260[37]][_0x8260[15]]){delete _0x1a20xa[_0x8260[37]][_0x8260[15]]};return SmsQueue[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xc){if(!_0x1a20xc){return _0x1a20x8[_0x8260[24]](404)};var _0x1a20x10=_[_0x8260[41]](_0x1a20xc,_0x1a20xa[_0x8260[37]]);return _0x1a20x10[_0x8260[42]]()})[_0x8260[12]](function(_0x1a20xc){return _0x1a20x8[_0x8260[9]](200)[_0x8260[8]](_0x1a20xc)})[_0x8260[11]](sequelize.UniqueConstraintError,function(_0x1a20x9){return Util[_0x8260[35]][_0x8260[34]](_0x1a20x8,_0x1a20x9)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[43]]= function(_0x1a20xa,_0x1a20x8,_0x1a20x11){return SmsQueue[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xc){if(!_0x1a20xc){return _0x1a20x8[_0x8260[24]](404)};var _0x1a20x12=_[_0x8260[44]](_0x1a20xa[_0x8260[37]][_0x8260[36]],function(_0x1a20x13){return {UserId:_0x1a20x13,penalty:_0x1a20xa[_0x8260[37]][_0x8260[38]],SmsQueueId:_0x1a20xc[_0x8260[15]],queue:_0x1a20xc[_0x8260[29]]}});return UserHasSmsQueue[_0x8260[45]](_0x1a20x12,{individualHooks:true})})[_0x8260[12]](function(){return _0x1a20x8[_0x8260[24]](200)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[46]]= function(_0x1a20xa,_0x1a20x8){return SmsQueue[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xc){if(_0x1a20xc){return _0x1a20xc[_0x8260[47]](_0x1a20xa[_0x8260[13]][_0x8260[36]],{individualHooks:true})}else {throw  new Error(_0x8260[48])}})[_0x8260[12]](function(){return _0x1a20x8[_0x8260[24]](202)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[49]]= function(_0x1a20xa,_0x1a20x8){var _0x1a20xf;return SmsQueue[_0x8260[17]](_0x1a20xa[_0x8260[25]][_0x8260[15]])[_0x8260[12]](function(_0x1a20xc){_0x1a20xf= _0x1a20xc;if(!_0x1a20xc){return _0x1a20x8[_0x8260[24]](404)};return _0x1a20xc[_0x8260[49]]()})[_0x8260[12]](function(){return _0x1a20x8[_0x8260[24]](204)})[_0x8260[11]](sequelize.ForeignKeyConstraintError,function(_0x1a20x9){return Util[_0x8260[35]][_0x8260[53]](_0x1a20x8,_0x8260[52],_0x1a20xf[_0x8260[29]],_0x1a20x9)})[_0x8260[11]](function(_0x1a20x9){console[_0x8260[51]](_0x8260[50],_0x1a20x9);return handleError(_0x1a20x8,_0x1a20x9)})};exports[_0x8260[54]]= function(_0x1a20xa,_0x1a20x8){return SmsQueue[_0x8260[49]]({where:{id:_0x1a20xa[_0x8260[13]][_0x8260[55]]},individualHooks:true})[_0x8260[12]](function(){return _0x1a20x8[_0x8260[24]](204)})[_0x8260[11]](function(_0x1a20x9){return handleError(_0x1a20x8,_0x1a20x9)})}
\ No newline at end of file
+var _0xd62a=["\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","\x53\x6D\x73\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x55\x73\x65\x72\x48\x61\x73\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\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\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x67\x65\x6E\x74\x73","\x62\x6F\x64\x79","\x70\x65\x6E\x61\x6C\x74\x79","\x61\x64\x64\x55\x73\x65\x72\x73","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72\x73","\x53\x6D\x73\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x65\x72\x72","\x65\x72\x72\x6F\x72","\x71\x75\x65\x75\x65","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xd62a[0];var _=require(_0xd62a[1]);var Util=require(_0xd62a[2]);var SmsQueue=require(_0xd62a[4])[_0xd62a[3]];var User=require(_0xd62a[4])[_0xd62a[5]];var sequelize=require(_0xd62a[4])[_0xd62a[6]];var UserHasSmsQueue=require(_0xd62a[4])[_0xd62a[7]];function handleError(_0xd5a1x8,_0xd5a1x9){return _0xd5a1x8[_0xd62a[9]](500)[_0xd62a[8]](_0xd5a1x9)}exports[_0xd62a[10]]= function(_0xd5a1xa,_0xd5a1x8){switch(_0xd5a1xa[_0xd62a[16]][_0xd62a[22]]){case _0xd62a[16]:return User[_0xd62a[17]](_0xd5a1xa[_0xd62a[16]][_0xd62a[15]],{attributes:[_0xd62a[15]]})[_0xd62a[12]](Util[_0xd62a[14]](_0xd5a1xa[_0xd62a[13]]))[_0xd62a[12]](function(_0xd5a1xb){_0xd5a1x8[_0xd62a[9]](200)[_0xd62a[8]](_0xd5a1xb)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)});default:return SmsQueue[_0xd62a[21]](_0xd62a[20])[_0xd62a[19]](Util[_0xd62a[18]](_0xd5a1xa[_0xd62a[13]]))[_0xd62a[12]](function(_0xd5a1xb){_0xd5a1x8[_0xd62a[9]](200)[_0xd62a[8]](_0xd5a1xb)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})}};exports[_0xd62a[23]]= function(_0xd5a1xa,_0xd5a1x8){return SmsQueue[_0xd62a[21]](_0xd62a[20])[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xc){if(!_0xd5a1xc){return _0xd5a1x8[_0xd62a[24]](404)};return _0xd5a1x8[_0xd62a[8]](_0xd5a1xc)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[26]]= function(_0xd5a1xa,_0xd5a1x8){return SmsQueue[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xe){if(!_0xd5a1xe){return _0xd5a1x8[_0xd62a[24]](404)};return _0xd5a1xe[_0xd62a[32]]({where:{role:_0xd62a[28]},attributes:[_0xd62a[15],_0xd62a[29],_0xd62a[30],_0xd62a[31]]})})[_0xd62a[12]](function(_0xd5a1xd){return _0xd5a1x8[_0xd62a[9]](200)[_0xd62a[8]]({rows:_0xd5a1xd,count:_0xd5a1xd[_0xd62a[27]]})})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[33]]= function(_0xd5a1xa,_0xd5a1x8){var _0xd5a1xf;return SmsQueue[_0xd62a[33]](_0xd5a1xa[_0xd62a[37]])[_0xd62a[12]](function(_0xd5a1xc){_0xd5a1xf= _0xd5a1xc;if(_0xd5a1xa[_0xd62a[37]][_0xd62a[36]]){return _0xd5a1xf[_0xd62a[39]](_0xd5a1xa[_0xd62a[37]][_0xd62a[36]],{penalty:_0xd5a1xa[_0xd62a[37]][_0xd62a[38]]|| 0,queue:_0xd5a1xf[_0xd62a[29]]})}})[_0xd62a[12]](function(){return _0xd5a1x8[_0xd62a[9]](201)[_0xd62a[8]](_0xd5a1xf)})[_0xd62a[11]](sequelize.UniqueConstraintError,function(_0xd5a1x9){return Util[_0xd62a[35]][_0xd62a[34]](_0xd5a1x8,_0xd5a1x9)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[40]]= function(_0xd5a1xa,_0xd5a1x8){if(_0xd5a1xa[_0xd62a[37]][_0xd62a[15]]){delete _0xd5a1xa[_0xd62a[37]][_0xd62a[15]]};return SmsQueue[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xc){if(!_0xd5a1xc){return _0xd5a1x8[_0xd62a[24]](404)};var _0xd5a1x10=_[_0xd62a[41]](_0xd5a1xc,_0xd5a1xa[_0xd62a[37]]);return _0xd5a1x10[_0xd62a[42]]()})[_0xd62a[12]](function(_0xd5a1xc){return _0xd5a1x8[_0xd62a[9]](200)[_0xd62a[8]](_0xd5a1xc)})[_0xd62a[11]](sequelize.UniqueConstraintError,function(_0xd5a1x9){return Util[_0xd62a[35]][_0xd62a[34]](_0xd5a1x8,_0xd5a1x9)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[43]]= function(_0xd5a1xa,_0xd5a1x8,_0xd5a1x11){return SmsQueue[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xc){if(!_0xd5a1xc){return _0xd5a1x8[_0xd62a[24]](404)};var _0xd5a1x12=_[_0xd62a[44]](_0xd5a1xa[_0xd62a[37]][_0xd62a[36]],function(_0xd5a1x13){return {UserId:_0xd5a1x13,penalty:_0xd5a1xa[_0xd62a[37]][_0xd62a[38]],SmsQueueId:_0xd5a1xc[_0xd62a[15]],queue:_0xd5a1xc[_0xd62a[29]]}});return UserHasSmsQueue[_0xd62a[45]](_0xd5a1x12,{individualHooks:true})})[_0xd62a[12]](function(){return _0xd5a1x8[_0xd62a[24]](200)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[46]]= function(_0xd5a1xa,_0xd5a1x8){return SmsQueue[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xc){if(_0xd5a1xc){return _0xd5a1xc[_0xd62a[47]](_0xd5a1xa[_0xd62a[13]][_0xd62a[36]],{individualHooks:true})}else {throw  new Error(_0xd62a[48])}})[_0xd62a[12]](function(){return _0xd5a1x8[_0xd62a[24]](202)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[49]]= function(_0xd5a1xa,_0xd5a1x8){var _0xd5a1xf;return SmsQueue[_0xd62a[17]](_0xd5a1xa[_0xd62a[25]][_0xd62a[15]])[_0xd62a[12]](function(_0xd5a1xc){_0xd5a1xf= _0xd5a1xc;if(!_0xd5a1xc){return _0xd5a1x8[_0xd62a[24]](404)};return _0xd5a1xc[_0xd62a[49]]()})[_0xd62a[12]](function(){return _0xd5a1x8[_0xd62a[24]](204)})[_0xd62a[11]](sequelize.ForeignKeyConstraintError,function(_0xd5a1x9){return Util[_0xd62a[35]][_0xd62a[53]](_0xd5a1x8,_0xd62a[52],_0xd5a1xf[_0xd62a[29]],_0xd5a1x9)})[_0xd62a[11]](function(_0xd5a1x9){console[_0xd62a[51]](_0xd62a[50],_0xd5a1x9);return handleError(_0xd5a1x8,_0xd5a1x9)})};exports[_0xd62a[54]]= function(_0xd5a1xa,_0xd5a1x8){return SmsQueue[_0xd62a[49]]({where:{id:_0xd5a1xa[_0xd62a[13]][_0xd62a[55]]},individualHooks:true})[_0xd62a[12]](function(){return _0xd5a1x8[_0xd62a[24]](204)})[_0xd62a[11]](function(_0xd5a1x9){return handleError(_0xd5a1x8,_0xd5a1x9)})}
\ No newline at end of file