From 3904e8510e2e22af9aca0f8fffb106ba06795f01 Mon Sep 17 00:00:00 2001 From: Hanserwei <2628273921@qq.com> Date: Wed, 15 Oct 2025 19:26:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(count):=20=E6=96=B0=E5=A2=9E=E7=AC=94?= =?UTF-8?q?=E8=AE=B0=E5=92=8C=E7=94=A8=E6=88=B7=E8=AE=A1=E6=95=B0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=E5=92=8C=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=20-=20=E6=96=B0=E5=A2=9E=E7=AC=94=E8=AE=B0=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E8=A1=A8(NoteCollectionDO)=E5=8F=8A=E7=9B=B8=E5=85=B3?= =?UTF-8?q?Mapper=E5=92=8C=E6=9C=8D=E5=8A=A1=E5=AE=9E=E7=8E=B0=20-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AC=94=E8=AE=B0=E8=AE=A1=E6=95=B0=E8=A1=A8?= =?UTF-8?q?(NoteCountDO)=E5=8F=8A=E7=9B=B8=E5=85=B3Mapper=E5=92=8C?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=AE=9E=E7=8E=B0=20-=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E7=82=B9=E8=B5=9E=E8=A1=A8(NoteLikeDO)?= =?UTF-8?q?=E5=8F=8A=E7=9B=B8=E5=85=B3Mapper=E5=92=8C=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=20-=20=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E8=A1=A8(UserCountDO)=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3Mapper=E5=92=8C=E6=9C=8D=E5=8A=A1=E5=AE=9E=E7=8E=B0=20?= =?UTF-8?q?-=20=E9=85=8D=E7=BD=AERedisTemplate=E4=BB=A5=E6=94=AF=E6=8C=81J?= =?UTF-8?q?SON=E6=A0=BC=E5=BC=8F=E5=BA=8F=E5=88=97=E5=8C=96=20-=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5RocketMQ=E4=BE=9D=E8=B5=96=E5=B9=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=87=AA=E5=8A=A8=E8=A3=85=E9=85=8D=20-=20=E5=9C=A8co?= =?UTF-8?q?unt=E6=A8=A1=E5=9D=97=E4=B8=AD=E6=B7=BB=E5=8A=A0Redis=E5=92=8CR?= =?UTF-8?q?ocketMQ=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- han-note-count/han-note-count-biz/pom.xml | 7 +++ .../count/biz/config/RedisTemplateConfig.java | 31 ++++++++++ .../count/biz/config/RocketMQConfig.java | 10 +++ .../biz/domain/dataobject/NoteCountDO.java | 50 +++++++++++++++ .../biz/domain/dataobject/TNoteCount.java | 50 +++++++++++++++ .../biz/domain/dataobject/UserCountDO.java | 62 +++++++++++++++++++ .../biz/domain/mapper/NoteCountDOMapper.java | 9 +++ .../biz/domain/mapper/UserCountDOMapper.java | 9 +++ .../count/biz/service/NoteCountDOService.java | 8 +++ .../count/biz/service/UserCountDOService.java | 8 +++ .../service/impl/NoteCountDOServiceImpl.java | 13 ++++ .../service/impl/UserCountDOServiceImpl.java | 13 ++++ .../resources/mapperxml/NoteCountDOMapper.xml | 17 +++++ .../resources/mapperxml/UserCountDOMapper.xml | 19 ++++++ .../domain/dataobject/NoteCollectionDO.java | 51 +++++++++++++++ .../biz/domain/dataobject/NoteLikeDO.java | 51 +++++++++++++++ .../domain/mapper/NoteCollectionDOMapper.java | 9 +++ .../biz/domain/mapper/NoteLikeDOMapper.java | 9 +++ .../biz/service/NoteCollectionDOService.java | 8 +++ .../note/biz/service/NoteLikeDOService.java | 8 +++ .../impl/NoteCollectionDOServiceImpl.java | 13 ++++ .../service/impl/NoteLikeDOServiceImpl.java | 13 ++++ .../mapperxml/NoteCollectionDOMapper.xml | 17 +++++ .../resources/mapperxml/NoteLikeDOMapper.xml | 17 +++++ 24 files changed, 502 insertions(+) create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RedisTemplateConfig.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RocketMQConfig.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/NoteCountDO.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/TNoteCount.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/UserCountDO.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/NoteCountDOMapper.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/UserCountDOMapper.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/NoteCountDOService.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/UserCountDOService.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/NoteCountDOServiceImpl.java create mode 100644 han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/UserCountDOServiceImpl.java create mode 100644 han-note-count/han-note-count-biz/src/main/resources/mapperxml/NoteCountDOMapper.xml create mode 100644 han-note-count/han-note-count-biz/src/main/resources/mapperxml/UserCountDOMapper.xml create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteCollectionDO.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteLikeDO.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteCollectionDOMapper.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteLikeDOMapper.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteCollectionDOService.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteLikeDOService.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteCollectionDOServiceImpl.java create mode 100644 han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteLikeDOServiceImpl.java create mode 100644 han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteCollectionDOMapper.xml create mode 100644 han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteLikeDOMapper.xml diff --git a/han-note-count/han-note-count-biz/pom.xml b/han-note-count/han-note-count-biz/pom.xml index 0866c2a..ecc3570 100644 --- a/han-note-count/han-note-count-biz/pom.xml +++ b/han-note-count/han-note-count-biz/pom.xml @@ -90,6 +90,13 @@ org.springframework.boot spring-boot-starter-data-redis + + + + org.apache.rocketmq + rocketmq-spring-boot-starter + + diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RedisTemplateConfig.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RedisTemplateConfig.java new file mode 100644 index 0000000..c3349e9 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RedisTemplateConfig.java @@ -0,0 +1,31 @@ +package com.hanserwei.hannote.count.biz.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@Configuration +public class RedisTemplateConfig { + + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate redisTemplate = new RedisTemplate<>(); + // 设置 RedisTemplate 的连接工厂 + redisTemplate.setConnectionFactory(connectionFactory); + + // 使用 StringRedisSerializer 来序列化和反序列化 redis 的 key 值,确保 key 是可读的字符串 + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + + // 使用 Jackson2JsonRedisSerializer 来序列化和反序列化 redis 的 value 值, 确保存储的是 JSON 格式 + Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer<>(Object.class); + redisTemplate.setValueSerializer(serializer); + redisTemplate.setHashValueSerializer(serializer); + + redisTemplate.afterPropertiesSet(); + return redisTemplate; + } +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RocketMQConfig.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RocketMQConfig.java new file mode 100644 index 0000000..8b84794 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/config/RocketMQConfig.java @@ -0,0 +1,10 @@ +package com.hanserwei.hannote.count.biz.config; + +import org.apache.rocketmq.spring.autoconfigure.RocketMQAutoConfiguration; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +@Configuration +@Import(RocketMQAutoConfiguration.class) +public class RocketMQConfig { +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/NoteCountDO.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/NoteCountDO.java new file mode 100644 index 0000000..4e8e97c --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/NoteCountDO.java @@ -0,0 +1,50 @@ +package com.hanserwei.hannote.count.biz.domain.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 笔记计数表 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "t_note_count") +public class NoteCountDO { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 笔记ID + */ + @TableField(value = "note_id") + private Long noteId; + + /** + * 获得点赞总数 + */ + @TableField(value = "like_total") + private Long likeTotal; + + /** + * 获得收藏总数 + */ + @TableField(value = "collect_total") + private Long collectTotal; + + /** + * 被评论总数 + */ + @TableField(value = "comment_total") + private Long commentTotal; +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/TNoteCount.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/TNoteCount.java new file mode 100644 index 0000000..d88ab86 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/TNoteCount.java @@ -0,0 +1,50 @@ +package com.hanserwei.hannote.count.biz.domain.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 笔记计数表 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "t_note_count") +public class TNoteCount { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 笔记ID + */ + @TableField(value = "note_id") + private Long noteId; + + /** + * 获得点赞总数 + */ + @TableField(value = "like_total") + private Long likeTotal; + + /** + * 获得收藏总数 + */ + @TableField(value = "collect_total") + private Long collectTotal; + + /** + * 被评论总数 + */ + @TableField(value = "comment_total") + private Long commentTotal; +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/UserCountDO.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/UserCountDO.java new file mode 100644 index 0000000..d55cb2c --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/dataobject/UserCountDO.java @@ -0,0 +1,62 @@ +package com.hanserwei.hannote.count.biz.domain.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 用户计数表 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "t_user_count") +public class UserCountDO { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 粉丝总数 + */ + @TableField(value = "fans_total") + private Long fansTotal; + + /** + * 关注总数 + */ + @TableField(value = "following_total") + private Long followingTotal; + + /** + * 发布笔记总数 + */ + @TableField(value = "note_total") + private Long noteTotal; + + /** + * 获得点赞总数 + */ + @TableField(value = "like_total") + private Long likeTotal; + + /** + * 获得收藏总数 + */ + @TableField(value = "collect_total") + private Long collectTotal; +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/NoteCountDOMapper.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/NoteCountDOMapper.java new file mode 100644 index 0000000..8b2d467 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/NoteCountDOMapper.java @@ -0,0 +1,9 @@ +package com.hanserwei.hannote.count.biz.domain.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hanserwei.hannote.count.biz.domain.dataobject.NoteCountDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NoteCountDOMapper extends BaseMapper { +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/UserCountDOMapper.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/UserCountDOMapper.java new file mode 100644 index 0000000..4d041b5 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/domain/mapper/UserCountDOMapper.java @@ -0,0 +1,9 @@ +package com.hanserwei.hannote.count.biz.domain.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hanserwei.hannote.count.biz.domain.dataobject.UserCountDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface UserCountDOMapper extends BaseMapper { +} \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/NoteCountDOService.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/NoteCountDOService.java new file mode 100644 index 0000000..a94df71 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/NoteCountDOService.java @@ -0,0 +1,8 @@ +package com.hanserwei.hannote.count.biz.service; + +import com.hanserwei.hannote.count.biz.domain.dataobject.NoteCountDO; +import com.baomidou.mybatisplus.extension.service.IService; +public interface NoteCountDOService extends IService{ + + +} diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/UserCountDOService.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/UserCountDOService.java new file mode 100644 index 0000000..d98c596 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/UserCountDOService.java @@ -0,0 +1,8 @@ +package com.hanserwei.hannote.count.biz.service; + +import com.hanserwei.hannote.count.biz.domain.dataobject.UserCountDO; +import com.baomidou.mybatisplus.extension.service.IService; +public interface UserCountDOService extends IService{ + + +} diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/NoteCountDOServiceImpl.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/NoteCountDOServiceImpl.java new file mode 100644 index 0000000..778005e --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/NoteCountDOServiceImpl.java @@ -0,0 +1,13 @@ +package com.hanserwei.hannote.count.biz.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hanserwei.hannote.count.biz.domain.dataobject.NoteCountDO; +import com.hanserwei.hannote.count.biz.domain.mapper.NoteCountDOMapper; +import com.hanserwei.hannote.count.biz.service.NoteCountDOService; +@Service +public class NoteCountDOServiceImpl extends ServiceImpl implements NoteCountDOService{ + +} diff --git a/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/UserCountDOServiceImpl.java b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/UserCountDOServiceImpl.java new file mode 100644 index 0000000..0473a46 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/java/com/hanserwei/hannote/count/biz/service/impl/UserCountDOServiceImpl.java @@ -0,0 +1,13 @@ +package com.hanserwei.hannote.count.biz.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hanserwei.hannote.count.biz.domain.mapper.UserCountDOMapper; +import com.hanserwei.hannote.count.biz.domain.dataobject.UserCountDO; +import com.hanserwei.hannote.count.biz.service.UserCountDOService; +@Service +public class UserCountDOServiceImpl extends ServiceImpl implements UserCountDOService{ + +} diff --git a/han-note-count/han-note-count-biz/src/main/resources/mapperxml/NoteCountDOMapper.xml b/han-note-count/han-note-count-biz/src/main/resources/mapperxml/NoteCountDOMapper.xml new file mode 100644 index 0000000..b85c620 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/resources/mapperxml/NoteCountDOMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + id, note_id, like_total, collect_total, comment_total + + \ No newline at end of file diff --git a/han-note-count/han-note-count-biz/src/main/resources/mapperxml/UserCountDOMapper.xml b/han-note-count/han-note-count-biz/src/main/resources/mapperxml/UserCountDOMapper.xml new file mode 100644 index 0000000..f9590b0 --- /dev/null +++ b/han-note-count/han-note-count-biz/src/main/resources/mapperxml/UserCountDOMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + id, user_id, fans_total, following_total, note_total, like_total, collect_total + + \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteCollectionDO.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteCollectionDO.java new file mode 100644 index 0000000..e5eb5cf --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteCollectionDO.java @@ -0,0 +1,51 @@ +package com.hanserwei.hannote.note.biz.domain.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 笔记收藏表 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "t_note_collection") +public class NoteCollectionDO { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 笔记ID + */ + @TableField(value = "note_id") + private Long noteId; + + /** + * 创建时间 + */ + @TableField(value = "create_time") + private Date createTime; + + /** + * 收藏状态(0:取消收藏 1:收藏) + */ + @TableField(value = "`status`") + private Byte status; +} \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteLikeDO.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteLikeDO.java new file mode 100644 index 0000000..bfd4fa0 --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/dataobject/NoteLikeDO.java @@ -0,0 +1,51 @@ +package com.hanserwei.hannote.note.biz.domain.dataobject; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 笔记点赞表 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TableName(value = "t_note_like") +public class NoteLikeDO { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 用户ID + */ + @TableField(value = "user_id") + private Long userId; + + /** + * 笔记ID + */ + @TableField(value = "note_id") + private Long noteId; + + /** + * 创建时间 + */ + @TableField(value = "create_time") + private Date createTime; + + /** + * 点赞状态(0:取消点赞 1:点赞) + */ + @TableField(value = "`status`") + private Byte status; +} \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteCollectionDOMapper.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteCollectionDOMapper.java new file mode 100644 index 0000000..c79dfba --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteCollectionDOMapper.java @@ -0,0 +1,9 @@ +package com.hanserwei.hannote.note.biz.domain.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteCollectionDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NoteCollectionDOMapper extends BaseMapper { +} \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteLikeDOMapper.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteLikeDOMapper.java new file mode 100644 index 0000000..dae97c1 --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/domain/mapper/NoteLikeDOMapper.java @@ -0,0 +1,9 @@ +package com.hanserwei.hannote.note.biz.domain.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteLikeDO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface NoteLikeDOMapper extends BaseMapper { +} \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteCollectionDOService.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteCollectionDOService.java new file mode 100644 index 0000000..a993c2d --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteCollectionDOService.java @@ -0,0 +1,8 @@ +package com.hanserwei.hannote.note.biz.service; + +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteCollectionDO; +import com.baomidou.mybatisplus.extension.service.IService; +public interface NoteCollectionDOService extends IService{ + + +} diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteLikeDOService.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteLikeDOService.java new file mode 100644 index 0000000..e26b298 --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/NoteLikeDOService.java @@ -0,0 +1,8 @@ +package com.hanserwei.hannote.note.biz.service; + +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteLikeDO; +import com.baomidou.mybatisplus.extension.service.IService; +public interface NoteLikeDOService extends IService{ + + +} diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteCollectionDOServiceImpl.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteCollectionDOServiceImpl.java new file mode 100644 index 0000000..77c8f04 --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteCollectionDOServiceImpl.java @@ -0,0 +1,13 @@ +package com.hanserwei.hannote.note.biz.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteCollectionDO; +import com.hanserwei.hannote.note.biz.domain.mapper.NoteCollectionDOMapper; +import com.hanserwei.hannote.note.biz.service.NoteCollectionDOService; +@Service +public class NoteCollectionDOServiceImpl extends ServiceImpl implements NoteCollectionDOService{ + +} diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteLikeDOServiceImpl.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteLikeDOServiceImpl.java new file mode 100644 index 0000000..f50c53d --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/service/impl/NoteLikeDOServiceImpl.java @@ -0,0 +1,13 @@ +package com.hanserwei.hannote.note.biz.service.impl; + +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hanserwei.hannote.note.biz.domain.mapper.NoteLikeDOMapper; +import com.hanserwei.hannote.note.biz.domain.dataobject.NoteLikeDO; +import com.hanserwei.hannote.note.biz.service.NoteLikeDOService; +@Service +public class NoteLikeDOServiceImpl extends ServiceImpl implements NoteLikeDOService{ + +} diff --git a/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteCollectionDOMapper.xml b/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteCollectionDOMapper.xml new file mode 100644 index 0000000..3d19e02 --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteCollectionDOMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + id, user_id, note_id, create_time, `status` + + \ No newline at end of file diff --git a/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteLikeDOMapper.xml b/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteLikeDOMapper.xml new file mode 100644 index 0000000..f064bdd --- /dev/null +++ b/han-note-note/han-note-note-biz/src/main/resources/mapperxml/NoteLikeDOMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + id, user_id, note_id, create_time, `status` + + \ No newline at end of file