消息队列存储数据

This commit is contained in:
2025-06-11 14:45:40 +08:00
commit 9bbb491633
118 changed files with 7197 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.yupi.springbootinit.model.dto.file;
import java.io.Serializable;
import lombok.Data;
/**
* 文件上传请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UploadFileRequest implements Serializable {
/**
* 业务
*/
private String biz;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,88 @@
package com.yupi.springbootinit.model.dto.host;
import lombok.Data;
import java.util.Date;
/*
* @author: ziin
* @date: 2025/6/10 18:58
*/
@Data
public class HostInfoDTO {
/**
* 主键
*/
private Long id;
/**
* 主播id
*/
private String hostsId;
/**
* 主播等级
*/
private String hostsLevel;
/**
* 主播金币
*/
private Integer hostsCoins;
/**
* 邀请类型
*/
private Integer invitationType;
/**
* 粉丝数量
*/
private Integer fans;
/**
* 关注数量
*/
private Integer fllowernum;
/**
* 昨日金币
*/
private Integer yesterdayCoins;
/**
* 主播国家
*/
private String country;
/**
* 直播类型 娱乐,游戏
*/
private String hostsKind;
/**
* 租户 Id
*/
private Long tenantId;
/**
* 入库人
*/
private Integer creator;
/**
* 数据插入时间
*/
private Date createTime;
/**
* 更新人
*/
private String updater;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@@ -0,0 +1,32 @@
package com.yupi.springbootinit.model.dto.post;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* 创建请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class PostAddRequest implements Serializable {
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 标签列表
*/
private List<String> tags;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,37 @@
package com.yupi.springbootinit.model.dto.post;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* 编辑请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class PostEditRequest implements Serializable {
/**
* id
*/
private Long id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 标签列表
*/
private List<String> tags;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,123 @@
package com.yupi.springbootinit.model.dto.post;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONUtil;
import com.yupi.springbootinit.model.entity.Post;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 帖子 ES 包装类
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
**/
// todo 取消注释开启 ES须先配置 ES
//@Document(indexName = "post")
@Data
public class PostEsDTO implements Serializable {
private static final String DATE_TIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
/**
* id
*/
@Id
private Long id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 标签列表
*/
private List<String> tags;
/**
* 点赞数
*/
private Integer thumbNum;
/**
* 收藏数
*/
private Integer favourNum;
/**
* 创建用户 id
*/
private Long userId;
/**
* 创建时间
*/
@Field(index = false, store = true, type = FieldType.Date, format = {}, pattern = DATE_TIME_PATTERN)
private Date createTime;
/**
* 更新时间
*/
@Field(index = false, store = true, type = FieldType.Date, format = {}, pattern = DATE_TIME_PATTERN)
private Date updateTime;
/**
* 是否删除
*/
private Integer isDelete;
private static final long serialVersionUID = 1L;
/**
* 对象转包装类
*
* @param post
* @return
*/
public static PostEsDTO objToDto(Post post) {
if (post == null) {
return null;
}
PostEsDTO postEsDTO = new PostEsDTO();
BeanUtils.copyProperties(post, postEsDTO);
String tagsStr = post.getTags();
if (StringUtils.isNotBlank(tagsStr)) {
postEsDTO.setTags(JSONUtil.toList(tagsStr, String.class));
}
return postEsDTO;
}
/**
* 包装类转对象
*
* @param postEsDTO
* @return
*/
public static Post dtoToObj(PostEsDTO postEsDTO) {
if (postEsDTO == null) {
return null;
}
Post post = new Post();
BeanUtils.copyProperties(postEsDTO, post);
List<String> tagList = postEsDTO.getTags();
if (CollUtil.isNotEmpty(tagList)) {
post.setTags(JSONUtil.toJsonStr(tagList));
}
return post;
}
}

View File

@@ -0,0 +1,65 @@
package com.yupi.springbootinit.model.dto.post;
import com.yupi.springbootinit.common.PageRequest;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 查询请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class PostQueryRequest extends PageRequest implements Serializable {
/**
* id
*/
private Long id;
/**
* id
*/
private Long notId;
/**
* 搜索词
*/
private String searchText;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 标签列表
*/
private List<String> tags;
/**
* 至少有一个标签
*/
private List<String> orTags;
/**
* 创建用户 id
*/
private Long userId;
/**
* 收藏用户 id
*/
private Long favourUserId;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,37 @@
package com.yupi.springbootinit.model.dto.post;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* 更新请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class PostUpdateRequest implements Serializable {
/**
* id
*/
private Long id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 标签列表
*/
private List<String> tags;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,21 @@
package com.yupi.springbootinit.model.dto.postfavour;
import java.io.Serializable;
import lombok.Data;
/**
* 帖子收藏 / 取消收藏请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class PostFavourAddRequest implements Serializable {
/**
* 帖子 id
*/
private Long postId;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,30 @@
package com.yupi.springbootinit.model.dto.postfavour;
import com.yupi.springbootinit.common.PageRequest;
import com.yupi.springbootinit.model.dto.post.PostQueryRequest;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 帖子收藏查询请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class PostFavourQueryRequest extends PageRequest implements Serializable {
/**
* 帖子查询请求
*/
private PostQueryRequest postQueryRequest;
/**
* 用户 id
*/
private Long userId;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,21 @@
package com.yupi.springbootinit.model.dto.postthumb;
import java.io.Serializable;
import lombok.Data;
/**
* 帖子点赞请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class PostThumbAddRequest implements Serializable {
/**
* 帖子 id
*/
private Long postId;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,36 @@
package com.yupi.springbootinit.model.dto.user;
import java.io.Serializable;
import lombok.Data;
/**
* 用户创建请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UserAddRequest implements Serializable {
/**
* 用户昵称
*/
private String userName;
/**
* 账号
*/
private String userAccount;
/**
* 用户头像
*/
private String userAvatar;
/**
* 用户角色: user, admin
*/
private String userRole;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,20 @@
package com.yupi.springbootinit.model.dto.user;
import java.io.Serializable;
import lombok.Data;
/**
* 用户登录请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UserLoginRequest implements Serializable {
private static final long serialVersionUID = 3191241716373120793L;
private String userAccount;
private String userPassword;
}

View File

@@ -0,0 +1,48 @@
package com.yupi.springbootinit.model.dto.user;
import com.yupi.springbootinit.common.PageRequest;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 用户查询请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class UserQueryRequest extends PageRequest implements Serializable {
/**
* id
*/
private Long id;
/**
* 开放平台id
*/
private String unionId;
/**
* 公众号openId
*/
private String mpOpenId;
/**
* 用户昵称
*/
private String userName;
/**
* 简介
*/
private String userProfile;
/**
* 用户角色user/admin/ban
*/
private String userRole;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,22 @@
package com.yupi.springbootinit.model.dto.user;
import java.io.Serializable;
import lombok.Data;
/**
* 用户注册请求体
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UserRegisterRequest implements Serializable {
private static final long serialVersionUID = 3191241716373120793L;
private String userAccount;
private String userPassword;
private String checkPassword;
}

View File

@@ -0,0 +1,31 @@
package com.yupi.springbootinit.model.dto.user;
import java.io.Serializable;
import lombok.Data;
/**
* 用户更新个人信息请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UserUpdateMyRequest implements Serializable {
/**
* 用户昵称
*/
private String userName;
/**
* 用户头像
*/
private String userAvatar;
/**
* 简介
*/
private String userProfile;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,40 @@
package com.yupi.springbootinit.model.dto.user;
import java.io.Serializable;
import lombok.Data;
/**
* 用户更新请求
*
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
* @from <a href="https://yupi.icu">编程导航知识星球</a>
*/
@Data
public class UserUpdateRequest implements Serializable {
/**
* id
*/
private Long id;
/**
* 用户昵称
*/
private String userName;
/**
* 用户头像
*/
private String userAvatar;
/**
* 简介
*/
private String userProfile;
/**
* 用户角色user/admin/ban
*/
private String userRole;
private static final long serialVersionUID = 1L;
}