| | |
| | | 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(""));
|
| | | }
|
| | | |
| | | }
|