Commit c3d0185d by Ren Ping

feat:消息模块开发

1 parent 33a38111
...@@ -63,7 +63,7 @@ public class MsgController { ...@@ -63,7 +63,7 @@ public class MsgController {
* @date 2023/10/24 * @date 2023/10/24
*/ */
@PostMapping("/msg/delete") @PostMapping("/msg/delete")
public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid IdDTO dto) { public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid MsgDTO.IdDTO dto) {
AssertUtil.isNotEmpty(userId, "用户ID不能为空"); AssertUtil.isNotEmpty(userId, "用户ID不能为空");
AssertUtil.isNotNull(dto.getId(), "消息ID不能为空"); AssertUtil.isNotNull(dto.getId(), "消息ID不能为空");
msgService.delete(dto.getId(), userId); msgService.delete(dto.getId(), userId);
......
package com.dituhui.pea.order.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 公共 id类
*
* @author RenPing
* @date 2023/10/26
*/
@Data
public class IdDTO {
@NotNull(message = "ID不能为空")
private Integer id;
}
...@@ -49,4 +49,12 @@ public class MsgDTO { ...@@ -49,4 +49,12 @@ public class MsgDTO {
@Min(value = 0, message = "标签类型格式不对") @Min(value = 0, message = "标签类型格式不对")
@Max(value = 1, message = "标签类型格式不对") @Max(value = 1, message = "标签类型格式不对")
private Integer tag; private Integer tag;
@Data
public static class IdDTO {
@NotNull(message = "ID不能为空")
private Integer id;
}
} }
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!