【8.1.0】【message】更新批量清空消息

pull/60/head
fengshuonan 2024-01-12 18:23:35 +08:00
parent 6161e8bd89
commit ffdcc689b1
2 changed files with 30 additions and 24 deletions

View File

@ -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));
}
}

View File

@ -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;