92a31d2f21ea6456a83a8894e94180847f697134
[motion.git] / server / api / default_metric / default_metric.controller.js
1 var _0x6e47=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x65\x74\x72\x69\x63","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\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","\x67\x65\x74\x4D\x65\x74\x72\x69\x63\x73\x42\x79\x54\x61\x62\x6C\x65","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x61\x62\x6C\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x6C\x6F\x6E\x65\x4D\x65\x74\x72\x69\x63","\x69\x64","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6E\x61\x6D\x65","\x5F","\x63\x72\x65\x61\x74\x65","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64"];_0x6e47[0];var _=require(_0x6e47[1]);var DefaultMetric=require(_0x6e47[3])[_0x6e47[2]];var Metric=require(_0x6e47[3])[_0x6e47[4]];var util=require(_0x6e47[5]);var Util=require(_0x6e47[6]);var sequelize=require(_0x6e47[3])[_0x6e47[7]];var sr=require(_0x6e47[8]);exports[_0x6e47[9]]= function(_0x8754x8,_0x8754x9,_0x8754xa){return DefaultMetric[_0x6e47[16]](Util[_0x6e47[15]](_0x8754x8[_0x6e47[14]]))[_0x6e47[13]](function(_0x8754xc){return _0x8754x9[_0x6e47[12]](200)[_0x6e47[11]](_0x8754xc)})[_0x6e47[10]](function(_0x8754xb){return handleError(_0x8754x9,_0x8754xb)})};exports[_0x6e47[17]]= function(_0x8754x8,_0x8754x9){return DefaultMetric[_0x6e47[21]]({where:{table:_0x8754x8[_0x6e47[14]][_0x6e47[20]]}})[_0x6e47[13]](function(_0x8754xd){if(!_0x8754xd){return _0x8754x9[_0x6e47[18]](404)};return _0x8754x9[_0x6e47[12]](200)[_0x6e47[11]]({count:_0x8754xd[_0x6e47[19]],rows:_0x8754xd})})[_0x6e47[10]](function(_0x8754xb){return handleError(_0x8754x9,_0x8754xb)})};exports[_0x6e47[22]]= function(_0x8754x8,_0x8754x9){return DefaultMetric[_0x6e47[29]](_0x8754x8[_0x6e47[28]][_0x6e47[23]])[_0x6e47[13]](function(_0x8754xe){if(!_0x8754xe){return _0x8754x9[_0x6e47[18]](404)};delete _0x8754xe[_0x6e47[24]][_0x6e47[23]];_0x8754xe[_0x6e47[24]][_0x6e47[25]]+= _0x6e47[26]+ sr({length:5});return Metric[_0x6e47[27]](_0x8754xe[_0x6e47[24]])})[_0x6e47[13]](function(){return _0x8754x9[_0x6e47[18]](201)})[_0x6e47[10]](function(_0x8754xb){return handleError(_0x8754x9,_0x8754xb)})};function handleError(_0x8754x9,_0x8754xb){return _0x8754x9[_0x6e47[12]](500)[_0x6e47[11]](_0x8754xb)}