|
|
|
@ -567,7 +567,7 @@ public interface UserRepository extends JpaRepository<UserEntity, Long> { |
|
|
|
|
|
|
|
|
|
|
|
1. 使用映射接口转换Entity和DTO:在Service中注入UserRepository和UserMapper后,就可以使用它们来转换Entity和DTO对象了。示例代码如下: |
|
|
|
1. 使用映射接口转换Entity和DTO:在Service中注入UserRepository和UserMapper后,就可以使用它们来转换Entity和DTO对象了。示例代码如下: |
|
|
|
|
|
|
|
|
|
|
|
``` |
|
|
|
```java |
|
|
|
Copy code |
|
|
|
Copy code |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class UserServiceImpl implement UserService { |
|
|
|
public class UserServiceImpl implement UserService { |
|
|
|
|