Commit 6d214c43 authored by 刘基明's avatar 刘基明

sql字段优化

parent f2b5a80c
...@@ -8,7 +8,7 @@ import com.tanpu.community.api.beans.qo.ThemeQo; ...@@ -8,7 +8,7 @@ import com.tanpu.community.api.beans.qo.ThemeQo;
import com.tanpu.community.api.beans.req.CreateCommentReq; import com.tanpu.community.api.beans.req.CreateCommentReq;
import com.tanpu.community.api.beans.req.CreateThemeReq; import com.tanpu.community.api.beans.req.CreateThemeReq;
import com.tanpu.community.manager.ThemeManager; import com.tanpu.community.manager.ThemeManager;
import com.tanpu.community.service.FansRelService; import com.tanpu.community.service.FollowRelService;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,7 +26,7 @@ public class ThemeController { ...@@ -26,7 +26,7 @@ public class ThemeController {
private ThemeManager themeManager; private ThemeManager themeManager;
@Autowired @Autowired
private FansRelService fansRelService; private FollowRelService followRelService;
@ApiOperation("发表主题") @ApiOperation("发表主题")
@PostMapping(value = "/publish") @PostMapping(value = "/publish")
......
...@@ -19,15 +19,15 @@ public class CodeAutoGenerator { ...@@ -19,15 +19,15 @@ public class CodeAutoGenerator {
String currentPath = System.getProperty("user.dir"); String currentPath = System.getProperty("user.dir");
String codeBaseHome = "/community-service/src/main/java"; String codeBaseHome = "/community-service/src/main/java";
String author = "xudong"; String author = "xudong";
String mysqlUserName = "tamp_admin"; String mysqlUserName = "dev";
String mysqlPassword = "@imeng123"; String mysqlPassword = "qimeng123";
String jdbcUrl = "jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community"; String jdbcUrl = "jdbc:mysql://47.101.189.151:31931/tamp_community";
String[] tables = new String[]{"home_page"}; // String[] tables = new String[]{"follow_rel"};
// String[] tables = new String[]{"visit_summary", "black_list","collection","comment","fans_rel","file_record","home_page","theme","topic"}; String[] tables = new String[]{"visit_summary", "black_list","collection","comment","follow_rel","file_record","home_page","theme","topic","theme_attachment"};
String basePackage = "com.tanpu.community"; String basePackage = "com.tanpu.community";
String mapperPackage = "dao.mapper.community"; String mapperPackage = "dao.mapper.community";
String entityPackage = "dao.entity.community"; String entityPackage = "dao.entity.community";
String xmlPath = "D:\\code\\backend\\tanpu-community\\community-service\\src\\main\\resources\\mapper\\user"; String xmlPath = "D:\\IdeaProjects\\tanpu-community\\community-service\\src\\main\\resources\\mapper\\community";
AutoGenerator autoGenerator = new AutoGenerator(); AutoGenerator autoGenerator = new AutoGenerator();
//全局配置 //全局配置
GlobalConfig gc = new GlobalConfig(); GlobalConfig gc = new GlobalConfig();
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,24 +18,25 @@ import java.time.LocalDateTime; ...@@ -16,24 +18,25 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
@TableName("black_list")
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("black_list") @NoArgsConstructor
@ApiModel(value="BlackListEntity对象", description="黑名单") @ApiModel(value="BlackListEntity对象", description="黑名单")
public class BlackListEntity implements Serializable { public class BlackListEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "屏蔽发起人") @ApiModelProperty(value = "屏蔽发起人")
private String blocker; private String blocker;
@ApiModelProperty(value = "屏蔽类型") @ApiModelProperty(value = "屏蔽类型,1:用户,2:内容")
private Integer blockedType; private Integer blockedType;
@ApiModelProperty(value = "被屏蔽的") @ApiModelProperty(value = "被屏蔽的")
...@@ -43,18 +46,16 @@ public class BlackListEntity implements Serializable { ...@@ -43,18 +46,16 @@ public class BlackListEntity implements Serializable {
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
...@@ -98,14 +99,6 @@ public class BlackListEntity implements Serializable { ...@@ -98,14 +99,6 @@ public class BlackListEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
...@@ -131,7 +124,6 @@ public class BlackListEntity implements Serializable { ...@@ -131,7 +124,6 @@ public class BlackListEntity implements Serializable {
", blockedId=" + blockedId + ", blockedId=" + blockedId +
", createBy=" + createBy + ", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
...@@ -16,12 +16,12 @@ import java.time.LocalDateTime; ...@@ -16,12 +16,12 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
@TableName("collection")
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("collection") @NoArgsConstructor
@ApiModel(value="CollectionEntity对象", description="收藏/点赞") @ApiModel(value="CollectionEntity对象", description="收藏/点赞")
public class CollectionEntity implements Serializable { public class CollectionEntity implements Serializable {
...@@ -30,20 +30,22 @@ public class CollectionEntity implements Serializable { ...@@ -30,20 +30,22 @@ public class CollectionEntity implements Serializable {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; private String id;
@ApiModelProperty(value = "类型") @ApiModelProperty(value = "类型 1:点赞,2:收藏")
private Integer collectionType; private Integer collectionType;
@ApiModelProperty(value = "作者id") @ApiModelProperty(value = "用户id")
private String authorId; private String userId;
@ApiModelProperty(value = "评论的目标id") @ApiModelProperty(value = "目标id")
private String targetId; private String targetId;
private String createBy; @ApiModelProperty(value = "收藏时间")
private LocalDateTime collectionTime;
private LocalDateTime createTime; @ApiModelProperty(value = "取消收藏时间")
private LocalDateTime uncollectionTime;
private String updateBy; private LocalDateTime createTime;
private LocalDateTime updateTime; private LocalDateTime updateTime;
...@@ -66,12 +68,12 @@ public class CollectionEntity implements Serializable { ...@@ -66,12 +68,12 @@ public class CollectionEntity implements Serializable {
this.collectionType = collectionType; this.collectionType = collectionType;
} }
public String getAuthorId() { public String getUserId() {
return authorId; return userId;
} }
public void setAuthorId(String authorId) { public void setUserId(String userId) {
this.authorId = authorId; this.userId = userId;
} }
public String getTargetId() { public String getTargetId() {
...@@ -82,28 +84,28 @@ public class CollectionEntity implements Serializable { ...@@ -82,28 +84,28 @@ public class CollectionEntity implements Serializable {
this.targetId = targetId; this.targetId = targetId;
} }
public String getCreateBy() { public LocalDateTime getCollectionTime() {
return createBy; return collectionTime;
} }
public void setCreateBy(String createBy) { public void setCollectionTime(LocalDateTime collectionTime) {
this.createBy = createBy; this.collectionTime = collectionTime;
} }
public LocalDateTime getCreateTime() { public LocalDateTime getUncollectionTime() {
return createTime; return uncollectionTime;
} }
public void setCreateTime(LocalDateTime createTime) { public void setUncollectionTime(LocalDateTime uncollectionTime) {
this.createTime = createTime; this.uncollectionTime = uncollectionTime;
} }
public String getUpdateBy() { public LocalDateTime getCreateTime() {
return updateBy; return createTime;
} }
public void setUpdateBy(String updateBy) { public void setCreateTime(LocalDateTime createTime) {
this.updateBy = updateBy; this.createTime = createTime;
} }
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
...@@ -127,11 +129,11 @@ public class CollectionEntity implements Serializable { ...@@ -127,11 +129,11 @@ public class CollectionEntity implements Serializable {
return "CollectionEntity{" + return "CollectionEntity{" +
"id=" + id + "id=" + id +
", collectionType=" + collectionType + ", collectionType=" + collectionType +
", authorId=" + authorId + ", userId=" + userId +
", targetId=" + targetId + ", targetId=" + targetId +
", createBy=" + createBy + ", collectionTime=" + collectionTime +
", uncollectionTime=" + uncollectionTime +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,19 +18,23 @@ import java.time.LocalDateTime; ...@@ -16,19 +18,23 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
@TableName("comment")
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("comment") @NoArgsConstructor
@ApiModel(value="CommentEntity对象", description="评论") @ApiModel(value="CommentEntity对象", description="评论")
public class CommentEntity implements Serializable { public class CommentEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "uuid")
private String commentId;
@ApiModelProperty(value = "类型") @ApiModelProperty(value = "类型")
private Integer commentType; private Integer commentType;
...@@ -39,31 +45,41 @@ public class CommentEntity implements Serializable { ...@@ -39,31 +45,41 @@ public class CommentEntity implements Serializable {
@ApiModelProperty(value = "作者id") @ApiModelProperty(value = "作者id")
private String authorId; private String authorId;
@ApiModelProperty(value = "评论的目标id") @ApiModelProperty(value = "主题id")
private String targetId; private String themeId;
@ApiModelProperty(value = "一级评论id")
private String parentId;
@ApiModelProperty(value = "回复评论id")
private String replyId;
@ApiModelProperty(value = "是否屏蔽") @ApiModelProperty(value = "是否屏蔽")
private Integer isBlock; private Integer isBlock;
private String createBy;
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getCommentId() {
return commentId;
}
public void setCommentId(String commentId) {
this.commentId = commentId;
}
public Integer getCommentType() { public Integer getCommentType() {
return commentType; return commentType;
} }
...@@ -88,44 +104,44 @@ public class CommentEntity implements Serializable { ...@@ -88,44 +104,44 @@ public class CommentEntity implements Serializable {
this.authorId = authorId; this.authorId = authorId;
} }
public String getTargetId() { public String getThemeId() {
return targetId; return themeId;
} }
public void setTargetId(String targetId) { public void setThemeId(String themeId) {
this.targetId = targetId; this.themeId = themeId;
} }
public Integer getIsBlock() { public String getParentId() {
return isBlock; return parentId;
} }
public void setIsBlock(Integer isBlock) { public void setParentId(String parentId) {
this.isBlock = isBlock; this.parentId = parentId;
} }
public String getCreateBy() { public String getReplyId() {
return createBy; return replyId;
} }
public void setCreateBy(String createBy) { public void setReplyId(String replyId) {
this.createBy = createBy; this.replyId = replyId;
} }
public LocalDateTime getCreateTime() { public Integer getIsBlock() {
return createTime; return isBlock;
} }
public void setCreateTime(LocalDateTime createTime) { public void setIsBlock(Integer isBlock) {
this.createTime = createTime; this.isBlock = isBlock;
} }
public String getUpdateBy() { public LocalDateTime getCreateTime() {
return updateBy; return createTime;
} }
public void setUpdateBy(String updateBy) { public void setCreateTime(LocalDateTime createTime) {
this.updateBy = updateBy; this.createTime = createTime;
} }
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
...@@ -148,14 +164,15 @@ public class CommentEntity implements Serializable { ...@@ -148,14 +164,15 @@ public class CommentEntity implements Serializable {
public String toString() { public String toString() {
return "CommentEntity{" + return "CommentEntity{" +
"id=" + id + "id=" + id +
", commentId=" + commentId +
", commentType=" + commentType + ", commentType=" + commentType +
", content=" + content + ", content=" + content +
", authorId=" + authorId + ", authorId=" + authorId +
", targetId=" + targetId + ", themeId=" + themeId +
", parentId=" + parentId +
", replyId=" + replyId +
", isBlock=" + isBlock + ", isBlock=" + isBlock +
", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 文件 * 上传文件
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-17 * @since 2021-07-07
*/ */
@TableName("file_record") @TableName("file_record")
@ApiModel(value="FileRecordEntity对象", description="文件") @Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="FileRecordEntity对象", description="上传文件")
public class FileRecordEntity implements Serializable { public class FileRecordEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "UUID")
private String fileId;
@ApiModelProperty(value = "类型:1:图片")
private Integer fileType;
@ApiModelProperty(value = "文件名称") @ApiModelProperty(value = "文件名称")
private String originalName; private String fileName;
@ApiModelProperty(value = "逻辑url") @ApiModelProperty(value = "阿里云key")
private String logicKey; private String fileOssKey;
@ApiModelProperty(value = "预览url") @ApiModelProperty(value = "预览url")
private String previewUrl; private String previewUrl;
private String presignedUrl;
@ApiModelProperty(value = "关联的内容类型")
private Integer relType;
@ApiModelProperty(value = "关联的内容ID")
private String relId;
private String createBy;
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getOriginalName() { public String getFileId() {
return originalName; return fileId;
}
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
public String getLogicKey() {
return logicKey;
} }
public void setLogicKey(String logicKey) { public void setFileId(String fileId) {
this.logicKey = logicKey; this.fileId = fileId;
} }
public String getPreviewUrl() { public Integer getFileType() {
return previewUrl; return fileType;
}
public void setPreviewUrl(String previewUrl) {
this.previewUrl = previewUrl;
}
public String getPresignedUrl() {
return presignedUrl;
} }
public void setPresignedUrl(String presignedUrl) { public void setFileType(Integer fileType) {
this.presignedUrl = presignedUrl; this.fileType = fileType;
} }
public Integer getRelType() { public String getFileName() {
return relType; return fileName;
} }
public void setRelType(Integer relType) { public void setFileName(String fileName) {
this.relType = relType; this.fileName = fileName;
} }
public String getRelId() { public String getFileOssKey() {
return relId; return fileOssKey;
} }
public void setRelId(String relId) { public void setFileOssKey(String fileOssKey) {
this.relId = relId; this.fileOssKey = fileOssKey;
} }
public String getCreateBy() { public String getPreviewUrl() {
return createBy; return previewUrl;
} }
public void setCreateBy(String createBy) { public void setPreviewUrl(String previewUrl) {
this.createBy = createBy; this.previewUrl = previewUrl;
} }
public LocalDateTime getCreateTime() { public LocalDateTime getCreateTime() {
...@@ -123,14 +111,6 @@ public class FileRecordEntity implements Serializable { ...@@ -123,14 +111,6 @@ public class FileRecordEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
...@@ -151,15 +131,12 @@ public class FileRecordEntity implements Serializable { ...@@ -151,15 +131,12 @@ public class FileRecordEntity implements Serializable {
public String toString() { public String toString() {
return "FileRecordEntity{" + return "FileRecordEntity{" +
"id=" + id + "id=" + id +
", originalName=" + originalName + ", fileId=" + fileId +
", logicKey=" + logicKey + ", fileType=" + fileType +
", fileName=" + fileName +
", fileOssKey=" + fileOssKey +
", previewUrl=" + previewUrl + ", previewUrl=" + previewUrl +
", presignedUrl=" + presignedUrl +
", relType=" + relType +
", relId=" + relId +
", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
...@@ -12,48 +18,54 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -12,48 +18,54 @@ import io.swagger.annotations.ApiModelProperty;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
@TableName("fans_rel") @TableName("follow_rel")
@ApiModel(value="FansRelEntity对象", description="粉丝关系") @Builder
public class FansRelEntity implements Serializable { @AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="FollowRelEntity对象", description="粉丝关系")
public class FollowRelEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "被关注的人id") @ApiModelProperty(value = "被关注的人id")
private String idolId; private String followId;
@ApiModelProperty(value = "粉丝id") @ApiModelProperty(value = "粉丝id")
private String followerId; private String followerId;
private String createBy; @ApiModelProperty(value = "关注时间")
private LocalDateTime followTime;
private LocalDateTime createTime; @ApiModelProperty(value = "取消关注时间")
private LocalDateTime unfollowTime;
private String updateBy; private LocalDateTime createTime;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getIdolId() { public String getFollowId() {
return idolId; return followId;
} }
public void setIdolId(String idolId) { public void setFollowId(String followId) {
this.idolId = idolId; this.followId = followId;
} }
public String getFollowerId() { public String getFollowerId() {
...@@ -64,28 +76,28 @@ public class FansRelEntity implements Serializable { ...@@ -64,28 +76,28 @@ public class FansRelEntity implements Serializable {
this.followerId = followerId; this.followerId = followerId;
} }
public String getCreateBy() { public LocalDateTime getFollowTime() {
return createBy; return followTime;
} }
public void setCreateBy(String createBy) { public void setFollowTime(LocalDateTime followTime) {
this.createBy = createBy; this.followTime = followTime;
} }
public LocalDateTime getCreateTime() { public LocalDateTime getUnfollowTime() {
return createTime; return unfollowTime;
} }
public void setCreateTime(LocalDateTime createTime) { public void setUnfollowTime(LocalDateTime unfollowTime) {
this.createTime = createTime; this.unfollowTime = unfollowTime;
} }
public String getUpdateBy() { public LocalDateTime getCreateTime() {
return updateBy; return createTime;
} }
public void setUpdateBy(String updateBy) { public void setCreateTime(LocalDateTime createTime) {
this.updateBy = updateBy; this.createTime = createTime;
} }
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
...@@ -106,13 +118,13 @@ public class FansRelEntity implements Serializable { ...@@ -106,13 +118,13 @@ public class FansRelEntity implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "FansRelEntity{" + return "FollowRelEntity{" +
"id=" + id + "id=" + id +
", idolId=" + idolId + ", followId=" + followId +
", followerId=" + followerId + ", followerId=" + followerId +
", createBy=" + createBy + ", followTime=" + followTime +
", unfollowTime=" + unfollowTime +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,19 +18,20 @@ import java.time.LocalDateTime; ...@@ -16,19 +18,20 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-29 * @since 2021-07-07
*/ */
@TableName("home_page")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@TableName("home_page")
@ApiModel(value="HomePageEntity对象", description="个人主页") @ApiModel(value="HomePageEntity对象", description="个人主页")
public class HomePageEntity implements Serializable { public class HomePageEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String userId; private String userId;
...@@ -48,22 +51,18 @@ public class HomePageEntity implements Serializable { ...@@ -48,22 +51,18 @@ public class HomePageEntity implements Serializable {
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "地址")
private String location; private String location;
private String createBy;
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
...@@ -115,14 +114,6 @@ public class HomePageEntity implements Serializable { ...@@ -115,14 +114,6 @@ public class HomePageEntity implements Serializable {
this.location = location; this.location = location;
} }
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() { public LocalDateTime getCreateTime() {
return createTime; return createTime;
} }
...@@ -131,14 +122,6 @@ public class HomePageEntity implements Serializable { ...@@ -131,14 +122,6 @@ public class HomePageEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
...@@ -165,9 +148,7 @@ public class HomePageEntity implements Serializable { ...@@ -165,9 +148,7 @@ public class HomePageEntity implements Serializable {
", introduction=" + introduction + ", introduction=" + introduction +
", sex=" + sex + ", sex=" + sex +
", location=" + location + ", location=" + location +
", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
...@@ -16,12 +16,12 @@ import java.time.LocalDateTime; ...@@ -16,12 +16,12 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-28 * @since 2021-07-07
*/ */
@TableName("theme_attachment")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@TableName("theme_attachment")
@ApiModel(value="ThemeAttachmentEntity对象", description="主题附件") @ApiModel(value="ThemeAttachmentEntity对象", description="主题附件")
public class ThemeAttachmentEntity implements Serializable { public class ThemeAttachmentEntity implements Serializable {
...@@ -33,11 +33,11 @@ public class ThemeAttachmentEntity implements Serializable { ...@@ -33,11 +33,11 @@ public class ThemeAttachmentEntity implements Serializable {
@ApiModelProperty(value = "主题ID") @ApiModelProperty(value = "主题ID")
private String themeId; private String themeId;
@ApiModelProperty(value = "附件类型") @ApiModelProperty(value = "附件类型:1:产品 2:直播 3:短视频 4:课程 5图片")
private Integer attachType; private Integer attachType;
@ApiModelProperty(value = "附件对应的ID") @ApiModelProperty(value = "附件对应的ID")
private String attchId; private String attachId;
private String createBy; private String createBy;
...@@ -74,12 +74,12 @@ public class ThemeAttachmentEntity implements Serializable { ...@@ -74,12 +74,12 @@ public class ThemeAttachmentEntity implements Serializable {
this.attachType = attachType; this.attachType = attachType;
} }
public String getAttchId() { public String getAttachId() {
return attchId; return attachId;
} }
public void setAttchId(String attchId) { public void setAttachId(String attachId) {
this.attchId = attchId; this.attachId = attachId;
} }
public String getCreateBy() { public String getCreateBy() {
...@@ -128,7 +128,7 @@ public class ThemeAttachmentEntity implements Serializable { ...@@ -128,7 +128,7 @@ public class ThemeAttachmentEntity implements Serializable {
"id=" + id + "id=" + id +
", themeId=" + themeId + ", themeId=" + themeId +
", attachType=" + attachType + ", attachType=" + attachType +
", attchId=" + attchId + ", attachId=" + attachId +
", createBy=" + createBy + ", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy + ", updateBy=" + updateBy +
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,19 +18,23 @@ import java.time.LocalDateTime; ...@@ -16,19 +18,23 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-28 * @since 2021-07-07
*/ */
@TableName("theme")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@TableName("theme")
@ApiModel(value="ThemeEntity对象", description="主题内容") @ApiModel(value="ThemeEntity对象", description="主题内容")
public class ThemeEntity implements Serializable { public class ThemeEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "UUID")
private String themeId;
@ApiModelProperty(value = "标题") @ApiModelProperty(value = "标题")
private String title; private String title;
...@@ -39,6 +45,12 @@ public class ThemeEntity implements Serializable { ...@@ -39,6 +45,12 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty(value = "文本内容") @ApiModelProperty(value = "文本内容")
private String content; private String content;
@ApiModelProperty(value = "附件类型")
private Integer attachType;
@ApiModelProperty(value = "附件内容")
private String attachment;
@ApiModelProperty(value = "作者id") @ApiModelProperty(value = "作者id")
private String authorId; private String authorId;
...@@ -48,25 +60,29 @@ public class ThemeEntity implements Serializable { ...@@ -48,25 +60,29 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty(value = "所属的话题") @ApiModelProperty(value = "所属的话题")
private String topicId; private String topicId;
private String createBy;
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getThemeId() {
return themeId;
}
public void setThemeId(String themeId) {
this.themeId = themeId;
}
public String getTitle() { public String getTitle() {
return title; return title;
} }
...@@ -91,6 +107,22 @@ public class ThemeEntity implements Serializable { ...@@ -91,6 +107,22 @@ public class ThemeEntity implements Serializable {
this.content = content; this.content = content;
} }
public Integer getAttachType() {
return attachType;
}
public void setAttachType(Integer attachType) {
this.attachType = attachType;
}
public String getAttachment() {
return attachment;
}
public void setAttachment(String attachment) {
this.attachment = attachment;
}
public String getAuthorId() { public String getAuthorId() {
return authorId; return authorId;
} }
...@@ -115,14 +147,6 @@ public class ThemeEntity implements Serializable { ...@@ -115,14 +147,6 @@ public class ThemeEntity implements Serializable {
this.topicId = topicId; this.topicId = topicId;
} }
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() { public LocalDateTime getCreateTime() {
return createTime; return createTime;
} }
...@@ -131,14 +155,6 @@ public class ThemeEntity implements Serializable { ...@@ -131,14 +155,6 @@ public class ThemeEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
...@@ -159,15 +175,16 @@ public class ThemeEntity implements Serializable { ...@@ -159,15 +175,16 @@ public class ThemeEntity implements Serializable {
public String toString() { public String toString() {
return "ThemeEntity{" + return "ThemeEntity{" +
"id=" + id + "id=" + id +
", themeId=" + themeId +
", title=" + title + ", title=" + title +
", themeType=" + themeType + ", themeType=" + themeType +
", content=" + content + ", content=" + content +
", attachType=" + attachType +
", attachment=" + attachment +
", authorId=" + authorId + ", authorId=" + authorId +
", formerThemeId=" + formerThemeId + ", formerThemeId=" + formerThemeId +
", topicId=" + topicId + ", topicId=" + topicId +
", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -16,19 +18,23 @@ import java.time.LocalDateTime; ...@@ -16,19 +18,23 @@ import java.time.LocalDateTime;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-18 * @since 2021-07-07
*/ */
@TableName("topic")
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@TableName("topic") @NoArgsConstructor
@ApiModel(value="TopicEntity对象", description="话题") @ApiModel(value="TopicEntity对象", description="话题")
public class TopicEntity implements Serializable { public class TopicEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; @TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "uuid")
private String topicId;
@ApiModelProperty(value = "话题名称") @ApiModelProperty(value = "话题名称")
private String topicTitle; private String topicTitle;
...@@ -42,25 +48,29 @@ public class TopicEntity implements Serializable { ...@@ -42,25 +48,29 @@ public class TopicEntity implements Serializable {
@ApiModelProperty(value = "浏览量调整") @ApiModelProperty(value = "浏览量调整")
private Long viewAmountModify; private Long viewAmountModify;
private String createBy;
private LocalDateTime createTime; private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Integer getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Integer id) {
this.id = id; this.id = id;
} }
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId;
}
public String getTopicTitle() { public String getTopicTitle() {
return topicTitle; return topicTitle;
} }
...@@ -93,14 +103,6 @@ public class TopicEntity implements Serializable { ...@@ -93,14 +103,6 @@ public class TopicEntity implements Serializable {
this.viewAmountModify = viewAmountModify; this.viewAmountModify = viewAmountModify;
} }
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() { public LocalDateTime getCreateTime() {
return createTime; return createTime;
} }
...@@ -109,14 +111,6 @@ public class TopicEntity implements Serializable { ...@@ -109,14 +111,6 @@ public class TopicEntity implements Serializable {
this.createTime = createTime; this.createTime = createTime;
} }
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() { public LocalDateTime getUpdateTime() {
return updateTime; return updateTime;
} }
...@@ -137,13 +131,12 @@ public class TopicEntity implements Serializable { ...@@ -137,13 +131,12 @@ public class TopicEntity implements Serializable {
public String toString() { public String toString() {
return "TopicEntity{" + return "TopicEntity{" +
"id=" + id + "id=" + id +
", topicId=" + topicId +
", topicTitle=" + topicTitle + ", topicTitle=" + topicTitle +
", isTop=" + isTop + ", isTop=" + isTop +
", isConceal=" + isConceal + ", isConceal=" + isConceal +
", viewAmountModify=" + viewAmountModify + ", viewAmountModify=" + viewAmountModify +
", createBy=" + createBy +
", createTime=" + createTime + ", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
"}"; "}";
......
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
...@@ -12,9 +16,12 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -12,9 +16,12 @@ import io.swagger.annotations.ApiModelProperty;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-15 * @since 2021-07-07
*/ */
@TableName("visit_summary") @TableName("visit_summary")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="VisitSummaryEntity对象", description="浏览记录") @ApiModel(value="VisitSummaryEntity对象", description="浏览记录")
public class VisitSummaryEntity implements Serializable { public class VisitSummaryEntity implements Serializable {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-16 * @since 2021-07-07
*/ */
public interface BlackListMapper extends BaseMapper<BlackListEntity> { public interface BlackListMapper extends BaseMapper<BlackListEntity> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
public interface CollectionMapper extends BaseMapper<CollectionEntity> { public interface CollectionMapper extends BaseMapper<CollectionEntity> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
public interface CommentMapper extends BaseMapper<CommentEntity> { public interface CommentMapper extends BaseMapper<CommentEntity> {
......
...@@ -5,11 +5,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,11 +5,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* <p> * <p>
* 文件 Mapper 接口 * 上传文件 Mapper 接口
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-17 * @since 2021-07-07
*/ */
public interface FileRecordMapper extends BaseMapper<FileRecordEntity> { public interface FileRecordMapper extends BaseMapper<FileRecordEntity> {
......
package com.tanpu.community.dao.mapper.community; package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.FansRelEntity; import com.tanpu.community.dao.entity.community.FollowRelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
...@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
public interface FansRelMapper extends BaseMapper<FansRelEntity> { public interface FollowRelMapper extends BaseMapper<FollowRelEntity> {
} }
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
public interface HomePageMapper extends BaseMapper<HomePageEntity> { public interface HomePageMapper extends BaseMapper<HomePageEntity> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-28 * @since 2021-07-07
*/ */
public interface ThemeAttachmentMapper extends BaseMapper<ThemeAttachmentEntity> { public interface ThemeAttachmentMapper extends BaseMapper<ThemeAttachmentEntity> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-10 * @since 2021-07-07
*/ */
public interface ThemeMapper extends BaseMapper<ThemeEntity> { public interface ThemeMapper extends BaseMapper<ThemeEntity> {
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-18 * @since 2021-07-07
*/ */
public interface TopicMapper extends BaseMapper<TopicEntity> { public interface TopicMapper extends BaseMapper<TopicEntity> {
......
...@@ -2,8 +2,6 @@ package com.tanpu.community.dao.mapper.community; ...@@ -2,8 +2,6 @@ package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.VisitSummaryEntity; import com.tanpu.community.dao.entity.community.VisitSummaryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/** /**
* <p> * <p>
...@@ -11,10 +9,8 @@ import org.apache.ibatis.annotations.Update; ...@@ -11,10 +9,8 @@ import org.apache.ibatis.annotations.Update;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-06-15 * @since 2021-07-07
*/ */
public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> { public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> {
@Update("update visit_summary set duration=duration+#{dur} where ident=#{ident}")
void updateDurByIdent(@Param("ident") String ident, @Param("dur") Integer dur);
} }
...@@ -3,7 +3,7 @@ package com.tanpu.community.manager; ...@@ -3,7 +3,7 @@ package com.tanpu.community.manager;
import com.tanpu.community.api.beans.qo.FollowQo; import com.tanpu.community.api.beans.qo.FollowQo;
import com.tanpu.community.api.beans.req.HomePageReq; import com.tanpu.community.api.beans.req.HomePageReq;
import com.tanpu.community.dao.entity.community.HomePageEntity; import com.tanpu.community.dao.entity.community.HomePageEntity;
import com.tanpu.community.service.FansRelService; import com.tanpu.community.service.FollowRelService;
import com.tanpu.community.service.HomePageService; import com.tanpu.community.service.HomePageService;
import com.tanpu.community.util.ConvertUtil; import com.tanpu.community.util.ConvertUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -18,7 +18,7 @@ import java.util.stream.Collectors; ...@@ -18,7 +18,7 @@ import java.util.stream.Collectors;
public class HomePageManager { public class HomePageManager {
@Autowired @Autowired
private FansRelService fansRelService; private FollowRelService followRelService;
@Resource @Resource
private HomePageService homePageService; private HomePageService homePageService;
...@@ -43,21 +43,21 @@ public class HomePageManager { ...@@ -43,21 +43,21 @@ public class HomePageManager {
//获取用户的关注列表 //获取用户的关注列表
public List<FollowQo> queryIdolsByFollowerId(String followerId) { public List<FollowQo> queryIdolsByFollowerId(String followerId) {
List<String> idolIds = fansRelService.queryFansByFollowerId(followerId); List<String> idolIds = followRelService.queryFansByFollowerId(followerId);
List<HomePageEntity> list = homePageService.selectListByUserIds(idolIds); List<HomePageEntity> list = homePageService.selectListByUserIds(idolIds);
return list.stream().map(ConvertUtil::homePageEntity2FollowQo).collect(Collectors.toList()); return list.stream().map(ConvertUtil::homePageEntity2FollowQo).collect(Collectors.toList());
} }
//获取用户的粉丝列表 //获取用户的粉丝列表
public List<FollowQo> queryFansByIdolId(String idolId) { public List<FollowQo> queryFansByIdolId(String idolId) {
List<String> fanIds = fansRelService.queryFansByIdolId(idolId); List<String> fanIds = followRelService.queryFansByIdolId(idolId);
List<HomePageEntity> list = homePageService.selectListByUserIds(fanIds); List<HomePageEntity> list = homePageService.selectListByUserIds(fanIds);
return list.stream().map(ConvertUtil::homePageEntity2FollowQo).collect(Collectors.toList()); return list.stream().map(ConvertUtil::homePageEntity2FollowQo).collect(Collectors.toList());
} }
//判断返回列表中的用户是否被当前用户关注 //判断返回列表中的用户是否被当前用户关注
public List<FollowQo> judgeFollowed(List<FollowQo> followQos,String followerId){ public List<FollowQo> judgeFollowed(List<FollowQo> followQos,String followerId){
Set<String> idolSet = fansRelService.queryFansByFollowerId(followerId).stream().collect(Collectors.toSet()); Set<String> idolSet = followRelService.queryFansByFollowerId(followerId).stream().collect(Collectors.toSet());
return followQos.stream().map(o->{ return followQos.stream().map(o->{
if (idolSet.contains(o.getUserId())){ if (idolSet.contains(o.getUserId())){
o.setFollowed(true); o.setFollowed(true);
...@@ -68,6 +68,6 @@ public class HomePageManager { ...@@ -68,6 +68,6 @@ public class HomePageManager {
} }
public void addIdol(String idolId, String followerId) { public void addIdol(String idolId, String followerId) {
fansRelService.addFans(idolId, followerId); followRelService.addFans(idolId, followerId);
} }
} }
...@@ -22,6 +22,7 @@ import com.tanpu.community.feign.vo.ShortVideoBaseInfoResp; ...@@ -22,6 +22,7 @@ import com.tanpu.community.feign.vo.ShortVideoBaseInfoResp;
import com.tanpu.community.feign.zhibo.FeignClientForZhibo; import com.tanpu.community.feign.zhibo.FeignClientForZhibo;
import com.tanpu.community.feign.zhibo.vo.ZhiboDetailVO; import com.tanpu.community.feign.zhibo.vo.ZhiboDetailVO;
import com.tanpu.community.service.*; import com.tanpu.community.service.*;
import com.tanpu.community.service.other.*;
import com.tanpu.community.util.ConvertUtil; import com.tanpu.community.util.ConvertUtil;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -46,7 +47,7 @@ public class ThemeManager { ...@@ -46,7 +47,7 @@ public class ThemeManager {
private CommentService commentService; private CommentService commentService;
@Autowired @Autowired
private FansRelService fansRelService; private FollowRelService followRelService;
@Autowired @Autowired
private BlackListService blackListService; private BlackListService blackListService;
...@@ -84,13 +85,15 @@ public class ThemeManager { ...@@ -84,13 +85,15 @@ public class ThemeManager {
@Autowired @Autowired
private FeignClientForCourse feignClientForCourse; private FeignClientForCourse feignClientForCourse;
public void publishTheme(CreateThemeReq req, String userId) { public void publishTheme(CreateThemeReq req, String userId) {
ThemeEntity themeEntity = new ThemeEntity(); ThemeEntity themeEntity = new ThemeEntity();
BeanUtils.copyProperties(req, themeEntity); BeanUtils.copyProperties(req, themeEntity);
themeEntity.setAuthorId(userId); themeEntity.setAuthorId(userId);
themeService.insertTheme(themeEntity); themeService.insertTheme(themeEntity);
List<ThemeAttachmentEntity> themeAttachments = ConvertUtil.themeReqToAttachmentList(req, themeEntity.getId()); List<ThemeAttachmentEntity> themeAttachments = ConvertUtil.themeReqToAttachmentList(req, themeEntity.getThemeId());
//TODO 敏感词过滤 //TODO 敏感词过滤
themeAttachmentService.insertList(themeAttachments); themeAttachmentService.insertList(themeAttachments);
...@@ -107,7 +110,7 @@ public class ThemeManager { ...@@ -107,7 +110,7 @@ public class ThemeManager {
// 返回关注主题 // 返回关注主题
public List<ThemeQo> selectInterestThemes(String userId) { public List<ThemeQo> selectInterestThemes(String userId) {
List<String> fansList = fansRelService.queryFansByFollowerId(userId); List<String> fansList = followRelService.queryFansByFollowerId(userId);
List<ThemeEntity> themeEntities = themeService.selectByFans(fansList); List<ThemeEntity> themeEntities = themeService.selectByFans(fansList);
List<ThemeQo> themeQos = convertEntityToQo(themeEntities, userId); List<ThemeQo> themeQos = convertEntityToQo(themeEntities, userId);
return themeQos; return themeQos;
...@@ -137,9 +140,8 @@ public class ThemeManager { ...@@ -137,9 +140,8 @@ public class ThemeManager {
// 评论(对主题) // 评论(对主题)
public void comment(CreateCommentReq req, String userId) { public void comment(CreateCommentReq req, String userId) {
CommentEntity commentEntity = CommentEntity.builder() CommentEntity commentEntity = CommentEntity.builder()
.targetId(req.getThemeId()) .themeId(req.getThemeId())
.authorId(userId) .authorId(userId)
.createBy(userId)
.content(req.getComment()) .content(req.getComment())
.commentType(CommentTypeEnum.THEME.getCode()) .commentType(CommentTypeEnum.THEME.getCode())
.build(); .build();
...@@ -155,7 +157,6 @@ public class ThemeManager { ...@@ -155,7 +157,6 @@ public class ThemeManager {
.topicId(req.getTopicId()) .topicId(req.getTopicId())
.formerThemeId(req.getFormerThemeId()) .formerThemeId(req.getFormerThemeId())
.authorId(userId) .authorId(userId)
.createBy(userId)
.themeType(ThemeTypeEnum.DISCUSSION.getCode()) .themeType(ThemeTypeEnum.DISCUSSION.getCode())
.build(); .build();
...@@ -221,14 +222,14 @@ public class ThemeManager { ...@@ -221,14 +222,14 @@ public class ThemeManager {
List<ThemeAttachmentEntity> attachments = themeAttachmentService.selectByThemeId(themeQO.getId()); List<ThemeAttachmentEntity> attachments = themeAttachmentService.selectByThemeId(themeQO.getId());
if (!CollectionUtils.isEmpty(attachments)) { if (!CollectionUtils.isEmpty(attachments)) {
HashMap<String, Object> attachmentQos = new HashMap<>(); HashMap<String, Object> attachmentQos = new HashMap<>();
attachments.forEach(o -> attachmentQos.put(o.getAttchId(), transferAttachment(o, userId))); attachments.forEach(o -> attachmentQos.put(o.getAttachId(), transferAttachment(o, userId)));
themeQO.setAttachment(attachmentQos); themeQO.setAttachment(attachmentQos);
} }
//迄今时间 //迄今时间
themeQO.setUpToNowTime(calUpToNowTime(themeQO.getCreateTime())); themeQO.setUpToNowTime(calUpToNowTime(themeQO.getCreateTime()));
//是否关注作者 //是否关注作者
String authorId = themeQO.getAuthorId(); String authorId = themeQO.getAuthorId();
Set<String> fansSet = new HashSet<>(fansRelService.queryFansByFollowerId(userId)); Set<String> fansSet = new HashSet<>(followRelService.queryFansByFollowerId(userId));
themeQO.setFollow(fansSet.contains(authorId)); themeQO.setFollow(fansSet.contains(authorId));
//用户信息:头像、昵称 //用户信息:头像、昵称
HomePageEntity userEntity = homePageService.selectByUserId(userId); HomePageEntity userEntity = homePageService.selectByUserId(userId);
...@@ -246,7 +247,7 @@ public class ThemeManager { ...@@ -246,7 +247,7 @@ public class ThemeManager {
List<ThemeAttachmentEntity> attachments = themeAttachmentService.selectByThemeId(maintTextQo.getId()); List<ThemeAttachmentEntity> attachments = themeAttachmentService.selectByThemeId(maintTextQo.getId());
if (!CollectionUtils.isEmpty(attachments)) { if (!CollectionUtils.isEmpty(attachments)) {
HashMap<String, Object> attachmentQos = new HashMap<>(); HashMap<String, Object> attachmentQos = new HashMap<>();
attachments.forEach(o -> attachmentQos.put(o.getAttchId(), transferAttachment(o, userId))); attachments.forEach(o -> attachmentQos.put(o.getAttachId(), transferAttachment(o, userId)));
maintTextQo.setAttachment(attachmentQos); maintTextQo.setAttachment(attachmentQos);
} }
//迄今时间 //迄今时间
...@@ -270,7 +271,7 @@ public class ThemeManager { ...@@ -270,7 +271,7 @@ public class ThemeManager {
public Object transferAttachment(ThemeAttachmentEntity themeAttachment, String userId) { public Object transferAttachment(ThemeAttachmentEntity themeAttachment, String userId) {
String attachmentId = themeAttachment.getAttchId(); String attachmentId = themeAttachment.getAttachId();
switch (themeAttachment.getAttachType()) { switch (themeAttachment.getAttachType()) {
//附件类型 1:产品 2:直播 3:短视频 4:课程 //附件类型 1:产品 2:直播 3:短视频 4:课程
//TODO ENTITY 转 DTO //TODO ENTITY 转 DTO
......
...@@ -117,10 +117,10 @@ public class TopicManager { ...@@ -117,10 +117,10 @@ public class TopicManager {
public void refreshRedisCache() { public void refreshRedisCache() {
List<TopicEntity> topicEntities = topicService.queryAll(); List<TopicEntity> topicEntities = topicService.queryAll();
for (TopicEntity topic : topicEntities) { for (TopicEntity topic : topicEntities) {
String topicId = topic.getId(); String topicId = topic.getTopicId();
Long viewAmountModify = topic.getViewAmountModify(); Long viewAmountModify = topic.getViewAmountModify();
List<ThemeEntity> themeEntities = themeService.selectByTopic(topicId); List<ThemeEntity> themeEntities = themeService.selectByTopic(topicId);
List<String> themeIds = themeEntities.stream().map(ThemeEntity::getId).collect(Collectors.toList()); List<String> themeIds = themeEntities.stream().map(ThemeEntity::getThemeId).collect(Collectors.toList());
Long likeAmountByThemeIds = collectionService.getLikeAmountByThemeIds(themeIds); Long likeAmountByThemeIds = collectionService.getLikeAmountByThemeIds(themeIds);
Long bookAmountByThemeIds = collectionService.getBookAmountByThemeIds(themeIds); Long bookAmountByThemeIds = collectionService.getBookAmountByThemeIds(themeIds);
Long commentAmountByThemeIds = commentService.getCommentAmountByThemeIds(themeIds); Long commentAmountByThemeIds = commentService.getCommentAmountByThemeIds(themeIds);
......
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.api.enums.CollectionTypeEnum; import com.tanpu.community.api.enums.CollectionTypeEnum;
import com.tanpu.community.api.enums.DeleteTagEnum; import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.dao.entity.community.CollectionEntity; import com.tanpu.community.dao.entity.community.CollectionEntity;
import com.tanpu.community.dao.mapper.community.CollectionMapper; import com.tanpu.community.dao.mapper.community.CollectionMapper;
import com.tanpu.community.util.ConvertUtil; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@Service @Service
...@@ -16,20 +18,21 @@ public class CollectionService { ...@@ -16,20 +18,21 @@ public class CollectionService {
@Resource @Resource
private CollectionMapper collectionMapper; private CollectionMapper collectionMapper;
// 若不存在则新增,若存在则修改deleteTag // 若不存在则新增,若存在则修改deleteTag
public void addIfNotExist(String themeId, String userId, CollectionTypeEnum type) { public void addIfNotExist(String themeId, String userId, CollectionTypeEnum type) {
// 判断是否存在 // 判断是否删除
CollectionEntity queryCollection = getTargetCollection(themeId, userId, type); CollectionEntity queryCollection = getDeletedTargetCollection(themeId, userId, type);
if (queryCollection != null) { if (queryCollection != null) {
Integer oldDeleteTag = queryCollection.getDeleteTag(); queryCollection.setDeleteTag(DeleteTagEnum.NOT_DELETED.getCode());
queryCollection.setDeleteTag(ConvertUtil.deleteTagShift(oldDeleteTag)); queryCollection.setCollectionTime(LocalDateTime.now());
collectionMapper.updateById(queryCollection); collectionMapper.updateById(queryCollection);
} else { } else {
CollectionEntity entity = CollectionEntity.builder() CollectionEntity entity = CollectionEntity.builder()
.collectionType(type.getCode()) .collectionType(type.getCode())
.authorId(userId) .userId(userId)
.targetId(themeId) .targetId(themeId)
.createBy(userId) .collectionTime(LocalDateTime.now())
.build(); .build();
collectionMapper.insert(entity); collectionMapper.insert(entity);
...@@ -37,12 +40,22 @@ public class CollectionService { ...@@ -37,12 +40,22 @@ public class CollectionService {
} }
//根据用户、主题、类型查询 //根据用户、主题、类型查询未删除对象
public CollectionEntity getTargetCollection(String themeId, String userId, CollectionTypeEnum type) { public CollectionEntity getTargetCollection(String themeId, String userId, CollectionTypeEnum type) {
return collectionMapper.selectOne(new LambdaQueryWrapper<CollectionEntity>() return collectionMapper.selectOne(new LambdaQueryWrapper<CollectionEntity>()
.eq(CollectionEntity::getCollectionType, type.getCode()) .eq(CollectionEntity::getCollectionType, type.getCode())
.eq(CollectionEntity::getAuthorId, userId) .eq(CollectionEntity::getUserId, userId)
.eq(CollectionEntity::getTargetId, themeId)); .eq(CollectionEntity::getTargetId, themeId)
.eq(CollectionEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode()));
}
//根据用户、主题、类型查询已删除对象
public CollectionEntity getDeletedTargetCollection(String themeId, String userId, CollectionTypeEnum type) {
return collectionMapper.selectOne(new LambdaQueryWrapper<CollectionEntity>()
.eq(CollectionEntity::getCollectionType, type.getCode())
.eq(CollectionEntity::getUserId, userId)
.eq(CollectionEntity::getTargetId, themeId)
.eq(CollectionEntity::getDeleteTag,DeleteTagEnum.DELETED.getCode()));
} }
// 根据用户id获取点赞列表 // 根据用户id获取点赞列表
...@@ -96,7 +109,13 @@ public class CollectionService { ...@@ -96,7 +109,13 @@ public class CollectionService {
.size(); .size();
} }
public void delete(String themeId, String userId, CollectionTypeEnum book) { //逻辑删除,修改delete_tag
//TODO public void delete(String themeId, String userId, CollectionTypeEnum type) {
CollectionEntity queryCollection = getTargetCollection(themeId, userId, type);
if (queryCollection != null) {
queryCollection.setDeleteTag(DeleteTagEnum.DELETED.getCode());
queryCollection.setUncollectionTime(LocalDateTime.now());
collectionMapper.updateById(queryCollection);
}
} }
} }
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.api.enums.DeleteTagEnum; import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.api.enums.TopicStatusEnum; import com.tanpu.community.api.enums.TopicStatusEnum;
import com.tanpu.community.dao.entity.community.CommentEntity; import com.tanpu.community.dao.entity.community.CommentEntity;
import com.tanpu.community.dao.mapper.community.CommentMapper; import com.tanpu.community.dao.mapper.community.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -18,7 +20,11 @@ public class CommentService { ...@@ -18,7 +20,11 @@ public class CommentService {
@Resource @Resource
private CommentMapper commentMapper; private CommentMapper commentMapper;
@Autowired
private UuidGenHelper uuidGenHelper;
public void insertComment(CommentEntity commentEntity) { public void insertComment(CommentEntity commentEntity) {
commentEntity.setCommentId(uuidGenHelper.getUuidStr());
commentMapper.insert(commentEntity); commentMapper.insert(commentEntity);
} }
...@@ -30,13 +36,13 @@ public class CommentService { ...@@ -30,13 +36,13 @@ public class CommentService {
//统计主题集合的评论量 //统计主题集合的评论量
public Long getCommentAmountByThemeIds(List<String> themeIds) { public Long getCommentAmountByThemeIds(List<String> themeIds) {
return (long) commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>() return (long) commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getTargetId, themeIds))) .in(CommentEntity::getThemeId, themeIds)))
.size(); .size();
} }
public Set<String> getCommentUserAmount(List<String> themeIds) { public Set<String> getCommentUserAmount(List<String> themeIds) {
return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>() return commentMapper.selectList((new LambdaQueryWrapper<CommentEntity>()
.in(CommentEntity::getTargetId, themeIds))) .in(CommentEntity::getThemeId, themeIds)))
.stream().map(CommentEntity::getAuthorId).collect(Collectors.toSet()); .stream().map(CommentEntity::getAuthorId).collect(Collectors.toSet());
} }
......
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.dao.entity.community.FansRelEntity; import com.tanpu.community.dao.entity.community.FollowRelEntity;
import com.tanpu.community.dao.mapper.community.FansRelMapper; import com.tanpu.community.dao.mapper.community.FollowRelMapper;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -12,29 +12,29 @@ import java.util.stream.Collectors; ...@@ -12,29 +12,29 @@ import java.util.stream.Collectors;
@EnableCaching @EnableCaching
@Service @Service
public class FansRelService { public class FollowRelService {
@Resource @Resource
private FansRelMapper fansRelMapper; private FollowRelMapper followRelMapper;
public List<String> queryFansByFollowerId(String followerId) { public List<String> queryFansByFollowerId(String followerId) {
return fansRelMapper.selectList(new LambdaQueryWrapper<FansRelEntity>() return followRelMapper.selectList(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FansRelEntity::getFollowerId, followerId)) .eq(FollowRelEntity::getFollowerId, followerId))
.stream().map(FansRelEntity::getIdolId).collect(Collectors.toList()); .stream().map(FollowRelEntity::getFollowId).collect(Collectors.toList());
} }
// @Cacheable(value = "tempCache", keyGenerator = "communityKeyGenerator") // @Cacheable(value = "tempCache", keyGenerator = "communityKeyGenerator")
public List<String> queryFansByIdolId(String idolId) { public List<String> queryFansByIdolId(String idolId) {
return fansRelMapper.selectList(new LambdaQueryWrapper<FansRelEntity>() return followRelMapper.selectList(new LambdaQueryWrapper<FollowRelEntity>()
.eq(FansRelEntity::getIdolId, idolId)) .eq(FollowRelEntity::getFollowId, idolId))
.stream().map(FansRelEntity::getFollowerId).collect(Collectors.toList()); .stream().map(FollowRelEntity::getFollowerId).collect(Collectors.toList());
} }
public void addFans(String idolId, String followerId) { public void addFans(String idolId, String followerId) {
FansRelEntity rel = new FansRelEntity(); FollowRelEntity rel = new FollowRelEntity();
rel.setIdolId(idolId); rel.setFollowId(idolId);
rel.setFollowerId(followerId); rel.setFollowerId(followerId);
fansRelMapper.insert(rel); followRelMapper.insert(rel);
} }
} }
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.dao.entity.community.HomePageEntity; import com.tanpu.community.dao.entity.community.HomePageEntity;
import com.tanpu.community.dao.mapper.community.HomePageMapper; import com.tanpu.community.dao.mapper.community.HomePageMapper;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -18,8 +20,6 @@ public class HomePageService { ...@@ -18,8 +20,6 @@ public class HomePageService {
private HomePageMapper homePageMapper; private HomePageMapper homePageMapper;
public HomePageEntity selectByUserId(String userId){ public HomePageEntity selectByUserId(String userId){
return homePageMapper.selectOne(new LambdaQueryWrapper<HomePageEntity>() return homePageMapper.selectOne(new LambdaQueryWrapper<HomePageEntity>()
.eq(HomePageEntity::getUserId,userId)); .eq(HomePageEntity::getUserId,userId));
......
...@@ -2,6 +2,7 @@ package com.tanpu.community.service; ...@@ -2,6 +2,7 @@ package com.tanpu.community.service;
import com.tanpu.common.constant.BizStatus; import com.tanpu.common.constant.BizStatus;
import com.tanpu.common.util.AliyunOSSHelper; import com.tanpu.common.util.AliyunOSSHelper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.api.enums.OssRelType; import com.tanpu.community.api.enums.OssRelType;
import com.tanpu.community.dao.entity.community.FileRecordEntity; import com.tanpu.community.dao.entity.community.FileRecordEntity;
import com.tanpu.community.dao.mapper.community.FileRecordMapper; import com.tanpu.community.dao.mapper.community.FileRecordMapper;
...@@ -35,6 +36,10 @@ public class OSSFileService { ...@@ -35,6 +36,10 @@ public class OSSFileService {
@Resource @Resource
private FileRecordMapper fileRecordMapper; private FileRecordMapper fileRecordMapper;
@Autowired
private UuidGenHelper uuidGenHelper;
@PostConstruct @PostConstruct
public void init() { public void init() {
ossHelper = AliyunOSSHelper.build(endpoint, accessId, accessSK); ossHelper = AliyunOSSHelper.build(endpoint, accessId, accessSK);
...@@ -62,13 +67,12 @@ public class OSSFileService { ...@@ -62,13 +67,12 @@ public class OSSFileService {
ossHelper.writeFile(bucketName, key, data, fileSuffix); ossHelper.writeFile(bucketName, key, data, fileSuffix);
FileRecordEntity record = new FileRecordEntity(); FileRecordEntity record = new FileRecordEntity();
record.setId(id); record.setFileId(uuidGenHelper.getUuidStr());
record.setDeleteTag(BizStatus.DeleteTag.tag_init); record.setDeleteTag(BizStatus.DeleteTag.tag_init);
record.setLogicKey(key); record.setFileOssKey(key);
record.setOriginalName(fileName); record.setFileId(fileName);
record.setPresignedUrl(ossHelper.getPreSignedUrl(bucketName, key)); record.setPreviewUrl(ossHelper.getPreSignedUrl(bucketName, key));
record.setRelType(relType.type); record.setFileType(relType.type);
record.setRelId(relId);
fileRecordMapper.insert(record); fileRecordMapper.insert(record);
......
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.dao.entity.community.ThemeEntity; import com.tanpu.community.dao.entity.community.ThemeEntity;
import com.tanpu.community.dao.mapper.community.ThemeMapper; import com.tanpu.community.dao.mapper.community.ThemeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -16,7 +18,11 @@ public class ThemeService { ...@@ -16,7 +18,11 @@ public class ThemeService {
@Resource @Resource
private ThemeMapper themeMapper; private ThemeMapper themeMapper;
@Autowired
private UuidGenHelper uuidGenHelper;
public void insertTheme(ThemeEntity themeEntity){ public void insertTheme(ThemeEntity themeEntity){
themeEntity.setThemeId(uuidGenHelper.getUuidStr());
themeMapper.insert(themeEntity); themeMapper.insert(themeEntity);
} }
......
...@@ -2,10 +2,12 @@ package com.tanpu.community.service; ...@@ -2,10 +2,12 @@ package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.tanpu.common.uuid.UuidGenHelper;
import com.tanpu.community.api.enums.DeleteTagEnum; import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.api.enums.TopicStatusEnum; import com.tanpu.community.api.enums.TopicStatusEnum;
import com.tanpu.community.dao.entity.community.TopicEntity; import com.tanpu.community.dao.entity.community.TopicEntity;
import com.tanpu.community.dao.mapper.community.TopicMapper; import com.tanpu.community.dao.mapper.community.TopicMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,6 +22,8 @@ public class TopicService { ...@@ -20,6 +22,8 @@ public class TopicService {
@Resource @Resource
private TopicMapper topicMapper; private TopicMapper topicMapper;
@Autowired
private UuidGenHelper uuidGenHelper;
public List<TopicEntity> queryAll() { public List<TopicEntity> queryAll() {
return topicMapper.selectList(new LambdaQueryWrapper<TopicEntity>() return topicMapper.selectList(new LambdaQueryWrapper<TopicEntity>()
...@@ -29,9 +33,8 @@ public class TopicService { ...@@ -29,9 +33,8 @@ public class TopicService {
public void addTopic(String topicTitle, String userId) { public void addTopic(String topicTitle, String userId) {
TopicEntity entity = TopicEntity.builder() TopicEntity entity = TopicEntity.builder()
.topicId(uuidGenHelper.getUuidStr())
.topicTitle(topicTitle) .topicTitle(topicTitle)
.createBy(userId)
.updateBy(userId)
.isTop(TopicStatusEnum.FALSE.getCode()) .isTop(TopicStatusEnum.FALSE.getCode())
.isConceal(TopicStatusEnum.FALSE.getCode()) .isConceal(TopicStatusEnum.FALSE.getCode())
.build(); .build();
......
...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.dao.entity.community.VisitSummaryEntity; import com.tanpu.community.dao.entity.community.VisitSummaryEntity;
import com.tanpu.community.dao.mapper.community.VisitSummaryMapper; import com.tanpu.community.dao.mapper.community.VisitSummaryMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -25,6 +24,6 @@ public class VisitSummaryService { ...@@ -25,6 +24,6 @@ public class VisitSummaryService {
// 更新访问时长 // 更新访问时长
public void updateDurByIdent(String ident, Integer dur) { public void updateDurByIdent(String ident, Integer dur) {
visitSummaryMapper.updateDurByIdent(ident, dur); // visitSummaryMapper.updateDurByIdent(ident, dur);
} }
} }
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.common.exception.BizException; import com.tanpu.common.exception.BizException;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.tanpu.community.dao.entity.user.CurriculumPriceEntity; import com.tanpu.community.dao.entity.user.CurriculumPriceEntity;
import com.tanpu.community.dao.mapper.user.CurriculumPriceMapper; import com.tanpu.community.dao.mapper.user.CurriculumPriceMapper;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.api.enums.CurriculumEnum; import com.tanpu.community.api.enums.CurriculumEnum;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.tanpu.community.dao.entity.user.FinProResEntity; import com.tanpu.community.dao.entity.user.FinProResEntity;
import com.tanpu.community.dao.mapper.user.FinProResMapper; import com.tanpu.community.dao.mapper.user.FinProResMapper;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.api.enums.DeleteTagEnum; import com.tanpu.community.api.enums.DeleteTagEnum;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.dao.entity.user.UserRistRzEntity; import com.tanpu.community.dao.entity.user.UserRistRzEntity;
......
package com.tanpu.community.service; package com.tanpu.community.service.other;
import com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity; import com.tanpu.community.dao.entity.zhibo.ZhiboThemeEntity;
import com.tanpu.community.dao.mapper.zhibo.ZhiboThemeMapper; import com.tanpu.community.dao.mapper.zhibo.ZhiboThemeMapper;
......
...@@ -95,7 +95,7 @@ public class ConvertUtil { ...@@ -95,7 +95,7 @@ public class ConvertUtil {
req.getAttachment().forEach((k, v) -> { req.getAttachment().forEach((k, v) -> {
list.add(ThemeAttachmentEntity.builder() list.add(ThemeAttachmentEntity.builder()
.attachType(Integer.valueOf(k)) .attachType(Integer.valueOf(k))
.attchId(v) .attachId(v)
.themeId(themeId) .themeId(themeId)
.build()); .build());
}); });
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<result column="blocked_id" property="blockedId" /> <result column="blocked_id" property="blockedId" />
<result column="create_by" property="createBy" /> <result column="create_by" property="createBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CollectionEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CollectionEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="collection_type" property="collectionType" /> <result column="collection_type" property="collectionType" />
<result column="author_id" property="authorId" /> <result column="user_id" property="userId" />
<result column="target_id" property="targetId" /> <result column="target_id" property="targetId" />
<result column="create_by" property="createBy" /> <result column="collection_time" property="collectionTime" />
<result column="uncollection_time" property="uncollectionTime" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
...@@ -5,14 +5,15 @@ ...@@ -5,14 +5,15 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CommentEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CommentEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="comment_id" property="commentId" />
<result column="comment_type" property="commentType" /> <result column="comment_type" property="commentType" />
<result column="content" property="content" /> <result column="content" property="content" />
<result column="author_id" property="authorId" /> <result column="author_id" property="authorId" />
<result column="target_id" property="targetId" /> <result column="theme_id" property="themeId" />
<result column="parent_id" property="parentId" />
<result column="reply_id" property="replyId" />
<result column="is_block" property="isBlock" /> <result column="is_block" property="isBlock" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
...@@ -5,15 +5,12 @@ ...@@ -5,15 +5,12 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FileRecordEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FileRecordEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="original_name" property="originalName" /> <result column="file_id" property="fileId" />
<result column="logic_key" property="logicKey" /> <result column="file_type" property="fileType" />
<result column="file_name" property="fileName" />
<result column="file_oss_key" property="fileOssKey" />
<result column="preview_url" property="previewUrl" /> <result column="preview_url" property="previewUrl" />
<result column="presigned_url" property="presignedUrl" />
<result column="rel_type" property="relType" />
<result column="rel_id" property="relId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tanpu.community.dao.mapper.community.FollowRelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FollowRelEntity">
<id column="id" property="id" />
<result column="follow_id" property="followId" />
<result column="follower_id" property="followerId" />
<result column="follow_time" property="followTime" />
<result column="unfollow_time" property="unfollowTime" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<result column="head_img" property="headImg" /> <result column="head_img" property="headImg" />
<result column="nick_name" property="nickName" /> <result column="nick_name" property="nickName" />
<result column="introduction" property="introduction" /> <result column="introduction" property="introduction" />
<result column="create_by" property="createBy" /> <result column="sex" property="sex" />
<result column="location" property="location" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tanpu.community.dao.mapper.community.FansRelMapper"> <mapper namespace="com.tanpu.community.dao.mapper.community.ThemeAttachmentMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FansRelEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.ThemeAttachmentEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="idol_id" property="idolId" /> <result column="theme_id" property="themeId" />
<result column="follower_id" property="followerId" /> <result column="attach_type" property="attachType" />
<result column="attach_id" property="attachId" />
<result column="create_by" property="createBy" /> <result column="create_by" property="createBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" /> <result column="update_by" property="updateBy" />
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.ThemeEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.ThemeEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="theme_id" property="themeId" />
<result column="title" property="title" /> <result column="title" property="title" />
<result column="theme_type" property="themeType" /> <result column="theme_type" property="themeType" />
<result column="content" property="content" /> <result column="content" property="content" />
...@@ -13,9 +14,7 @@ ...@@ -13,9 +14,7 @@
<result column="author_id" property="authorId" /> <result column="author_id" property="authorId" />
<result column="former_theme_id" property="formerThemeId" /> <result column="former_theme_id" property="formerThemeId" />
<result column="topic_id" property="topicId" /> <result column="topic_id" property="topicId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicEntity"> <resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicEntity">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="topic_id" property="topicId" />
<result column="topic_title" property="topicTitle" /> <result column="topic_title" property="topicTitle" />
<result column="is_top" property="isTop" /> <result column="is_top" property="isTop" />
<result column="is_conceal" property="isConceal" /> <result column="is_conceal" property="isConceal" />
<result column="create_by" property="createBy" /> <result column="view_amount_modify" property="viewAmountModify" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" /> <result column="delete_tag" property="deleteTag" />
</resultMap> </resultMap>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment