feat: 系统和用户平台的接口中间层
This commit is contained in:
@@ -12,7 +12,7 @@ import org.wfc.common.core.constant.ServiceNameConstants;
|
||||
import org.wfc.common.core.domain.R;
|
||||
import org.wfc.system.api.domain.SysUser;
|
||||
import org.wfc.system.api.factory.RemoteUserFallbackFactory;
|
||||
import org.wfc.system.api.model.LoginUser;
|
||||
import org.wfc.common.core.domain.LoginUser;
|
||||
|
||||
/**
|
||||
* 用户服务
|
||||
@@ -30,7 +30,7 @@ public interface RemoteUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/user/info/{username}")
|
||||
public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
public R<LoginUser<SysUser>> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 注册用户信息
|
||||
|
||||
@@ -4,10 +4,10 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.wfc.common.core.domain.LoginUser;
|
||||
import org.wfc.common.core.domain.R;
|
||||
import org.wfc.system.api.RemoteUserService;
|
||||
import org.wfc.system.api.domain.SysUser;
|
||||
import org.wfc.system.api.model.LoginUser;
|
||||
|
||||
/**
|
||||
* 用户服务降级处理
|
||||
@@ -26,7 +26,7 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||
return new RemoteUserService()
|
||||
{
|
||||
@Override
|
||||
public R<LoginUser> getUserInfo(String username, String source)
|
||||
public R<LoginUser<SysUser>> getUserInfo(String username, String source)
|
||||
{
|
||||
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user