mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
feat:项目整合Sentinel完结
This commit is contained in:
parent
23b271338f
commit
f5e99abd41
@ -17,7 +17,7 @@ public class UserFeignFallbackClient implements UserFeignClient {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<UserDTO> getUserByUsername(String username) {
|
public Result<UserDTO> getUserByUsername(String username) {
|
||||||
log.error("Feign远程调用服务发生故障,获取用户信息失败降级");
|
log.error("feign远程调用系统用户服务异常后的降级方法");
|
||||||
return Result.failed(ResultCode.DEGRADATION);
|
return Result.failed(ResultCode.DEGRADATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,11 +142,7 @@ public class UserController extends BaseController {
|
|||||||
@ApiOperation(value = "根据用户名获取用户信息")
|
@ApiOperation(value = "根据用户名获取用户信息")
|
||||||
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "path", dataType = "String")
|
@ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "path", dataType = "String")
|
||||||
@GetMapping("/username/{username}")
|
@GetMapping("/username/{username}")
|
||||||
public Result getUserByUsername(
|
public Result getUserByUsername(@PathVariable String username) {
|
||||||
@PathVariable String username
|
|
||||||
) {
|
|
||||||
log.info("进入getUserByUsername方法");
|
|
||||||
int i = 1 / 0;
|
|
||||||
SysUser user = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
|
SysUser user = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
|
||||||
.eq(SysUser::getUsername, username));
|
.eq(SysUser::getUsername, username));
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public AuthenticationManager authenticationManager() throws Exception {
|
public AuthenticationManager authenticationManagerBean() throws Exception {
|
||||||
return super.authenticationManagerBean();
|
return super.authenticationManagerBean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user