yujian
2020-05-11 712fb305d6f79961e879a2f543107e19d7f9e8a2
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java
@@ -1065,4 +1065,54 @@
      out.print(JsonUtil.loadTrueResult(""));
   }
   /**
    * 删除消息
    * @param acceptData
    * @param type
    * @param id
    * @param out
    */
   @RequestMapping(value = "deleteMsg", method = RequestMethod.POST)
   public void deleteMsg(AcceptData acceptData, String type, Long id, Long uid, PrintWriter out) {
      if (StringUtil.isNullOrEmpty(type) || id == null || uid == null) {
         out.print(JsonUtil.loadFalseResult("参数不完整"));
         return;
      }
      switch (type) {
      case MSG_TYPE_ORDER:
         MsgOrderDetail msgOrderDetail  = msgOrderDetailService.selectByPrimaryKey(id);
         if (msgOrderDetail != null && msgOrderDetail.getUser().getId().longValue() == uid.longValue()) {
            msgOrderDetailService.deleteByPrimaryKey(id);
         }
         break;
      case MSG_TYPE_MONEY:
         MsgMoneyDetail moneyDetail  = msgMoneyDetailService.selectByPrimaryKey(id);
         if (moneyDetail != null && moneyDetail.getUser().getId().longValue() == uid.longValue()) {
            msgMoneyDetailService.deleteByPrimaryKey(id);
         }
         break;
      case MSG_TYPE_ACCOUNT:
         MsgAccountDetail accountDetail  = msgAccountDetailService.selectByPrimaryKey(id);
         if (accountDetail != null && accountDetail.getUser().getId().longValue() == uid.longValue()) {
            msgAccountDetailService.deleteByPrimaryKey(id);
         }
         break;
      case MSG_TYPE_INVITE:
         MsgInviteDetail inviteDetail  = msgInviteDetailService.selectByPrimaryKey(id);
         if (inviteDetail != null && inviteDetail.getUser().getId().longValue() == uid.longValue()) {
            msgInviteDetailService.deleteByPrimaryKey(id);
         }
         break;
      case MSG_TYPE_OTHER:
         MsgOtherDetail otherDetail  = msgOtherDetailService.selectByPrimaryKey(id);
         if (otherDetail != null && otherDetail.getUser().getId().longValue() == uid.longValue()) {
            msgOtherDetailService.deleteByPrimaryKey(id);
         }
         break;
      }
      out.print(JsonUtil.loadTrueResult(""));
   }
}