//
        // Delete all messages
        //
        public DeleteResponseMessage deleteMessages(DeleteRequestMessage req)
        {
            DeleteResult          result;
            DeleteResponseMessage response;

            try
            {
                result   = col.DeleteMany(m => m["from"] == req.from && m["to"] == req.to);
                response = new DeleteResponseMessage(Status.STATUS.SUCCESS, req, result);
            }
            catch (MongoWriteException err)
            {
                response = new DeleteResponseMessage(Status.STATUS.ERROR, req, err);
            }

            return(response);
        }
Ejemplo n.º 2
0
 public DeleteResponseMessage(Enum status, DeleteRequestMessage request, Object mongoResult)
 {
     this.request = request;
     this.result  = new Result(Status.OPERATION.DELETE, status, -1, mongoResult);
 }
Ejemplo n.º 3
0
        //
        // Delete all messages
        //
        public DeleteResponseMessage deleteMessages(DeleteRequestMessage req)
        {
            DeleteResponseMessage response = messageDao.deleteMessages(req);

            return(response);
        }
 public ActionResult <DeleteResponseMessage> Post([FromBody] DeleteRequestMessage req)
 {
     return(service.deleteMessages(req));
 }