Built motion from commit 57474b6.|0.0.99
[motion.git] / server / api / interval / interval.controller.js
index 656f673..9e51c82 100644 (file)
@@ -1 +1 @@
-var _0x3e15=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x69\x6E\x64\x65\x78","\x6E\x61\x6D\x65","\x70\x65\x72\x5F\x70\x61\x67\x65","\x71\x75\x65\x72\x79","\x70\x61\x67\x65","\x6F\x72\x64\x65\x72","\x25\x73\x20\x25\x73","\x73\x6F\x72\x74\x5F\x62\x79","\x73\x6F\x72\x74\x5F\x6F\x72\x64\x65\x72","\x41\x53\x43","\x66\x6F\x72\x6D\x61\x74","\x24\x6F\x72","\x77\x68\x65\x72\x65","\x25","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x24","\x24\x6C\x69\x6B\x65","\x66\x6F\x72\x49\x6E","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x67\x65\x74\x41\x6C\x6C","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x69\x6E\x74\x65\x72\x76\x61\x6C\x56\x61\x6C\x69\x64\x61\x74\x69\x6F\x6E","\x62\x6F\x64\x79","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x6C\x6F\x67","\x63\x72\x65\x61\x74\x65","\x46\x69\x6E\x64\x69\x6E\x67\x20\x61\x70\x70\x20\x72\x6F\x77\x2E\x2E\x2E\x2E\x2E","\x6C\x65\x6E\x67\x74\x68","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x53\x55\x42\x49\x4E\x54\x45\x52\x56\x41\x4C","\x4D\x45\x53\x53\x41\x47\x45\x5F\x45\x58\x49\x53\x54\x5F\x49\x4E\x54\x45\x52\x56\x41\x4C","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x66\x69\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x4D\x45\x53\x53\x41\x47\x45\x5F\x49\x4E\x54\x45\x52\x56\x41\x4C\x5F\x52\x4F\x55\x54\x45\x5F\x41\x53\x53\x4F\x43\x49\x41\x54\x45\x44","\x67\x65\x74\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E\x73"];_0x3e15[0];var _=require(_0x3e15[1]);var Interval=require(_0x3e15[3])[_0x3e15[2]];var VoiceExtension=require(_0x3e15[3])[_0x3e15[4]];var sequelize=require(_0x3e15[3])[_0x3e15[5]];var util=require(_0x3e15[6]);exports[_0x3e15[7]]=function(_0xa367x6,_0xa367x7){var _0xa367x8=[_0x3e15[8]];var _0xa367x9=_0xa367x6[_0x3e15[10]][_0x3e15[9]]?parseInt(_0xa367x6[_0x3e15[10]][_0x3e15[9]],10):100;var _0xa367xa=_0xa367x6[_0x3e15[10]][_0x3e15[11]]?parseInt(_0xa367x6[_0x3e15[10]][_0x3e15[11]],10):0;var _0xa367xb={where:{IntervalId:null},limit:_0xa367x9,offset:_0xa367xa*_0xa367x9};_[_0x3e15[25]](_0xa367x6[_0x3e15[10]],function(_0xa367xc,_0xa367xd){switch(_0xa367xd){case _0x3e15[9]:;case _0x3e15[11]:break ;;case _0x3e15[14]:_0xa367xb[_0x3e15[12]]=util[_0x3e15[17]](_0x3e15[13],_0xa367x6[_0x3e15[10]][_0x3e15[14]],_0xa367x6[_0x3e15[10]][_0x3e15[15]]||_0x3e15[16])||null;break ;;case _0x3e15[15]:break ;;case _0x3e15[23]:_0xa367xb[_0x3e15[19]][_0x3e15[18]]=[];_0xa367x8[_0x3e15[22]](function(_0xa367xe){var _0xa367xf={};_0xa367xf[_0xa367xe]={$like:_0x3e15[20]+_0xa367xc+_0x3e15[20]};_0xa367xb[_0x3e15[19]][_0x3e15[18]][_0x3e15[21]](_0xa367xf);});break ;;default:_0xa367xb[_0x3e15[19]][_0xa367xd]={$like:{}};_0xa367xb[_0x3e15[19]][_0xa367xd][_0x3e15[24]]=_0x3e15[20]+_0xa367xc+_0x3e15[20];;}});Interval[_0x3e15[30]](_0xa367xb)[_0x3e15[29]](function(_0xa367x11){return _0xa367x7[_0x3e15[28]](200)[_0x3e15[27]](_0xa367x11)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});};exports[_0x3e15[31]]=function(_0xa367x6,_0xa367x7){Interval[_0x3e15[32]]()[_0x3e15[29]](function(_0xa367x11){return _0xa367x7[_0x3e15[28]](200)[_0x3e15[27]](_0xa367x11)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)})};exports[_0x3e15[33]]=function(_0xa367x6,_0xa367x7){Interval[_0x3e15[37]](_0xa367x6[_0x3e15[36]][_0x3e15[35]],{include:[{all:true}]})[_0x3e15[29]](function(_0xa367x12){if(!_0xa367x12){return _0xa367x7[_0x3e15[34]](404)};return _0xa367x7[_0x3e15[27]](_0xa367x12);})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)})};exports[_0x3e15[38]]=function(_0xa367x6,_0xa367x7){var _0xa367x13={name:_0xa367x6[_0x3e15[39]][_0x3e15[8]],IntervalId:_0xa367x6[_0x3e15[39]][_0x3e15[40]]?_0xa367x6[_0x3e15[39]][_0x3e15[40]]:null};if(_0xa367x6[_0x3e15[39]][_0x3e15[35]]){_0xa367x13[_0x3e15[35]]={$ne:_0xa367x6[_0x3e15[39]][_0x3e15[35]]}};console[_0x3e15[41]](_0xa367x6[_0x3e15[39]]);Interval[_0x3e15[32]]({where:_0xa367x13})[_0x3e15[29]](function(_0xa367x11){if(!_0xa367x11){return _0xa367x7[_0x3e15[34]](404)};return _0xa367x7[_0x3e15[27]](_0xa367x11);})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});};exports[_0x3e15[42]]=function(_0xa367x6,_0xa367x7){Interval[_0x3e15[32]]({where:{name:_0xa367x6[_0x3e15[39]][_0x3e15[8]],IntervalId:_0xa367x6[_0x3e15[39]][_0x3e15[40]]?_0xa367x6[_0x3e15[39]][_0x3e15[40]]:null}})[_0x3e15[29]](function(_0xa367x14){console[_0x3e15[41]](_0xa367x14);console[_0x3e15[41]](_0x3e15[43]);if(!_0xa367x14){return _0xa367x7[_0x3e15[34]](404)};if(_0xa367x14[_0x3e15[44]]>0){return _0xa367x7[_0x3e15[28]](500)[_0x3e15[27]]({message:_0xa367x6[_0x3e15[39]][_0x3e15[40]]?_0x3e15[45]:_0x3e15[46]})};Interval[_0x3e15[42]](_0xa367x6[_0x3e15[39]])[_0x3e15[29]](function(_0xa367x12){return _0xa367x7[_0x3e15[28]](201)[_0x3e15[27]](_0xa367x12)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)})};exports[_0x3e15[47]]=function(_0xa367x6,_0xa367x7){Interval[_0x3e15[32]]({where:{name:_0xa367x6[_0x3e15[39]][_0x3e15[8]],IntervalId:_0xa367x6[_0x3e15[39]][_0x3e15[40]]?_0xa367x6[_0x3e15[39]][_0x3e15[40]]:null,id:{$ne:_0xa367x6[_0x3e15[39]][_0x3e15[35]]}}})[_0x3e15[29]](function(_0xa367x14){console[_0x3e15[41]](_0xa367x14);console[_0x3e15[41]](_0x3e15[43]);if(!_0xa367x14){return _0xa367x7[_0x3e15[34]](404)};if(_0xa367x14[_0x3e15[44]]>0){return _0xa367x7[_0x3e15[28]](500)[_0x3e15[27]]({message:_0xa367x6[_0x3e15[39]][_0x3e15[40]]?_0x3e15[45]:_0x3e15[46]})};if(_0xa367x6[_0x3e15[39]][_0x3e15[35]]){delete _0xa367x6[_0x3e15[39]][_0x3e15[35]]};Interval[_0x3e15[51]]({where:{id:_0xa367x6[_0x3e15[36]][_0x3e15[35]]}})[_0x3e15[29]](function(_0xa367x12){if(!_0xa367x12){return _0xa367x7[_0x3e15[34]](404)};var _0xa367x15=_[_0x3e15[48]](_0xa367x12,_0xa367x6[_0x3e15[39]]);return sequelize[_0x3e15[50]](function(_0xa367x16){return _0xa367x15[_0x3e15[49]]({transaction:_0xa367x16})[_0x3e15[29]](function(_0xa367x12){VoiceExtension[_0x3e15[47]]({interval:_0xa367x12[_0x3e15[8]]},{where:{IntervalId:_0xa367x12[_0x3e15[35]]}},{transaction:_0xa367x16})})})[_0x3e15[29]](function(){return _0xa367x7[_0x3e15[28]](200)[_0x3e15[27]](_0xa367x12)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)})};exports[_0x3e15[52]]=function(_0xa367x6,_0xa367x7){Interval[_0x3e15[37]](_0xa367x6[_0x3e15[36]][_0x3e15[35]])[_0x3e15[29]](function(_0xa367x12){if(!_0xa367x12){return _0xa367x7[_0x3e15[34]](404)};_0xa367x12[_0x3e15[54]]({where:{isApp:true}})[_0x3e15[29]](function(_0xa367x17){console[_0x3e15[41]](_0xa367x17[_0x3e15[44]]);if(_0xa367x17[_0x3e15[44]]>0){return _0xa367x7[_0x3e15[28]](500)[_0x3e15[27]]({message:_0x3e15[53]})};_0xa367x12[_0x3e15[52]]()[_0x3e15[29]](function(){return _0xa367x7[_0x3e15[34]](204)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)})};exports[_0x3e15[55]]=function(_0xa367x6,_0xa367x7){var _0xa367x18=false;Interval[_0x3e15[32]]({where:{id:_0xa367x6[_0x3e15[10]][_0x3e15[35]]},include:[{all:true}]})[_0x3e15[29]](function(_0xa367x11){if(!_0xa367x11){return _0xa367x7[_0x3e15[34]](404)};_0xa367x11[_0x3e15[22]](function(_0xa367x19){if(_0xa367x19[_0x3e15[56]][_0x3e15[44]]>0){_0xa367x18=true}});if(_0xa367x18){return _0xa367x7[_0x3e15[28]](500)[_0x3e15[27]]({message:_0x3e15[53]})};Interval[_0x3e15[52]]({where:{id:_0xa367x6[_0x3e15[10]][_0x3e15[35]]},individualHooks:true})[_0x3e15[29]](function(){return _0xa367x7[_0x3e15[34]](204)})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});})[_0x3e15[26]](function(_0xa367x10){return handleError(_0xa367x7,_0xa367x10)});};function handleError(_0xa367x7,_0xa367x10){return _0xa367x7[_0x3e15[28]](500)[_0x3e15[27]](_0xa367x10)}
\ No newline at end of file
+var _0xb1f7=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x49\x6E\x74\x65\x72\x76\x61\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\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","\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x73\x75\x62\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x73\x63\x6F\x70\x65","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x63\x72\x65\x61\x74\x65","\x6C\x6F\x67","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x61\x6C\x6C","\x61\x72\x65\x20\x74\x68\x65\x72\x65\x20\x69\x6E\x74\x65\x72\x76\x61\x6C\x73","\x53\x75\x62\x49\x6E\x74\x65\x72\x76\x61\x6C\x73","\x6C\x65\x6E\x67\x74\x68","\x64\x65\x73\x74\x72\x6F\x79","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x79\x65\x73\x20\x74\x68\x65\x72\x65\x20\x61\x72\x65","\x49\x6E\x74\x65\x72\x76\x61\x6C\x49\x64","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x6D\x65\x73\x73\x61\x67\x65","\x54\x68\x65\x20\x49\x6E\x74\x65\x72\x76\x61\x6C\x20\x69\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x6F\x6E\x65\x20\x6F\x72\x20\x6D\x6F\x72\x65\x20\x72\x6F\x75\x74\x65\x73\x2C\x20\x64\x65\x6C\x65\x74\x65\x20\x74\x68\x65\x6D\x20\x66\x69\x72\x73\x74","\x74\x72\x61\x6E\x73\x6C\x61\x74\x65\x64\x4D\x65\x73\x73\x61\x67\x65","\x4D\x45\x53\x53\x41\x47\x45\x5F\x49\x4E\x54\x45\x52\x56\x41\x4C\x5F\x52\x4F\x55\x54\x45\x5F\x41\x53\x53\x4F\x43\x49\x41\x54\x45\x44","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xb1f7[0];var _=require(_0xb1f7[1]);var Interval=require(_0xb1f7[3])[_0xb1f7[2]];var VoiceExtension=require(_0xb1f7[3])[_0xb1f7[4]];var sequelize=require(_0xb1f7[3])[_0xb1f7[5]];var Util=require(_0xb1f7[6]);exports[_0xb1f7[7]]=function(_0x2893x6,_0x2893x7,_0x2893x8){return Interval[_0xb1f7[17]](_0xb1f7[15],_0xb1f7[16])[_0xb1f7[14]](Util[_0xb1f7[13]](_0x2893x6[_0xb1f7[12]]))[_0xb1f7[11]](function(_0x2893xa){_0x2893x7[_0xb1f7[10]](200)[_0xb1f7[9]](_0x2893xa)})[_0xb1f7[8]](function(_0x2893x9){return handleError(_0x2893x7,_0x2893x9)})};exports[_0xb1f7[18]]=function(_0x2893x6,_0x2893x7){return Interval[_0xb1f7[17]](_0xb1f7[16])[_0xb1f7[22]](_0x2893x6[_0xb1f7[21]][_0xb1f7[20]])[_0xb1f7[11]](function(_0x2893xb){if(!_0x2893xb){return _0x2893x7[_0xb1f7[19]](404)};return _0x2893x7[_0xb1f7[9]](_0x2893xb)})[_0xb1f7[8]](function(_0x2893x9){return handleError(_0x2893x7,_0x2893x9)})};exports[_0xb1f7[23]]=function(_0x2893x6,_0x2893x7){return Interval[_0xb1f7[17]](_0xb1f7[16])[_0xb1f7[23]](_0x2893x6[_0xb1f7[25]])[_0xb1f7[11]](function(_0x2893xb){return _0x2893x7[_0xb1f7[10]](201)[_0xb1f7[9]](_0x2893xb)})[_0xb1f7[8]](function(_0x2893x9){console[_0xb1f7[24]](_0x2893x9);return handleError(_0x2893x7,_0x2893x9)})};exports[_0xb1f7[26]]=function(_0x2893x6,_0x2893x7){return sequelize[_0xb1f7[32]](function(_0x2893xc){if(_0x2893x6[_0xb1f7[25]][_0xb1f7[20]]){delete _0x2893x6[_0xb1f7[25]][_0xb1f7[20]]};return Interval[_0xb1f7[26]](_0x2893x6[_0xb1f7[25]],{where:{id:_0x2893x6[_0xb1f7[21]][_0xb1f7[20]]},individualHooks:true,transaction:_0x2893xc})[_0xb1f7[11]](function(){if(_0x2893x6[_0xb1f7[25]][_0xb1f7[29]]){return Interval[_0xb1f7[31]]({where:{IntervalId:_0x2893x6[_0xb1f7[21]][_0xb1f7[20]]},transaction:_0x2893xc})}})[_0xb1f7[11]](function(){console[_0xb1f7[24]](_0xb1f7[28]);if(_0x2893x6[_0xb1f7[25]][_0xb1f7[29]]&&_0x2893x6[_0xb1f7[25]][_0xb1f7[29]][_0xb1f7[30]]){return _0x2893x6[_0xb1f7[21]][_0xb1f7[20]]}})[_0xb1f7[11]](bulkCreateSubIntervals(_0x2893x6[_0xb1f7[25]].SubIntervals,_0x2893xc))[_0xb1f7[27]]()})[_0xb1f7[11]](function(){return _0x2893x7[_0xb1f7[19]](200)})[_0xb1f7[8]](function(_0x2893x9){console[_0xb1f7[24]](_0x2893x9);return handleError(_0x2893x7,_0x2893x9)})};function bulkCreateSubIntervals(_0x2893xe,_0x2893xc){return function(_0x2893xf){if(_0x2893xf){console[_0xb1f7[24]](_0xb1f7[33]);var _0x2893x10=[];_0x2893xe[_0xb1f7[36]](function(_0x2893x11){delete _0x2893x11[_0xb1f7[20]];_0x2893x11[_0xb1f7[34]]=_0x2893xf;_0x2893x10[_0xb1f7[35]](Interval[_0xb1f7[23]](_0x2893x11,{transaction:_0x2893xc}))});return _0x2893x10}else {return []}}}exports[_0xb1f7[31]]=function(_0x2893x6,_0x2893x7){return sequelize[_0xb1f7[32]](function(_0x2893xc){return Interval[_0xb1f7[31]]({where:{id:_0x2893x6[_0xb1f7[21]][_0xb1f7[20]]},individualHooks:true,transaction:_0x2893xc})})[_0xb1f7[11]](function(){return _0x2893x7[_0xb1f7[19]](204)})[_0xb1f7[8]](sequelize.ForeignKeyConstraintError,function(_0x2893x9){_0x2893x9[_0xb1f7[37]]=_0xb1f7[38];_0x2893x9[_0xb1f7[39]]=_0xb1f7[40];return handleError(_0x2893x7,_0x2893x9)})[_0xb1f7[8]](function(_0x2893x9){return handleError(_0x2893x7,_0x2893x9)})};exports[_0xb1f7[41]]=function(_0x2893x6,_0x2893x7){return sequelize[_0xb1f7[32]](function(_0x2893xc){return Interval[_0xb1f7[31]]({where:{id:_0x2893x6[_0xb1f7[12]][_0xb1f7[42]]},individualHooks:true,transaction:_0x2893xc})})[_0xb1f7[11]](function(){return _0x2893x7[_0xb1f7[19]](204)})[_0xb1f7[8]](sequelize.ForeignKeyConstraintError,function(_0x2893x9){_0x2893x9[_0xb1f7[37]]=_0xb1f7[38];_0x2893x9[_0xb1f7[39]]=_0xb1f7[40];return handleError(_0x2893x7,_0x2893x9)})[_0xb1f7[8]](function(_0x2893x9){return handleError(_0x2893x7,_0x2893x9)})};function handleError(_0x2893x7,_0x2893x9){return _0x2893x7[_0xb1f7[10]](500)[_0xb1f7[9]](_0x2893x9)}
\ No newline at end of file