🔄Update: MybatisX-Generator
This commit is contained in:
@@ -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<Blog> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<Thumb> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<User> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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<Blog> {
|
||||
|
||||
}
|
||||
@@ -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<Thumb> {
|
||||
|
||||
}
|
||||
@@ -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<User> {
|
||||
|
||||
}
|
||||
@@ -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<BlogMapper, Blog>
|
||||
implements BlogService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<ThumbMapper, Thumb>
|
||||
implements ThumbService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<UserMapper, User>
|
||||
implements UserService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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="cn.hezhaohui.thumb.mapper.BlogMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.hezhaohui.thumb.model.entity.Blog">
|
||||
<id property="id" column="id" />
|
||||
<result property="userid" column="userId" />
|
||||
<result property="title" column="title" />
|
||||
<result property="coverimg" column="coverImg" />
|
||||
<result property="content" column="content" />
|
||||
<result property="thumbcount" column="thumbCount" />
|
||||
<result property="createtime" column="createTime" />
|
||||
<result property="updatetime" column="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,userId,title,coverImg,content,thumbCount,
|
||||
createTime,updateTime
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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="cn.hezhaohui.thumb.mapper.ThumbMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.hezhaohui.thumb.model.entity.Thumb">
|
||||
<id property="id" column="id" />
|
||||
<result property="userid" column="userId" />
|
||||
<result property="blogid" column="blogId" />
|
||||
<result property="createtime" column="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,userId,blogId,createTime
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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="cn.hezhaohui.thumb.mapper.UserMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.hezhaohui.thumb.model.entity.User">
|
||||
<id property="id" column="id" />
|
||||
<result property="username" column="username" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,username
|
||||
</sql>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user