Built motion from commit 8abd872ce.|1.0.30
[motion.git] / server / api / default_metric / default_metric.controller.js
1 var _0x7f4e=["\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","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x7f4e[0];var _=require(_0x7f4e[1]);var DefaultMetric=require(_0x7f4e[3])[_0x7f4e[2]];var Metric=require(_0x7f4e[3])[_0x7f4e[4]];var util=require(_0x7f4e[5]);var Util=require(_0x7f4e[6]);var sequelize=require(_0x7f4e[3])[_0x7f4e[7]];var sr=require(_0x7f4e[8]);var logger=require(_0x7f4e[10])(_0x7f4e[9]);exports[_0x7f4e[11]]= function(_0xa69dx9,_0xa69dxa,_0xa69dxb){return DefaultMetric[_0x7f4e[18]](Util[_0x7f4e[17]](_0xa69dx9[_0x7f4e[16]]))[_0x7f4e[15]](function(_0xa69dxd){return _0xa69dxa[_0x7f4e[14]](200)[_0x7f4e[13]](_0xa69dxd)})[_0x7f4e[12]](function(_0xa69dxc){return handleError(_0xa69dxa,_0xa69dxc)})};exports[_0x7f4e[19]]= function(_0xa69dx9,_0xa69dxa){return DefaultMetric[_0x7f4e[23]]({where:{table:_0xa69dx9[_0x7f4e[16]][_0x7f4e[22]]}})[_0x7f4e[15]](function(_0xa69dxe){if(!_0xa69dxe){return _0xa69dxa[_0x7f4e[20]](404)};return _0xa69dxa[_0x7f4e[14]](200)[_0x7f4e[13]]({count:_0xa69dxe[_0x7f4e[21]],rows:_0xa69dxe})})[_0x7f4e[12]](function(_0xa69dxc){return handleError(_0xa69dxa,_0xa69dxc)})};exports[_0x7f4e[24]]= function(_0xa69dx9,_0xa69dxa){return DefaultMetric[_0x7f4e[31]](_0xa69dx9[_0x7f4e[30]][_0x7f4e[25]])[_0x7f4e[15]](function(_0xa69dxf){if(!_0xa69dxf){return _0xa69dxa[_0x7f4e[20]](404)};delete _0xa69dxf[_0x7f4e[26]][_0x7f4e[25]];_0xa69dxf[_0x7f4e[26]][_0x7f4e[27]]+= _0x7f4e[28]+ sr({length:5});return Metric[_0x7f4e[29]](_0xa69dxf[_0x7f4e[26]])})[_0x7f4e[15]](function(){return _0xa69dxa[_0x7f4e[20]](201)})[_0x7f4e[12]](function(_0xa69dxc){return handleError(_0xa69dxa,_0xa69dxc)})};function handleError(_0xa69dxa,_0xa69dxc){logger[_0x7f4e[33]](_0xa69dxc[_0x7f4e[32]]);return _0xa69dxa[_0x7f4e[14]](500)[_0x7f4e[13]](_0xa69dxc)}