Built motion from commit 038bc69.|0.0.119
[motion.git] / server / api / report_mail / report_mail.controller.js
index ccc28b5..cd040ec 100644 (file)
@@ -1,93 +1 @@
-'use strict';
-
-var _ = require('lodash');
-var ReportMail = require('../../models').ReportMail;
-
-// Get list of report_mails
-exports.index = function(req, res) {
-  ReportMail
-    .findAll()
-    .then(function(report_mails) {
-      return res.status(200).send(report_mails);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Get a single reportMail
-exports.show = function(req, res) {
-  ReportMail
-    .findById(req.params.id)
-    .then(function(reportMail) {
-      if (!reportMail) {
-        return res.sendStatus(404);
-      }
-      return res.send(reportMail);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Creates a new reportMail in the DB.
-exports.create = function(req, res) {
-  ReportMail
-    .create(req.body)
-    .then(function(reportMail) {
-      return res.status(201).send(reportMail);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Updates an existing reportMail in the DB.
-exports.update = function(req, res) {
-  if (req.body.id) {
-    delete req.body.id;
-  }
-  ReportMail
-    .findById(req.params.id)
-    .then(function(reportMail) {
-      if (!reportMail) {
-        return res.sendStatus(404);
-      }
-      var updated = _.merge(reportMail, req.body);
-      updated.save()
-        .then(function() {
-          return res.status(200).send(reportMail);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-        });
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Deletes a reportMail from the DB.
-exports.destroy = function(req, res) {
-  ReportMail
-    .findById(req.params.id)
-    .then(function(reportMail) {
-      if (!reportMail) {
-        return res.sendStatus(404);
-      }
-      reportMail.destroy()
-        .then(function() {
-          return res.sendStatus(204);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-        });
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-function handleError(res, err) {
-  return res.status(500).send(err);
-}
+var _0x7f1a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\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","\x72\x6F\x6C\x65","\x75\x73\x65\x72","\x61\x67\x65\x6E\x74","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\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","\x61\x63\x63\x65\x70\x74","\x2E","\x73\x70\x6C\x69\x74","\x75\x6E\x69\x71\x75\x65\x69\x64","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x4F\x50\x45\x4E","\x69\x64","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x65\x6A\x65\x63\x74","\x52\x45\x4A\x45\x43\x54","\x72\x6F\x6F\x6D\x69\x64","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x6C\x6F\x67"];_0x7f1a[0];var _=require(_0x7f1a[1]);var moment=require(_0x7f1a[2]);var Report=require(_0x7f1a[4])[_0x7f1a[3]];var Room=require(_0x7f1a[4])[_0x7f1a[5]];var Status=require(_0x7f1a[4])[_0x7f1a[6]];var sequelize=require(_0x7f1a[4])[_0x7f1a[7]];var Util=require(_0x7f1a[8]);exports[_0x7f1a[9]]= function(_0xa744x8,_0xa744x9,_0xa744xa){var _0xa744xb={};if(_0xa744x8[_0x7f1a[11]][_0x7f1a[10]]=== _0x7f1a[12]){_0xa744xb[_0x7f1a[13]]= _0xa744x8[_0x7f1a[11]][_0x7f1a[14]]};return Report[_0x7f1a[21]](Util[_0x7f1a[20]](_0xa744x8[_0x7f1a[19]],_0xa744xb))[_0x7f1a[18]](function(_0xa744xd){_0xa744x9[_0x7f1a[17]](200)[_0x7f1a[16]](_0xa744xd)})[_0x7f1a[15]](function(_0xa744xc){return handleError(_0xa744x9,_0xa744xc)})};exports[_0x7f1a[22]]= function(_0xa744x8,_0xa744x9){var _0xa744xe=_0xa744x8[_0x7f1a[26]][_0x7f1a[25]][_0x7f1a[24]](_0x7f1a[23])[1];return Report[_0x7f1a[35]](_0xa744x8[_0x7f1a[26]][_0x7f1a[29]])[_0x7f1a[18]](function(_0xa744xf){if(!_0xa744xf){return _0xa744x9[_0x7f1a[27]](404)};var _0xa744x10=_[_0x7f1a[33]](_0xa744xf,{connectid:_0xa744x8[_0x7f1a[26]][_0x7f1a[25]]});return _0xa744x10[_0x7f1a[34]]()})[_0x7f1a[18]](function(){return Room[_0x7f1a[32]]({status:_0x7f1a[28]},{where:{id:_0xa744xe}})})[_0x7f1a[18]](function(){return Status[_0x7f1a[31]]({status:_0x7f1a[28],UserId:_0xa744x8[_0x7f1a[11]][_0x7f1a[29]],data1:_0xa744x8[_0x7f1a[11]][_0x7f1a[14]],data2:_0xa744x8[_0x7f1a[11]][_0x7f1a[30]],MailRoomId:_0xa744xe})})[_0x7f1a[18]](function(){return _0xa744x9[_0x7f1a[27]](200)})[_0x7f1a[15]](sequelize.UniqueConstraintError,function(_0xa744xc){return _0xa744x9[_0x7f1a[27]](504)})[_0x7f1a[15]](function(_0xa744xc){return handleError(_0xa744x9,_0xa744xc)})};exports[_0x7f1a[36]]= function(_0xa744x8,_0xa744x9){var _0xa744x11;return Report[_0x7f1a[35]](_0xa744x8[_0x7f1a[26]][_0x7f1a[29]])[_0x7f1a[18]](function(_0xa744x12){_0xa744x11= _0xa744x12;if(!_0xa744x11){return _0xa744x9[_0x7f1a[27]](404)};var _0xa744x10=_[_0x7f1a[33]](_0xa744x12,{rejectedAt:moment()[_0x7f1a[40]](_0x7f1a[39])});return _0xa744x10[_0x7f1a[34]]()})[_0x7f1a[18]](function(){return Status[_0x7f1a[31]]({status:_0x7f1a[37],data1:_0xa744x8[_0x7f1a[11]][_0x7f1a[14]],data2:_0xa744x8[_0x7f1a[11]][_0x7f1a[30]],UserId:_0xa744x8[_0x7f1a[11]][_0x7f1a[29]],MailRoomId:_0xa744x11[_0x7f1a[38]]})})[_0x7f1a[18]](function(){return _0xa744x9[_0x7f1a[27]](200)})[_0x7f1a[15]](function(_0xa744xc){return handleError(_0xa744x9,_0xa744xc)})};function handleError(_0xa744x9,_0xa744xc){console[_0x7f1a[41]](_0xa744xc);return _0xa744x9[_0x7f1a[17]](500)[_0x7f1a[16]](_0xa744xc)}
\ No newline at end of file