From 8986984c997b77a5b47c16ca8ae9912c4ffd7494 Mon Sep 17 00:00:00 2001 From: Wonder Date: Sat, 18 Oct 2025 14:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=94=84Update:=20MybatisX-Generator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/hezhaohui/thumb/mapper/BlogMapper.java | 18 ++++++ .../hezhaohui/thumb/mapper/ThumbMapper.java | 18 ++++++ .../cn/hezhaohui/thumb/mapper/UserMapper.java | 18 ++++++ .../cn/hezhaohui/thumb/model/entity/Blog.java | 56 +++++++++++++++++++ .../hezhaohui/thumb/model/entity/Thumb.java | 36 ++++++++++++ .../cn/hezhaohui/thumb/model/entity/User.java | 25 +++++++++ .../hezhaohui/thumb/service/BlogService.java | 13 +++++ .../hezhaohui/thumb/service/ThumbService.java | 13 +++++ .../hezhaohui/thumb/service/UserService.java | 13 +++++ .../thumb/service/impl/BlogServiceImpl.java | 22 ++++++++ .../thumb/service/impl/ThumbServiceImpl.java | 22 ++++++++ .../thumb/service/impl/UserServiceImpl.java | 22 ++++++++ src/main/resources/mapper/BlogMapper.xml | 22 ++++++++ src/main/resources/mapper/ThumbMapper.xml | 17 ++++++ src/main/resources/mapper/UserMapper.xml | 15 +++++ 15 files changed, 330 insertions(+) create mode 100644 src/main/java/cn/hezhaohui/thumb/mapper/BlogMapper.java create mode 100644 src/main/java/cn/hezhaohui/thumb/mapper/ThumbMapper.java create mode 100644 src/main/java/cn/hezhaohui/thumb/mapper/UserMapper.java create mode 100644 src/main/java/cn/hezhaohui/thumb/model/entity/Blog.java create mode 100644 src/main/java/cn/hezhaohui/thumb/model/entity/Thumb.java create mode 100644 src/main/java/cn/hezhaohui/thumb/model/entity/User.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/BlogService.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/ThumbService.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/UserService.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/impl/BlogServiceImpl.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/impl/ThumbServiceImpl.java create mode 100644 src/main/java/cn/hezhaohui/thumb/service/impl/UserServiceImpl.java create mode 100644 src/main/resources/mapper/BlogMapper.xml create mode 100644 src/main/resources/mapper/ThumbMapper.xml create mode 100644 src/main/resources/mapper/UserMapper.xml diff --git a/src/main/java/cn/hezhaohui/thumb/mapper/BlogMapper.java b/src/main/java/cn/hezhaohui/thumb/mapper/BlogMapper.java new file mode 100644 index 0000000..f64c41f --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/mapper/BlogMapper.java @@ -0,0 +1,18 @@ +package cn.hezhaohui.thumb.mapper; + +import cn.hezhaohui.thumb.model.entity.Blog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 23117 +* @description 针对表【blog】的数据库操作Mapper +* @createDate 2025-10-18 14:50:16 +* @Entity cn.hezhaohui.thumb.model.entity.Blog +*/ +public interface BlogMapper extends BaseMapper { + +} + + + + diff --git a/src/main/java/cn/hezhaohui/thumb/mapper/ThumbMapper.java b/src/main/java/cn/hezhaohui/thumb/mapper/ThumbMapper.java new file mode 100644 index 0000000..c99931a --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/mapper/ThumbMapper.java @@ -0,0 +1,18 @@ +package cn.hezhaohui.thumb.mapper; + +import cn.hezhaohui.thumb.model.entity.Thumb; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 23117 +* @description 针对表【thumb】的数据库操作Mapper +* @createDate 2025-10-18 14:51:00 +* @Entity cn.hezhaohui.thumb.model.entity.Thumb +*/ +public interface ThumbMapper extends BaseMapper { + +} + + + + diff --git a/src/main/java/cn/hezhaohui/thumb/mapper/UserMapper.java b/src/main/java/cn/hezhaohui/thumb/mapper/UserMapper.java new file mode 100644 index 0000000..952e960 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/mapper/UserMapper.java @@ -0,0 +1,18 @@ +package cn.hezhaohui.thumb.mapper; + +import cn.hezhaohui.thumb.model.entity.User; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 23117 +* @description 针对表【user】的数据库操作Mapper +* @createDate 2025-10-18 14:51:07 +* @Entity cn.hezhaohui.thumb.model.entity.User +*/ +public interface UserMapper extends BaseMapper { + +} + + + + diff --git a/src/main/java/cn/hezhaohui/thumb/model/entity/Blog.java b/src/main/java/cn/hezhaohui/thumb/model/entity/Blog.java new file mode 100644 index 0000000..d1c798f --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/model/entity/Blog.java @@ -0,0 +1,56 @@ +package cn.hezhaohui.thumb.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.Data; + +/** + * + * @TableName blog + */ +@TableName(value ="blog") +@Data +public class Blog { + /** + * id + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户 id + */ + private Long userid; + + /** + * 标题 + */ + private String title; + + /** + * 封面 + */ + private String coverimg; + + /** + * 内容 + */ + private String content; + + /** + * 点赞数 + */ + private Integer thumbcount; + + /** + * 创建时间 + */ + private Date createtime; + + /** + * 更新时间 + */ + private Date updatetime; +} \ No newline at end of file diff --git a/src/main/java/cn/hezhaohui/thumb/model/entity/Thumb.java b/src/main/java/cn/hezhaohui/thumb/model/entity/Thumb.java new file mode 100644 index 0000000..94b98ef --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/model/entity/Thumb.java @@ -0,0 +1,36 @@ +package cn.hezhaohui.thumb.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.util.Date; +import lombok.Data; + +/** + * + * @TableName thumb + */ +@TableName(value ="thumb") +@Data +public class Thumb { + /** + * id + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户 id + */ + private Long userid; + + /** + * 博客 id + */ + private Long blogid; + + /** + * 创建时间 + */ + private Date createtime; +} \ No newline at end of file diff --git a/src/main/java/cn/hezhaohui/thumb/model/entity/User.java b/src/main/java/cn/hezhaohui/thumb/model/entity/User.java new file mode 100644 index 0000000..79714ec --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/model/entity/User.java @@ -0,0 +1,25 @@ +package cn.hezhaohui.thumb.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * + * @TableName user + */ +@TableName(value ="user") +@Data +public class User { + /** + * id + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 用户名 + */ + private String username; +} \ No newline at end of file diff --git a/src/main/java/cn/hezhaohui/thumb/service/BlogService.java b/src/main/java/cn/hezhaohui/thumb/service/BlogService.java new file mode 100644 index 0000000..3a21580 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/BlogService.java @@ -0,0 +1,13 @@ +package cn.hezhaohui.thumb.service; + +import cn.hezhaohui.thumb.model.entity.Blog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 23117 +* @description 针对表【blog】的数据库操作Service +* @createDate 2025-10-18 14:50:16 +*/ +public interface BlogService extends IService { + +} diff --git a/src/main/java/cn/hezhaohui/thumb/service/ThumbService.java b/src/main/java/cn/hezhaohui/thumb/service/ThumbService.java new file mode 100644 index 0000000..a366e56 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/ThumbService.java @@ -0,0 +1,13 @@ +package cn.hezhaohui.thumb.service; + +import cn.hezhaohui.thumb.model.entity.Thumb; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 23117 +* @description 针对表【thumb】的数据库操作Service +* @createDate 2025-10-18 14:51:00 +*/ +public interface ThumbService extends IService { + +} diff --git a/src/main/java/cn/hezhaohui/thumb/service/UserService.java b/src/main/java/cn/hezhaohui/thumb/service/UserService.java new file mode 100644 index 0000000..8574132 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/UserService.java @@ -0,0 +1,13 @@ +package cn.hezhaohui.thumb.service; + +import cn.hezhaohui.thumb.model.entity.User; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 23117 +* @description 针对表【user】的数据库操作Service +* @createDate 2025-10-18 14:51:07 +*/ +public interface UserService extends IService { + +} diff --git a/src/main/java/cn/hezhaohui/thumb/service/impl/BlogServiceImpl.java b/src/main/java/cn/hezhaohui/thumb/service/impl/BlogServiceImpl.java new file mode 100644 index 0000000..b9fcddc --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/impl/BlogServiceImpl.java @@ -0,0 +1,22 @@ +package cn.hezhaohui.thumb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.hezhaohui.thumb.model.entity.Blog; +import cn.hezhaohui.thumb.service.BlogService; +import cn.hezhaohui.thumb.mapper.BlogMapper; +import org.springframework.stereotype.Service; + +/** +* @author 23117 +* @description 针对表【blog】的数据库操作Service实现 +* @createDate 2025-10-18 14:50:16 +*/ +@Service +public class BlogServiceImpl extends ServiceImpl + implements BlogService{ + +} + + + + diff --git a/src/main/java/cn/hezhaohui/thumb/service/impl/ThumbServiceImpl.java b/src/main/java/cn/hezhaohui/thumb/service/impl/ThumbServiceImpl.java new file mode 100644 index 0000000..ddcbbb6 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/impl/ThumbServiceImpl.java @@ -0,0 +1,22 @@ +package cn.hezhaohui.thumb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.hezhaohui.thumb.model.entity.Thumb; +import cn.hezhaohui.thumb.service.ThumbService; +import cn.hezhaohui.thumb.mapper.ThumbMapper; +import org.springframework.stereotype.Service; + +/** +* @author 23117 +* @description 针对表【thumb】的数据库操作Service实现 +* @createDate 2025-10-18 14:51:00 +*/ +@Service +public class ThumbServiceImpl extends ServiceImpl + implements ThumbService{ + +} + + + + diff --git a/src/main/java/cn/hezhaohui/thumb/service/impl/UserServiceImpl.java b/src/main/java/cn/hezhaohui/thumb/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..caff796 --- /dev/null +++ b/src/main/java/cn/hezhaohui/thumb/service/impl/UserServiceImpl.java @@ -0,0 +1,22 @@ +package cn.hezhaohui.thumb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import cn.hezhaohui.thumb.model.entity.User; +import cn.hezhaohui.thumb.service.UserService; +import cn.hezhaohui.thumb.mapper.UserMapper; +import org.springframework.stereotype.Service; + +/** +* @author 23117 +* @description 针对表【user】的数据库操作Service实现 +* @createDate 2025-10-18 14:51:07 +*/ +@Service +public class UserServiceImpl extends ServiceImpl + implements UserService{ + +} + + + + diff --git a/src/main/resources/mapper/BlogMapper.xml b/src/main/resources/mapper/BlogMapper.xml new file mode 100644 index 0000000..0071da9 --- /dev/null +++ b/src/main/resources/mapper/BlogMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + id,userId,title,coverImg,content,thumbCount, + createTime,updateTime + + diff --git a/src/main/resources/mapper/ThumbMapper.xml b/src/main/resources/mapper/ThumbMapper.xml new file mode 100644 index 0000000..b2d3f86 --- /dev/null +++ b/src/main/resources/mapper/ThumbMapper.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + id,userId,blogId,createTime + + diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml new file mode 100644 index 0000000..7935da6 --- /dev/null +++ b/src/main/resources/mapper/UserMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + id,username + +