mirror of https://gitee.com/stylefeng/roses
【8.1.0】【message】更新批量清空消息
parent
6161e8bd89
commit
ffdcc689b1
|
@ -17,30 +17,52 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 系统消息控制器
|
||||
* 个人消息控制器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/01/12 17:31
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "系统消息")
|
||||
@ApiResource(name = "个人消息")
|
||||
public class SysMessageController {
|
||||
|
||||
@Resource
|
||||
private SysMessageService sysMessageService;
|
||||
|
||||
/**
|
||||
* 删除系统消息
|
||||
* 获取个人消息列表(带分页)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/01/12 17:31
|
||||
*/
|
||||
@PostResource(name = "删除系统消息", path = "/sysMessage/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(BaseRequest.detail.class) SysMessageRequest sysMessageRequest) {
|
||||
@GetResource(name = "获取个人消息列表(带分页)", path = "/sysMessage/page")
|
||||
public ResponseData<PageResult<SysMessage>> page(SysMessageRequest sysMessageRequest) {
|
||||
return new SuccessResponseData<>(sysMessageService.findPage(sysMessageRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除个人消息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/01/12 17:31
|
||||
*/
|
||||
@PostResource(name = "删除个人消息", path = "/sysMessage/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(BaseRequest.delete.class) SysMessageRequest sysMessageRequest) {
|
||||
sysMessageService.del(sysMessageRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除,清空我的消息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024-01-12 18:21
|
||||
*/
|
||||
@PostResource(name = "批量删除,清空我的消息", path = "/sysMessage/cleanMyMessage")
|
||||
public ResponseData<?> cleanMyMessage() {
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设为已读消息
|
||||
*
|
||||
|
@ -53,25 +75,14 @@ public class SysMessageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查看系统消息详情
|
||||
* 查看个人消息详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/01/12 17:31
|
||||
*/
|
||||
@GetResource(name = "查看系统消息详情", path = "/sysMessage/detail")
|
||||
@GetResource(name = "查看个人消息详情", path = "/sysMessage/detail")
|
||||
public ResponseData<SysMessage> detail(@Validated(SysMessageRequest.detail.class) SysMessageRequest sysMessageRequest) {
|
||||
return new SuccessResponseData<>(sysMessageService.detail(sysMessageRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取个人系统消息列表(带分页)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/01/12 17:31
|
||||
*/
|
||||
@GetResource(name = "获取个人系统消息列表(带分页)", path = "/sysMessage/page")
|
||||
public ResponseData<PageResult<SysMessage>> page(SysMessageRequest sysMessageRequest) {
|
||||
return new SuccessResponseData<>(sysMessageService.findPage(sysMessageRequest));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
|||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -22,14 +21,13 @@ public class SysMessageRequest extends BaseRequest {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "主键不能为空", groups = {edit.class, delete.class})
|
||||
@NotNull(message = "主键不能为空", groups = {delete.class})
|
||||
@ChineseDescription("主键")
|
||||
private Long messageId;
|
||||
|
||||
/**
|
||||
* 接收用户id
|
||||
*/
|
||||
@NotNull(message = "接收用户id不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("接收用户id")
|
||||
private Long receiveUserId;
|
||||
|
||||
|
@ -42,7 +40,6 @@ public class SysMessageRequest extends BaseRequest {
|
|||
/**
|
||||
* 消息标题
|
||||
*/
|
||||
@NotBlank(message = "消息标题不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("消息标题")
|
||||
private String messageTitle;
|
||||
|
||||
|
@ -55,7 +52,6 @@ public class SysMessageRequest extends BaseRequest {
|
|||
/**
|
||||
* 消息类型:NORMAL-普通类型,URL-带链接跳转
|
||||
*/
|
||||
@NotBlank(message = "消息类型:NORMAL-普通类型,URL-带链接跳转不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("消息类型:NORMAL-普通类型,URL-带链接跳转")
|
||||
private String messageType;
|
||||
|
||||
|
@ -68,7 +64,6 @@ public class SysMessageRequest extends BaseRequest {
|
|||
/**
|
||||
* 优先级:high-高优先级,middle-中,low-低
|
||||
*/
|
||||
@NotBlank(message = "优先级:high-高优先级,middle-中,low-低不能为空", groups = {add.class, edit.class})
|
||||
@ChineseDescription("优先级:high-高优先级,middle-中,low-低")
|
||||
private String priorityLevel;
|
||||
|
||||
|
|
Loading…
Reference in New Issue