92475f833d9c98973f3374b0f4fdfbbe7b1bac57
[motion.git] / server / api / default_metric / default_metric.controller.js
1 var _0xb4ef=["\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"];_0xb4ef[0];var _=require(_0xb4ef[1]);var DefaultMetric=require(_0xb4ef[3])[_0xb4ef[2]];var Metric=require(_0xb4ef[3])[_0xb4ef[4]];var util=require(_0xb4ef[5]);var Util=require(_0xb4ef[6]);var sequelize=require(_0xb4ef[3])[_0xb4ef[7]];var sr=require(_0xb4ef[8]);var logger=require(_0xb4ef[10])(_0xb4ef[9]);exports[_0xb4ef[11]]= function(_0x35c7x9,_0x35c7xa,_0x35c7xb){return DefaultMetric[_0xb4ef[18]](Util[_0xb4ef[17]](_0x35c7x9[_0xb4ef[16]]))[_0xb4ef[15]](function(_0x35c7xd){return _0x35c7xa[_0xb4ef[14]](200)[_0xb4ef[13]](_0x35c7xd)})[_0xb4ef[12]](function(_0x35c7xc){return handleError(_0x35c7xa,_0x35c7xc)})};exports[_0xb4ef[19]]= function(_0x35c7x9,_0x35c7xa){return DefaultMetric[_0xb4ef[23]]({where:{table:_0x35c7x9[_0xb4ef[16]][_0xb4ef[22]]}})[_0xb4ef[15]](function(_0x35c7xe){if(!_0x35c7xe){return _0x35c7xa[_0xb4ef[20]](404)};return _0x35c7xa[_0xb4ef[14]](200)[_0xb4ef[13]]({count:_0x35c7xe[_0xb4ef[21]],rows:_0x35c7xe})})[_0xb4ef[12]](function(_0x35c7xc){return handleError(_0x35c7xa,_0x35c7xc)})};exports[_0xb4ef[24]]= function(_0x35c7x9,_0x35c7xa){return DefaultMetric[_0xb4ef[31]](_0x35c7x9[_0xb4ef[30]][_0xb4ef[25]])[_0xb4ef[15]](function(_0x35c7xf){if(!_0x35c7xf){return _0x35c7xa[_0xb4ef[20]](404)};delete _0x35c7xf[_0xb4ef[26]][_0xb4ef[25]];_0x35c7xf[_0xb4ef[26]][_0xb4ef[27]]+= _0xb4ef[28]+ sr({length:5});return Metric[_0xb4ef[29]](_0x35c7xf[_0xb4ef[26]])})[_0xb4ef[15]](function(){return _0x35c7xa[_0xb4ef[20]](201)})[_0xb4ef[12]](function(_0x35c7xc){return handleError(_0x35c7xa,_0x35c7xc)})};function handleError(_0x35c7xa,_0x35c7xc){logger[_0xb4ef[33]](_0x35c7xc[_0xb4ef[32]]);return _0x35c7xa[_0xb4ef[14]](500)[_0xb4ef[13]](_0x35c7xc)}