|
@@ -2,6 +2,7 @@ package com.huiju.estateagents.controller;
|
2
|
2
|
|
3
|
3
|
|
4
|
4
|
import com.huiju.estateagents.base.ResponseBean;
|
|
5
|
+import com.huiju.estateagents.common.CommConstant;
|
5
|
6
|
import com.huiju.estateagents.common.JWTUtils;
|
6
|
7
|
import com.huiju.estateagents.entity.TaChat;
|
7
|
8
|
import com.huiju.estateagents.entity.TaPerson;
|
|
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
13
|
14
|
import com.huiju.estateagents.base.BaseController;
|
14
|
15
|
|
15
|
16
|
import javax.servlet.http.HttpServletRequest;
|
|
17
|
+import javax.websocket.server.PathParam;
|
16
|
18
|
|
17
|
19
|
/**
|
18
|
20
|
* <p>
|
|
@@ -68,4 +70,19 @@ public class TaChatController extends BaseController {
|
68
|
70
|
String openid = getOpenId(request);
|
69
|
71
|
return taChatService.updateMessageReadedOf(openid);
|
70
|
72
|
}
|
|
73
|
+
|
|
74
|
+ /**
|
|
75
|
+ * 更新当前消息为已读
|
|
76
|
+ * @return
|
|
77
|
+ */
|
|
78
|
+ @PutMapping("/wx/chat/message/{chatId}")
|
|
79
|
+ public ResponseBean updateMessageReadedById(@PathVariable("chatId") Integer chatId,HttpServletRequest request) {
|
|
80
|
+ TaChat taChat = new TaChat();
|
|
81
|
+ taChat.setChatId(chatId);
|
|
82
|
+ taChat.setIsRead(CommConstant.MESSAGE_READED);
|
|
83
|
+ if (taChatService.updateById(taChat)){
|
|
84
|
+ return ResponseBean.success("更新成功");
|
|
85
|
+ }
|
|
86
|
+ return ResponseBean.error("更新失败",ResponseBean.ERROR_ILLEGAL_PARAMS);
|
|
87
|
+ }
|
71
|
88
|
}
|