2 Commits

Author SHA1 Message Date
KilLze
e1a4cb1d47 完成pojo数据库映射层(Entity)
增加lombok依赖
2025-12-17 20:27:59 +08:00
KilLze
b28b0dcb5e 增加mybatis配置项 2025-12-17 19:55:24 +08:00
6 changed files with 132 additions and 5 deletions

14
pom.xml
View File

@@ -26,12 +26,18 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mybatis</groupId> <groupId>org.projectlombok</groupId>
<artifactId>mybatis</artifactId> <artifactId>lombok</artifactId>
<version>3.5.19</version> <version>1.18.30</version>
<optional>true</optional>
</dependency> </dependency>
<!-- Added MyBatis Spring Boot Starter dependency -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.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;
}

View File

@@ -6,4 +6,11 @@ spring:
url: jdbc:mysql://114.55.250.24:3306/dating?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 url: jdbc:mysql://114.55.250.24:3306/dating?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username: root username: root
password: root password: root
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.bao.dating.pojo
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl