完成pojo数据库映射层(Entity)

增加lombok依赖
This commit is contained in:
KilLze
2025-12-17 20:27:59 +08:00
parent b28b0dcb5e
commit e1a4cb1d47
5 changed files with 121 additions and 0 deletions

View File

@@ -25,6 +25,13 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<optional>true</optional>
</dependency>
<!-- Added MyBatis Spring Boot Starter dependency --> <!-- Added MyBatis Spring Boot Starter dependency -->
<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>

View File

@@ -0,0 +1,33 @@
package com.bao.dating.pojo.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 动态表
* @author KilLze
*/
@Data
public class Post {
private Long postId;
private Long userId;
private String content;
private String mediaOssKeys;
private String location;
private Integer isPublic;
private Integer likeCount;
private Integer favoriteCount;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}

View File

@@ -0,0 +1,21 @@
package com.bao.dating.pojo.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 动态收藏表
* @author KilLze
*/
@Data
public class PostFavorite {
private Long favoriteId;
private Long userId;
private Long postId;
private LocalDateTime createdAt;
}

View File

@@ -0,0 +1,20 @@
package com.bao.dating.pojo.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 动态点赞表
* @author KilLze
*/
@Data
public class PostLike {
private Long likeId;
private Long userId;
private Long postId;
private LocalDateTime createdAt;
}

View File

@@ -0,0 +1,40 @@
package com.bao.dating.pojo.entity;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 用户表
* @author KilLze
*/
@Data
public class User {
private Long userId;
private String userName;
private String passwordHash;
private String salt;
private String nickname;
private String avatarUrl;
private String backgroundUrl;
private Integer gender;
private LocalDate birthday;
private String hobbies;
private String signature;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}