feat:仓库初始化问题修复

This commit is contained in:
wangyu 2021-12-08 11:15:11 +08:00
parent b5884b4b86
commit 95a35c35b9
3 changed files with 8 additions and 23 deletions

View File

@ -1,14 +0,0 @@
package com.flyfish.framework.repository;
import com.flyfish.framework.domain.po.User;
import reactor.core.publisher.Mono;
/**
* 异步用户仓库
*
* @author wybab
*/
public interface ReactiveUserRepository extends DefaultReactiveRepository<User> {
Mono<User> findByUsername(String username);
}

View File

@ -1,15 +1,14 @@
package com.flyfish.framework.repository;
import com.flyfish.framework.domain.po.User;
import java.util.Optional;
import reactor.core.publisher.Mono;
/**
* 用户repo
* 异步用户仓库
*
* @author wangyu
* @author wybab
*/
public interface UserRepository extends DefaultRepository<User> {
public interface UserRepository extends DefaultReactiveRepository<User> {
/**
* 通过用户名密码查询用户
@ -18,7 +17,7 @@ public interface UserRepository extends DefaultRepository<User> {
* @param password 密码
* @return 结果
*/
Optional<User> findByUsernameAndPassword(String username, String password);
Mono<User> findByUsernameAndPassword(String username, String password);
/**
* 通过用户名查询
@ -26,5 +25,5 @@ public interface UserRepository extends DefaultRepository<User> {
* @param username 用户名
* @return 结果
*/
Optional<User> findByUsername(String username);
Mono<User> findByUsername(String username);
}

View File

@ -1,7 +1,7 @@
package com.flyfish.framework.service;
import com.flyfish.framework.domain.po.User;
import com.flyfish.framework.repository.ReactiveUserRepository;
import com.flyfish.framework.repository.UserRepository;
import com.flyfish.framework.service.impl.BaseReactiveServiceImpl;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
@ -22,7 +22,7 @@ public class UserService extends BaseReactiveServiceImpl<User> implements UserFi
*/
@Override
public Mono<User> findByUsername(String username) {
return ((ReactiveUserRepository) repository).findByUsername(username);
return ((UserRepository) repository).findByUsername(username);
}
}