新增接口: BaseRepository

This commit is contained in:
jiangdingxuan 2024-01-08 10:26:14 +08:00
parent cddb02d8cd
commit 0c6fbae438
2 changed files with 22 additions and 0 deletions

View File

@ -17,4 +17,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package net.rzdata.demo.trait;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public abstract class BaseRepository<T, M extends BaseMapper<T>> {
private final transient M mapper;
public BaseRepository(M mapper) {
this.mapper = mapper;
}
public M get() {
return this.mapper;
}
}