|
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -19,6 +20,7 @@ import java.util.Collection;
|
|
|
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
+@Slf4j
|
|
|
@RequestMapping("message")
|
|
|
public class TimeMessageController {
|
|
|
private final TimeMessageService timeMessageService;
|
|
@@ -69,6 +71,9 @@ public class TimeMessageController {
|
|
|
@PostMapping("read")
|
|
|
public RestResponse<Boolean> messages(@RequestBody MessageVo messageVo) {
|
|
|
Collection<TimeMessage> timeMessages = timeMessageService.listByIds(messageVo.getIds());
|
|
|
+ if (timeMessages.isEmpty()) {
|
|
|
+ return RestResponse.success(true);
|
|
|
+ }
|
|
|
timeMessages.forEach(timeMessage -> timeMessage.setViewFlag(1));
|
|
|
return RestResponse.success(timeMessageService.updateBatchById(timeMessages));
|
|
|
}
|