Commit c3c96356 authored by 张辰's avatar 张辰

first commit

parent 126aef37
......@@ -23,6 +23,11 @@
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
......@@ -38,15 +43,15 @@
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-netflix-ribbon</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.cloud</groupId>
......
......@@ -3,8 +3,10 @@ package com.tanpu.community;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement
@ComponentScan({"com.tanpu.common", "com.tanpu.community"})
public class CommunityApplication {
......
package com.tanpu.community.controller;
import com.tanpu.community.dao.entity.community.FansRelEntity;
import com.tanpu.community.manager.HomePageManager;
import com.tanpu.community.model.req.homepage.AddIdolReq;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@Slf4j
@RequestMapping(value = "/api/homepage")
public class HomePageController {
@Autowired
private HomePageManager homePageManager;
@PostMapping(value = "/queryMyFans")
@ApiOperation("查询自己的粉丝")
@ResponseBody
public String queryMyFans() {
String userId = "123";
List<FansRelEntity> fans = homePageManager.queryFansByIdolId(userId);
return null;
}
@PostMapping(value = "/addIdol")
@ApiOperation("关注他人")
@ResponseBody
public String addIdol(@RequestBody AddIdolReq req) {
String userId = "123";
homePageManager.addIdol(req.idolId, userId);
return "11";
}
}
package com.tanpu.community.dao;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import java.util.ArrayList;
import java.util.List;
public class CodeAutoGenerator {
public static void main(String[] args) {
String currentPath = System.getProperty("user.dir");
String codeBaseHome = "/community-service/src/main/java";
String author = "xudong";
String mysqlUserName = "tamp_admin";
String mysqlPassword = "@imeng123";
String jdbcUrl = "jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community";
// String[] tables = new String[]{"visit_summary"};
String[] tables = new String[]{"visit_summary", "black_list","collection","comment","fans_rel","file_record","home_page","theme","topic"};
String basePackage = "com.tanpu.community";
String mapperPackage = "dao.mapper.community";
String entityPackage = "dao.entity.community";
String xmlPath = "D:\\code\\backend\\tanpu-community\\community-service\\src\\main\\resources\\mapper\\community";
AutoGenerator autoGenerator = new AutoGenerator();
//全局配置
GlobalConfig gc = new GlobalConfig();
String path = currentPath + codeBaseHome;
gc.setOutputDir(path); //生成文件输出根目录
gc.setOpen(false);//生成完成后不弹出文件框
gc.setAuthor(author);
gc.setFileOverride(true); //文件覆盖
gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
gc.setEnableCache(false);// XML 二级缓存
gc.setBaseResultMap(true);// XML ResultMap
gc.setBaseColumnList(false);// XML columList
gc.setSwagger2(true);
// 自定义文件命名,注意 %s 会自动填充表实体属性!
gc.setMapperName("%sMapper");
gc.setXmlName("%sMapper");
gc.setEntityName("%sEntity");
autoGenerator.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setDbType(DbType.MYSQL); //设置数据库类型,我是postgresql
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername(mysqlUserName);
dsc.setPassword(mysqlPassword);
dsc.setUrl(jdbcUrl); //指定数据库
autoGenerator.setDataSource(dsc);
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel); // 表名生成策略
strategy.setInclude(tables); // 需要生成的表
// strategy.setSuperEntityClass(BaseEntity.class);
// strategy.setSuperEntityColumns("create_by", "update_by", "create_time", "update_time", "delete_tag");
// strategy.setSuperServiceClass(null);
// strategy.setSuperServiceImplClass(null);
// strategy.setSuperMapperClass(null);
autoGenerator.setStrategy(strategy);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(basePackage);
// pc.setController(controllerPackage);
// pc.setService(servicePackage);
pc.setMapper(mapperPackage);
pc.setEntity(entityPackage);
autoGenerator.setPackageInfo(pc);
// 模板配置
TemplateConfig tc = new TemplateConfig();
tc.setController(null);
tc.setService(null);
tc.setServiceImpl(null);
tc.setXml(null);
autoGenerator.setTemplate(tc);
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
// 如果模板引擎是 freemarker
// String templatePath = "/templates/mapper.xml.ftl";
// 如果模板引擎是 velocity
String templatePath = "/templates/mapper.xml.vm";
// 自定义输出配置
List<FileOutConfig> focList = new ArrayList<>();
// 自定义配置会被优先输出
focList.add(new FileOutConfig(templatePath) {
@Override
public String outputFile(TableInfo tableInfo) {
return xmlPath + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
autoGenerator.setCfg(cfg);
// 执行生成
autoGenerator.execute();
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 黑名单
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("black_list")
@ApiModel(value="BlackListEntity对象", description="黑名单")
public class BlackListEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "屏蔽发起人")
private String blocker;
@ApiModelProperty(value = "屏蔽类型")
private Integer blockedType;
@ApiModelProperty(value = "被屏蔽的")
private String blockedId;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBlocker() {
return blocker;
}
public void setBlocker(String blocker) {
this.blocker = blocker;
}
public Integer getBlockedType() {
return blockedType;
}
public void setBlockedType(Integer blockedType) {
this.blockedType = blockedType;
}
public String getBlockedId() {
return blockedId;
}
public void setBlockedId(String blockedId) {
this.blockedId = blockedId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "BlackListEntity{" +
"id=" + id +
", blocker=" + blocker +
", blockedType=" + blockedType +
", blockedId=" + blockedId +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 收藏/点赞
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("collection")
@ApiModel(value="CollectionEntity对象", description="收藏/点赞")
public class CollectionEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "类型")
private Integer collectionType;
@ApiModelProperty(value = "作者id")
private String authorId;
@ApiModelProperty(value = "评论的目标id")
private String targetId;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getCollectionType() {
return collectionType;
}
public void setCollectionType(Integer collectionType) {
this.collectionType = collectionType;
}
public String getAuthorId() {
return authorId;
}
public void setAuthorId(String authorId) {
this.authorId = authorId;
}
public String getTargetId() {
return targetId;
}
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "CollectionEntity{" +
"id=" + id +
", collectionType=" + collectionType +
", authorId=" + authorId +
", targetId=" + targetId +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 评论
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("comment")
@ApiModel(value="CommentEntity对象", description="评论")
public class CommentEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "类型")
private Integer commentType;
@ApiModelProperty(value = "文本内容")
private String content;
@ApiModelProperty(value = "作者id")
private String authorId;
@ApiModelProperty(value = "评论的目标id")
private String targetId;
@ApiModelProperty(value = "是否屏蔽")
private Integer isBlock;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getCommentType() {
return commentType;
}
public void setCommentType(Integer commentType) {
this.commentType = commentType;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAuthorId() {
return authorId;
}
public void setAuthorId(String authorId) {
this.authorId = authorId;
}
public String getTargetId() {
return targetId;
}
public void setTargetId(String targetId) {
this.targetId = targetId;
}
public Integer getIsBlock() {
return isBlock;
}
public void setIsBlock(Integer isBlock) {
this.isBlock = isBlock;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "CommentEntity{" +
"id=" + id +
", commentType=" + commentType +
", content=" + content +
", authorId=" + authorId +
", targetId=" + targetId +
", isBlock=" + isBlock +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 粉丝关系
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("fans_rel")
@ApiModel(value="FansRelEntity对象", description="粉丝关系")
public class FansRelEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "被关注的人id")
private String idolId;
@ApiModelProperty(value = "粉丝id")
private String followerId;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIdolId() {
return idolId;
}
public void setIdolId(String idolId) {
this.idolId = idolId;
}
public String getFollowerId() {
return followerId;
}
public void setFollowerId(String followerId) {
this.followerId = followerId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "FansRelEntity{" +
"id=" + id +
", idolId=" + idolId +
", followerId=" + followerId +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 文件
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("file_record")
@ApiModel(value="FileRecordEntity对象", description="文件")
public class FileRecordEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "文件名称")
private String originalName;
@ApiModelProperty(value = "逻辑url")
private String logicUrl;
@ApiModelProperty(value = "预览url")
private String previewUrl;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getOriginalName() {
return originalName;
}
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
public String getLogicUrl() {
return logicUrl;
}
public void setLogicUrl(String logicUrl) {
this.logicUrl = logicUrl;
}
public String getPreviewUrl() {
return previewUrl;
}
public void setPreviewUrl(String previewUrl) {
this.previewUrl = previewUrl;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "FileRecordEntity{" +
"id=" + id +
", originalName=" + originalName +
", logicUrl=" + logicUrl +
", previewUrl=" + previewUrl +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 个人主页
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("home_page")
@ApiModel(value="HomePageEntity对象", description="个人主页")
public class HomePageEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "头像url")
private String headImg;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "个人简介")
private String introduction;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getHeadImg() {
return headImg;
}
public void setHeadImg(String headImg) {
this.headImg = headImg;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "HomePageEntity{" +
"id=" + id +
", userId=" + userId +
", headImg=" + headImg +
", nickName=" + nickName +
", introduction=" + introduction +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 主题内容
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("theme")
@ApiModel(value="ThemeEntity对象", description="主题内容")
public class ThemeEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "类型")
private Integer themeType;
@ApiModelProperty(value = "文本内容")
private String content;
@ApiModelProperty(value = "附件类型")
private Integer attachType;
@ApiModelProperty(value = "附件内容")
private String attachment;
@ApiModelProperty(value = "作者id")
private String authorId;
@ApiModelProperty(value = "被转发的主题")
private String formerThemeId;
@ApiModelProperty(value = "所属的话题")
private String topicId;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getThemeType() {
return themeType;
}
public void setThemeType(Integer themeType) {
this.themeType = themeType;
}
public String getContent() {
return content;
}
public void setContent(String 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() {
return authorId;
}
public void setAuthorId(String authorId) {
this.authorId = authorId;
}
public String getFormerThemeId() {
return formerThemeId;
}
public void setFormerThemeId(String formerThemeId) {
this.formerThemeId = formerThemeId;
}
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "ThemeEntity{" +
"id=" + id +
", title=" + title +
", themeType=" + themeType +
", content=" + content +
", attachType=" + attachType +
", attachment=" + attachment +
", authorId=" + authorId +
", formerThemeId=" + formerThemeId +
", topicId=" + topicId +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 话题
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("topic")
@ApiModel(value="TopicEntity对象", description="话题")
public class TopicEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "话题名称")
private Integer topicTitle;
@ApiModelProperty(value = "是否置顶")
private Integer isTop;
@ApiModelProperty(value = "是否隐藏")
private Integer isConceal;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getTopicTitle() {
return topicTitle;
}
public void setTopicTitle(Integer topicTitle) {
this.topicTitle = topicTitle;
}
public Integer getIsTop() {
return isTop;
}
public void setIsTop(Integer isTop) {
this.isTop = isTop;
}
public Integer getIsConceal() {
return isConceal;
}
public void setIsConceal(Integer isConceal) {
this.isConceal = isConceal;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "TopicEntity{" +
"id=" + id +
", topicTitle=" + topicTitle +
", isTop=" + isTop +
", isConceal=" + isConceal +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* <p>
* 浏览记录
* </p>
*
* @author xudong
* @since 2021-06-10
*/
@TableName("visit_summary")
@ApiModel(value="VisitSummaryEntity对象", description="浏览记录")
public class VisitSummaryEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "session_id")
private String sessionId;
@ApiModelProperty(value = "浏览者id")
private String visitorId;
@ApiModelProperty(value = "作者id")
private String authorId;
@ApiModelProperty(value = "关联目标ID")
private String refId;
@ApiModelProperty(value = "关联目标类型")
private Integer refType;
@ApiModelProperty(value = "浏览时间 单位秒")
private Integer duration;
private String createBy;
private LocalDateTime createTime;
private String updateBy;
private LocalDateTime updateTime;
private Integer deleteTag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public String getVisitorId() {
return visitorId;
}
public void setVisitorId(String visitorId) {
this.visitorId = visitorId;
}
public String getAuthorId() {
return authorId;
}
public void setAuthorId(String authorId) {
this.authorId = authorId;
}
public String getRefId() {
return refId;
}
public void setRefId(String refId) {
this.refId = refId;
}
public Integer getRefType() {
return refType;
}
public void setRefType(Integer refType) {
this.refType = refType;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "VisitSummaryEntity{" +
"id=" + id +
", sessionId=" + sessionId +
", visitorId=" + visitorId +
", authorId=" + authorId +
", refId=" + refId +
", refType=" + refType +
", duration=" + duration +
", createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.CollectionEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 收藏/点赞 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface CollectionMapper extends BaseMapper<CollectionEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.CommentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 评论 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface CommentMapper extends BaseMapper<CommentEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.FansRelEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 粉丝关系 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface FansRelMapper extends BaseMapper<FansRelEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.FileRecordEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 文件 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface FileRecordMapper extends BaseMapper<FileRecordEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.HomePageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 个人主页 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface HomePageMapper extends BaseMapper<HomePageEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.ThemeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 主题内容 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface ThemeMapper extends BaseMapper<ThemeEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.TopicEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 话题 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface TopicMapper extends BaseMapper<TopicEntity> {
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.VisitSummaryEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 浏览记录 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-10
*/
public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> {
}
package com.tanpu.community.manager;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.dao.entity.community.FansRelEntity;
import com.tanpu.community.dao.mapper.community.FansRelMapper;
import com.tanpu.community.service.FansRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class HomePageManager {
@Autowired
private FansRelService fansRelService;
public List<FansRelEntity> queryFansByFollowerId(String followerId) {
return fansRelService.queryFansByFollowerId(followerId);
// todo 组装粉丝的头像等信息
}
public List<FansRelEntity> queryFansByIdolId(String idolId) {
return fansRelService.queryFansByIdolId(idolId);
// todo 组装粉丝的头像等信息
}
public void addIdol(String idolId, String followerId) {
fansRelService.addFans(idolId, followerId);
}
}
package com.tanpu.community.model.req.homepage;
import lombok.Data;
@Data
public class AddIdolReq {
public String idolId;
}
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.dao.entity.community.FansRelEntity;
import com.tanpu.community.dao.mapper.community.FansRelMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class FansRelService {
@Resource
private FansRelMapper fansRelMapper;
public List<FansRelEntity> queryFansByFollowerId(String followerId) {
return fansRelMapper.selectList(new LambdaQueryWrapper<FansRelEntity>().eq(FansRelEntity::getFollowerId, followerId));
}
public List<FansRelEntity> queryFansByIdolId(String idolId) {
return fansRelMapper.selectList(new LambdaQueryWrapper<FansRelEntity>().eq(FansRelEntity::getIdolId, idolId));
}
public void addFans(String idolId, String followerId) {
FansRelEntity rel = new FansRelEntity();
rel.setIdolId(idolId);
rel.setFollowerId(followerId);
fansRelMapper.insert(rel);
}
}
# apollo
apollo.bootstrap.enabled: false
app.id: tanpu-community
#app.id: tanpu-community
apollo:
meta: http://dev-apollo.tamp-innner.com:8080
cacheDir: ./apollocache/
bootstrap:
namespaces: application.yml
#apollo:
# meta: http://dev-apollo.tamp-innner.com:8080
# cacheDir: ./apollocache/
# bootstrap:
# namespaces: application.yml
spring:
zipkin:
enabled: false
server:
port: 8080
servlet:
context-path: /community
spring.datasource:
community:
driver-class-name: com.mysql.cj.jdbc.Driver
jdbc-url: jdbc:mysql://dev-mysql.tamp-innser.com3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&rewriteBatchedStatements=true
username: dev
password: qimeng123
jdbc-url: jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community?useUnicode=true&characterEncoding=utf-8&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&rewriteBatchedStatements=true
username: tamp_admin
password: '@imeng123'
maxActive: 2
minIdle: 2
initialSize: 2
management:
endpoints:
web:
exposure:
include: "*"
jmx:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
spring:
sleuth:
enabled: false
zipkin:
enabled: false
<?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.BlackListMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.BlackListEntity">
<id column="id" property="id" />
<result column="blocker" property="blocker" />
<result column="blocked_type" property="blockedType" />
<result column="blocked_id" property="blockedId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.CollectionMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CollectionEntity">
<id column="id" property="id" />
<result column="collection_type" property="collectionType" />
<result column="author_id" property="authorId" />
<result column="target_id" property="targetId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.CommentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.CommentEntity">
<id column="id" property="id" />
<result column="comment_type" property="commentType" />
<result column="content" property="content" />
<result column="author_id" property="authorId" />
<result column="target_id" property="targetId" />
<result column="is_block" property="isBlock" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.FansRelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FansRelEntity">
<id column="id" property="id" />
<result column="idol_id" property="idolId" />
<result column="follower_id" property="followerId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.FileRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.FileRecordEntity">
<id column="id" property="id" />
<result column="original_name" property="originalName" />
<result column="logic_url" property="logicUrl" />
<result column="preview_url" property="previewUrl" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.HomePageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.HomePageEntity">
<id column="id" property="id" />
<result column="user_id" property="userId" />
<result column="head_img" property="headImg" />
<result column="nick_name" property="nickName" />
<result column="introduction" property="introduction" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.ThemeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.ThemeEntity">
<id column="id" property="id" />
<result column="title" property="title" />
<result column="theme_type" property="themeType" />
<result column="content" property="content" />
<result column="attach_type" property="attachType" />
<result column="attachment" property="attachment" />
<result column="author_id" property="authorId" />
<result column="former_theme_id" property="formerThemeId" />
<result column="topic_id" property="topicId" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.TopicMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.TopicEntity">
<id column="id" property="id" />
<result column="topic_title" property="topicTitle" />
<result column="is_top" property="isTop" />
<result column="is_conceal" property="isConceal" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
<?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.VisitSummaryMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.VisitSummaryEntity">
<id column="id" property="id" />
<result column="session_id" property="sessionId" />
<result column="visitor_id" property="visitorId" />
<result column="author_id" property="authorId" />
<result column="ref_id" property="refId" />
<result column="ref_type" property="refType" />
<result column="duration" property="duration" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
CREATE TABLE `home_page` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`user_id` varchar(64) NOT NULL COMMENT '用户id',
`head_img` varchar(256) NOT NULL COMMENT '头像url',
`nick_name` varchar(32) NOT NULL COMMENT '昵称',
`introduction` varchar(256) NOT NULL COMMENT '个人简介',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
UNIQUE KEY `uk_userId` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='个人主页';
CREATE TABLE `fans_rel` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`idol_id` varchar(64) NOT NULL COMMENT '被关注的人id',
`follower_id` varchar(64) NOT NULL COMMENT '粉丝id',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
UNIQUE KEY `uk_idol_follower` (`idol_id`, `follower_id`),
INDEX `idx_follower` (`follower_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='粉丝关系';
CREATE TABLE `theme` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`title` varchar(64) NOT NULL COMMENT '标题',
`theme_type` int(4) NOT NULL COMMENT '类型',
`content` text COMMENT '文本内容',
`attach_type` int(4) NOT NULL COMMENT '附件类型',
`attachment` text NOT NULL COMMENT '附件内容',
`author_id` varchar(64) NOT NULL COMMENT '作者id',
`former_theme_id` varchar(64) NOT NULL COMMENT '被转发的主题',
`topic_id` varchar(64) NOT NULL COMMENT '所属的话题',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `idx_author` (`author_id`),
INDEX `idx_former` (`former_theme_id`),
INDEX `idx_topic` (`topic_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='主题内容';
CREATE TABLE `comment` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`comment_type` int(4) NOT NULL COMMENT '类型',
`content` text COMMENT '文本内容',
`author_id` varchar(64) NOT NULL COMMENT '作者id',
`target_id` varchar(64) NOT NULL COMMENT '评论的目标id',
`is_block` int(4) NOT NULL COMMENT '是否屏蔽',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `idx_author` (`author_id`),
INDEX `idx_target` (`target_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='评论';
CREATE TABLE `collection` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`collection_type` int(4) NOT NULL COMMENT '类型',
`author_id` varchar(64) NOT NULL COMMENT '作者id',
`target_id` varchar(64) NOT NULL COMMENT '评论的目标id',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `idx_author` (`author_id`),
INDEX `idx_target` (`target_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收藏/点赞';
CREATE TABLE `topic` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`topic_title` int(4) NOT NULL COMMENT '话题名称',
`is_top` int(4) NOT NULL COMMENT '是否置顶',
`is_conceal` int(4) NOT NULL COMMENT '是否隐藏',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
UNIQUE KEY `uk_title` (`topic_title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题';
CREATE TABLE `file_record` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`original_name` varchar(64) NOT NULL COMMENT '文件名称',
`logic_url` varchar(128) NOT NULL COMMENT '逻辑url',
`preview_url` varchar(512) NOT NULL COMMENT '预览url',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
UNIQUE KEY `uk_logic` (`logic_url`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文件';
CREATE TABLE `black_list` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`blocker` varchar(64) NOT NULL COMMENT '屏蔽发起人',
`blocked_type` int(4) NOT NULL COMMENT '屏蔽类型',
`blocked_id` varchar(64) NOT NULL COMMENT '被屏蔽的',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `uk_blocker` (`blocker`),
INDEX `uk_blocked` (`blocked_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='黑名单';
CREATE TABLE `black_list` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`blocker` varchar(64) NOT NULL COMMENT '屏蔽发起人',
`blocked_type` int(4) NOT NULL COMMENT '屏蔽类型',
`blocked_id` varchar(64) NOT NULL COMMENT '被屏蔽的',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `uk_blocker` (`blocker`),
INDEX `uk_blocked` (`blocked_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='黑名单';
CREATE TABLE `visit_summary` (
`id` varchar(64) PRIMARY KEY COMMENT 'id',
`session_id` varchar(64) NOT NULL COMMENT 'session_id',
`visitor_id` varchar(64) NOT NULL COMMENT '浏览者id',
`author_id` varchar(64) NOT NULL COMMENT '作者id',
`ref_id` varchar(64) NOT NULL COMMENT '关联目标ID',
`ref_type` int(8) NOT NULL COMMENT '关联目标类型',
`duration` int(16) NOT NULL COMMENT '浏览时间 单位秒',
`create_by` varchar(64) DEFAULT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`update_by` varchar(64) DEFAULT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`delete_tag` int(3) NOT NULL DEFAULT '0',
INDEX `idx_session` (`session_id`),
INDEX `idx_ref` (`ref_id`),
INDEX `idx_visitor` (`visitor_id`),
INDEX `idx_author` (`author_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='浏览记录';
CREATE TABLE alert_info
(
`id` INTEGER(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`content` VARCHAR(2048) NOT NULL DEFAULT '' COMMENT '名称',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`create_by` varchar(32) NOT NULL DEFAULT 'SYS' COMMENT '创建人',
`update_by` varchar(32) NOT NULL DEFAULT 'SYS' COMMENT '修改人',
`delete_tag` tinyint NOT NULL DEFAULT 0 COMMENT '标记删除',
PRIMARY KEY (id)
);
......@@ -36,7 +36,7 @@
<dependency>
<groupId>com.tanpu</groupId>
<artifactId>common</artifactId>
<version>1.0.2-RELEASE</version>
<version>1.0.3-RELEASE</version>
</dependency>
<dependency>
......@@ -61,6 +61,13 @@
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
......
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