|
@@ -1,21 +1,22 @@
|
|
|
package com.aizuda.boot.modules.system.controller;
|
|
|
|
|
|
+import com.aizuda.boot.modules.system.entity.SysMessage;
|
|
|
import com.aizuda.boot.modules.system.entity.vo.InformMessageVO;
|
|
|
+import com.aizuda.boot.modules.system.service.ISysMessageService;
|
|
|
import com.aizuda.core.api.ApiController;
|
|
|
import com.aizuda.core.api.PageParam;
|
|
|
import com.aizuda.core.validation.Create;
|
|
|
import com.aizuda.core.validation.Update;
|
|
|
-import com.aizuda.boot.modules.system.entity.SysMessage;
|
|
|
-import com.aizuda.boot.modules.system.service.ISysMessageService;
|
|
|
+import com.aizuda.service.web.UserSession;
|
|
|
import com.baomidou.kisso.annotation.Permission;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import jakarta.validation.constraints.NotEmpty;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -38,6 +39,13 @@ public class SysMessageController extends ApiController {
|
|
|
return sysMessageService.page(dto.page(), dto.getData());
|
|
|
}
|
|
|
|
|
|
+ @Operation(summary = "一键已读")
|
|
|
+ @Permission("sys:message:page")
|
|
|
+ @PostMapping("/read")
|
|
|
+ public boolean read() {
|
|
|
+ return sysMessageService.readAll(UserSession.getLoginInfo());
|
|
|
+ }
|
|
|
+
|
|
|
@Operation(summary = "告知消息")
|
|
|
@Permission(ignore = true)
|
|
|
@GetMapping("/inform")
|
|
@@ -49,7 +57,7 @@ public class SysMessageController extends ApiController {
|
|
|
@Permission("sys:message:get")
|
|
|
@GetMapping("/get")
|
|
|
public SysMessage get(@RequestParam Long id) {
|
|
|
- return sysMessageService.getById(id);
|
|
|
+ return sysMessageService.getViewedById(id);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "根据 id 修改信息")
|