feat:项目整合Sentinel完结

This commit is contained in:
haoxr 2021-04-30 01:02:43 +08:00
parent 23b271338f
commit f5e99abd41
3 changed files with 3 additions and 7 deletions

View File

@ -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);
} }
} }

View File

@ -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));

View File

@ -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();
} }