|
@@ -4,6 +4,7 @@ import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -56,15 +57,15 @@ public class TimeMessageController {
|
|
|
/**
|
|
|
* 最新系统消息和通知消息及其条数
|
|
|
*/
|
|
|
- @PostMapping("/newMessageOne")
|
|
|
- public RestResponse<Map<String, Object>> newMessageOne(@RequestBody MessageVo messageVo) {
|
|
|
+ @GetMapping("/newMessageOne")
|
|
|
+ public RestResponse<Map<String, Object>> newMessageOne(Long userId) {
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
TimeMessageDto systemOne = new TimeMessageDto();
|
|
|
int count = timeMessageService
|
|
|
- .count(Wrappers.<TimeMessage>query().eq(messageVo.getUserId() != null, "user_id", messageVo.getUserId())
|
|
|
+ .count(Wrappers.<TimeMessage>query().eq(userId != null, "user_id", userId)
|
|
|
.eq("type", 0).notIn("device_model", ApiConstants.DeviceModel.PC));
|
|
|
TimeMessage one = timeMessageService.getOne(
|
|
|
- Wrappers.<TimeMessage>query().eq(messageVo.getUserId() != null, "user_id", messageVo.getUserId())
|
|
|
+ Wrappers.<TimeMessage>query().eq(userId != null, "user_id", userId)
|
|
|
.eq("type", 0).notIn("device_model", ApiConstants.DeviceModel.PC).orderByAsc("view_flag")
|
|
|
.orderByDesc("create_time").last("Limit 1"));
|
|
|
systemOne.setCount(count);
|
|
@@ -72,10 +73,10 @@ public class TimeMessageController {
|
|
|
result.put("系统消息", systemOne);
|
|
|
TimeMessageDto noticeOne = new TimeMessageDto();
|
|
|
int noticeOneCount = timeMessageService
|
|
|
- .count(Wrappers.<TimeMessage>query().eq(messageVo.getUserId() != null, "user_id", messageVo.getUserId())
|
|
|
+ .count(Wrappers.<TimeMessage>query().eq(userId != null, "user_id", userId)
|
|
|
.notIn("type", 0).notIn("device_model", ApiConstants.DeviceModel.PC));
|
|
|
TimeMessage notice = timeMessageService.getOne(
|
|
|
- Wrappers.<TimeMessage>query().eq(messageVo.getUserId() != null, "user_id", messageVo.getUserId())
|
|
|
+ Wrappers.<TimeMessage>query().eq(userId != null, "user_id", userId)
|
|
|
.notIn("type", 0).notIn("device_model", ApiConstants.DeviceModel.PC).orderByAsc("view_flag")
|
|
|
.orderByDesc("create_time").last("Limit 1"));
|
|
|
noticeOne.setCount(noticeOneCount);
|