Built motion from commit 82438f7.|0.0.115
[motion.git] / server / api / interval / interval.controller.js
index 0dd0628..19cde90 100644 (file)
@@ -1 +1 @@
-var _0x837d=["\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"];_0x837d[0];var _=require(_0x837d[1]);var Interval=require(_0x837d[3])[_0x837d[2]];var VoiceExtension=require(_0x837d[3])[_0x837d[4]];var sequelize=require(_0x837d[3])[_0x837d[5]];var util=require(_0x837d[6]);exports[_0x837d[7]]=function(_0x8bcdx6,_0x8bcdx7){var _0x8bcdx8=[_0x837d[8]];var _0x8bcdx9=_0x8bcdx6[_0x837d[10]][_0x837d[9]]?parseInt(_0x8bcdx6[_0x837d[10]][_0x837d[9]],10):100;var _0x8bcdxa=_0x8bcdx6[_0x837d[10]][_0x837d[11]]?parseInt(_0x8bcdx6[_0x837d[10]][_0x837d[11]],10):0;var _0x8bcdxb={where:{IntervalId:null},limit:_0x8bcdx9,offset:_0x8bcdxa*_0x8bcdx9};_[_0x837d[25]](_0x8bcdx6[_0x837d[10]],function(_0x8bcdxc,_0x8bcdxd){switch(_0x8bcdxd){case _0x837d[9]:;case _0x837d[11]:break ;;case _0x837d[14]:_0x8bcdxb[_0x837d[12]]=util[_0x837d[17]](_0x837d[13],_0x8bcdx6[_0x837d[10]][_0x837d[14]],_0x8bcdx6[_0x837d[10]][_0x837d[15]]||_0x837d[16])||null;break ;;case _0x837d[15]:break ;;case _0x837d[23]:_0x8bcdxb[_0x837d[19]][_0x837d[18]]=[];_0x8bcdx8[_0x837d[22]](function(_0x8bcdxe){var _0x8bcdxf={};_0x8bcdxf[_0x8bcdxe]={$like:_0x837d[20]+_0x8bcdxc+_0x837d[20]};_0x8bcdxb[_0x837d[19]][_0x837d[18]][_0x837d[21]](_0x8bcdxf);});break ;;default:_0x8bcdxb[_0x837d[19]][_0x8bcdxd]={$like:{}};_0x8bcdxb[_0x837d[19]][_0x8bcdxd][_0x837d[24]]=_0x837d[20]+_0x8bcdxc+_0x837d[20];;}});Interval[_0x837d[30]](_0x8bcdxb)[_0x837d[29]](function(_0x8bcdx11){return _0x8bcdx7[_0x837d[28]](200)[_0x837d[27]](_0x8bcdx11)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});};exports[_0x837d[31]]=function(_0x8bcdx6,_0x8bcdx7){Interval[_0x837d[32]]()[_0x837d[29]](function(_0x8bcdx11){return _0x8bcdx7[_0x837d[28]](200)[_0x837d[27]](_0x8bcdx11)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)})};exports[_0x837d[33]]=function(_0x8bcdx6,_0x8bcdx7){Interval[_0x837d[37]](_0x8bcdx6[_0x837d[36]][_0x837d[35]],{include:[{all:true}]})[_0x837d[29]](function(_0x8bcdx12){if(!_0x8bcdx12){return _0x8bcdx7[_0x837d[34]](404)};return _0x8bcdx7[_0x837d[27]](_0x8bcdx12);})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)})};exports[_0x837d[38]]=function(_0x8bcdx6,_0x8bcdx7){var _0x8bcdx13={name:_0x8bcdx6[_0x837d[39]][_0x837d[8]],IntervalId:_0x8bcdx6[_0x837d[39]][_0x837d[40]]?_0x8bcdx6[_0x837d[39]][_0x837d[40]]:null};if(_0x8bcdx6[_0x837d[39]][_0x837d[35]]){_0x8bcdx13[_0x837d[35]]={$ne:_0x8bcdx6[_0x837d[39]][_0x837d[35]]}};console[_0x837d[41]](_0x8bcdx6[_0x837d[39]]);Interval[_0x837d[32]]({where:_0x8bcdx13})[_0x837d[29]](function(_0x8bcdx11){if(!_0x8bcdx11){return _0x8bcdx7[_0x837d[34]](404)};return _0x8bcdx7[_0x837d[27]](_0x8bcdx11);})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});};exports[_0x837d[42]]=function(_0x8bcdx6,_0x8bcdx7){Interval[_0x837d[32]]({where:{name:_0x8bcdx6[_0x837d[39]][_0x837d[8]],IntervalId:_0x8bcdx6[_0x837d[39]][_0x837d[40]]?_0x8bcdx6[_0x837d[39]][_0x837d[40]]:null}})[_0x837d[29]](function(_0x8bcdx14){console[_0x837d[41]](_0x8bcdx14);console[_0x837d[41]](_0x837d[43]);if(!_0x8bcdx14){return _0x8bcdx7[_0x837d[34]](404)};if(_0x8bcdx14[_0x837d[44]]>0){return _0x8bcdx7[_0x837d[28]](500)[_0x837d[27]]({message:_0x8bcdx6[_0x837d[39]][_0x837d[40]]?_0x837d[45]:_0x837d[46]})};Interval[_0x837d[42]](_0x8bcdx6[_0x837d[39]])[_0x837d[29]](function(_0x8bcdx12){return _0x8bcdx7[_0x837d[28]](201)[_0x837d[27]](_0x8bcdx12)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)})};exports[_0x837d[47]]=function(_0x8bcdx6,_0x8bcdx7){Interval[_0x837d[32]]({where:{name:_0x8bcdx6[_0x837d[39]][_0x837d[8]],IntervalId:_0x8bcdx6[_0x837d[39]][_0x837d[40]]?_0x8bcdx6[_0x837d[39]][_0x837d[40]]:null,id:{$ne:_0x8bcdx6[_0x837d[39]][_0x837d[35]]}}})[_0x837d[29]](function(_0x8bcdx14){console[_0x837d[41]](_0x8bcdx14);console[_0x837d[41]](_0x837d[43]);if(!_0x8bcdx14){return _0x8bcdx7[_0x837d[34]](404)};if(_0x8bcdx14[_0x837d[44]]>0){return _0x8bcdx7[_0x837d[28]](500)[_0x837d[27]]({message:_0x8bcdx6[_0x837d[39]][_0x837d[40]]?_0x837d[45]:_0x837d[46]})};if(_0x8bcdx6[_0x837d[39]][_0x837d[35]]){delete _0x8bcdx6[_0x837d[39]][_0x837d[35]]};Interval[_0x837d[51]]({where:{id:_0x8bcdx6[_0x837d[36]][_0x837d[35]]}})[_0x837d[29]](function(_0x8bcdx12){if(!_0x8bcdx12){return _0x8bcdx7[_0x837d[34]](404)};var _0x8bcdx15=_[_0x837d[48]](_0x8bcdx12,_0x8bcdx6[_0x837d[39]]);return sequelize[_0x837d[50]](function(_0x8bcdx16){return _0x8bcdx15[_0x837d[49]]({transaction:_0x8bcdx16})[_0x837d[29]](function(_0x8bcdx12){VoiceExtension[_0x837d[47]]({interval:_0x8bcdx12[_0x837d[8]]},{where:{IntervalId:_0x8bcdx12[_0x837d[35]]}},{transaction:_0x8bcdx16})})})[_0x837d[29]](function(){return _0x8bcdx7[_0x837d[28]](200)[_0x837d[27]](_0x8bcdx12)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)})};exports[_0x837d[52]]=function(_0x8bcdx6,_0x8bcdx7){Interval[_0x837d[37]](_0x8bcdx6[_0x837d[36]][_0x837d[35]])[_0x837d[29]](function(_0x8bcdx12){if(!_0x8bcdx12){return _0x8bcdx7[_0x837d[34]](404)};_0x8bcdx12[_0x837d[54]]({where:{isApp:true}})[_0x837d[29]](function(_0x8bcdx17){console[_0x837d[41]](_0x8bcdx17[_0x837d[44]]);if(_0x8bcdx17[_0x837d[44]]>0){return _0x8bcdx7[_0x837d[28]](500)[_0x837d[27]]({message:_0x837d[53]})};_0x8bcdx12[_0x837d[52]]()[_0x837d[29]](function(){return _0x8bcdx7[_0x837d[34]](204)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)})};exports[_0x837d[55]]=function(_0x8bcdx6,_0x8bcdx7){var _0x8bcdx18=false;Interval[_0x837d[32]]({where:{id:_0x8bcdx6[_0x837d[10]][_0x837d[35]]},include:[{all:true}]})[_0x837d[29]](function(_0x8bcdx11){if(!_0x8bcdx11){return _0x8bcdx7[_0x837d[34]](404)};_0x8bcdx11[_0x837d[22]](function(_0x8bcdx19){if(_0x8bcdx19[_0x837d[56]][_0x837d[44]]>0){_0x8bcdx18=true}});if(_0x8bcdx18){return _0x8bcdx7[_0x837d[28]](500)[_0x837d[27]]({message:_0x837d[53]})};Interval[_0x837d[52]]({where:{id:_0x8bcdx6[_0x837d[10]][_0x837d[35]]},individualHooks:true})[_0x837d[29]](function(){return _0x8bcdx7[_0x837d[34]](204)})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});})[_0x837d[26]](function(_0x8bcdx10){return handleError(_0x8bcdx7,_0x8bcdx10)});};function handleError(_0x8bcdx7,_0x8bcdx10){return _0x8bcdx7[_0x837d[28]](500)[_0x837d[27]](_0x8bcdx10)}
\ No newline at end of file
+var _0xc359=["\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"];_0xc359[0];var _=require(_0xc359[1]);var Interval=require(_0xc359[3])[_0xc359[2]];var VoiceExtension=require(_0xc359[3])[_0xc359[4]];var sequelize=require(_0xc359[3])[_0xc359[5]];var Util=require(_0xc359[6]);exports[_0xc359[7]]= function(_0xb2f4x6,_0xb2f4x7,_0xb2f4x8){return Interval[_0xc359[17]](_0xc359[15],_0xc359[16])[_0xc359[14]](Util[_0xc359[13]](_0xb2f4x6[_0xc359[12]]))[_0xc359[11]](function(_0xb2f4xa){_0xb2f4x7[_0xc359[10]](200)[_0xc359[9]](_0xb2f4xa)})[_0xc359[8]](function(_0xb2f4x9){return handleError(_0xb2f4x7,_0xb2f4x9)})};exports[_0xc359[18]]= function(_0xb2f4x6,_0xb2f4x7){return Interval[_0xc359[17]](_0xc359[16])[_0xc359[22]](_0xb2f4x6[_0xc359[21]][_0xc359[20]])[_0xc359[11]](function(_0xb2f4xb){if(!_0xb2f4xb){return _0xb2f4x7[_0xc359[19]](404)};return _0xb2f4x7[_0xc359[9]](_0xb2f4xb)})[_0xc359[8]](function(_0xb2f4x9){return handleError(_0xb2f4x7,_0xb2f4x9)})};exports[_0xc359[23]]= function(_0xb2f4x6,_0xb2f4x7){return Interval[_0xc359[17]](_0xc359[16])[_0xc359[23]](_0xb2f4x6[_0xc359[25]])[_0xc359[11]](function(_0xb2f4xb){return _0xb2f4x7[_0xc359[10]](201)[_0xc359[9]](_0xb2f4xb)})[_0xc359[8]](function(_0xb2f4x9){console[_0xc359[24]](_0xb2f4x9);return handleError(_0xb2f4x7,_0xb2f4x9)})};exports[_0xc359[26]]= function(_0xb2f4x6,_0xb2f4x7){return sequelize[_0xc359[32]](function(_0xb2f4xc){if(_0xb2f4x6[_0xc359[25]][_0xc359[20]]){delete _0xb2f4x6[_0xc359[25]][_0xc359[20]]};return Interval[_0xc359[26]](_0xb2f4x6[_0xc359[25]],{where:{id:_0xb2f4x6[_0xc359[21]][_0xc359[20]]},individualHooks:true,transaction:_0xb2f4xc})[_0xc359[11]](function(){if(_0xb2f4x6[_0xc359[25]][_0xc359[29]]){return Interval[_0xc359[31]]({where:{IntervalId:_0xb2f4x6[_0xc359[21]][_0xc359[20]]},transaction:_0xb2f4xc})}})[_0xc359[11]](function(){console[_0xc359[24]](_0xc359[28]);if(_0xb2f4x6[_0xc359[25]][_0xc359[29]]&& _0xb2f4x6[_0xc359[25]][_0xc359[29]][_0xc359[30]]){return _0xb2f4x6[_0xc359[21]][_0xc359[20]]}})[_0xc359[11]](bulkCreateSubIntervals(_0xb2f4x6[_0xc359[25]].SubIntervals,_0xb2f4xc))[_0xc359[27]]()})[_0xc359[11]](function(){return _0xb2f4x7[_0xc359[19]](200)})[_0xc359[8]](function(_0xb2f4x9){console[_0xc359[24]](_0xb2f4x9);return handleError(_0xb2f4x7,_0xb2f4x9)})};function bulkCreateSubIntervals(_0xb2f4xe,_0xb2f4xc){return function(_0xb2f4xf){if(_0xb2f4xf){console[_0xc359[24]](_0xc359[33]);var _0xb2f4x10=[];_0xb2f4xe[_0xc359[36]](function(_0xb2f4x11){delete _0xb2f4x11[_0xc359[20]];_0xb2f4x11[_0xc359[34]]= _0xb2f4xf;_0xb2f4x10[_0xc359[35]](Interval[_0xc359[23]](_0xb2f4x11,{transaction:_0xb2f4xc}))});return _0xb2f4x10}else {return []}}}exports[_0xc359[31]]= function(_0xb2f4x6,_0xb2f4x7){return sequelize[_0xc359[32]](function(_0xb2f4xc){return Interval[_0xc359[31]]({where:{id:_0xb2f4x6[_0xc359[21]][_0xc359[20]]},individualHooks:true,transaction:_0xb2f4xc})})[_0xc359[11]](function(){return _0xb2f4x7[_0xc359[19]](204)})[_0xc359[8]](sequelize.ForeignKeyConstraintError,function(_0xb2f4x9){_0xb2f4x9[_0xc359[37]]= _0xc359[38];_0xb2f4x9[_0xc359[39]]= _0xc359[40];return handleError(_0xb2f4x7,_0xb2f4x9)})[_0xc359[8]](function(_0xb2f4x9){return handleError(_0xb2f4x7,_0xb2f4x9)})};exports[_0xc359[41]]= function(_0xb2f4x6,_0xb2f4x7){return sequelize[_0xc359[32]](function(_0xb2f4xc){return Interval[_0xc359[31]]({where:{id:_0xb2f4x6[_0xc359[12]][_0xc359[42]]},individualHooks:true,transaction:_0xb2f4xc})})[_0xc359[11]](function(){return _0xb2f4x7[_0xc359[19]](204)})[_0xc359[8]](sequelize.ForeignKeyConstraintError,function(_0xb2f4x9){_0xb2f4x9[_0xc359[37]]= _0xc359[38];_0xb2f4x9[_0xc359[39]]= _0xc359[40];return handleError(_0xb2f4x7,_0xb2f4x9)})[_0xc359[8]](function(_0xb2f4x9){return handleError(_0xb2f4x7,_0xb2f4x9)})};function handleError(_0xb2f4x7,_0xb2f4x9){return _0xb2f4x7[_0xc359[10]](500)[_0xc359[9]](_0xb2f4x9)}
\ No newline at end of file