我在 spring-security-jwt-guide 看到一个 看不懂的写法,其中AuthController
有如下代码:
/**
* @author shuang.kou
* @description 认证授权
**/
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor(onConstructor = @__(@Autowired)) //此处@__没看懂
@Api(tags = "认证")
public class AuthController {
private final AuthService authService;
@PostMapping("/login")
@ApiOperation("登录")
public ResponseEntity<Void> login(@RequestBody LoginRequest loginRequest) {
String token = authService.createToken(loginRequest);
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.set(SecurityConstants.TOKEN_HEADER, token);
return new ResponseEntity<>(httpHeaders, HttpStatus.OK);
}
@PostMapping("/logout")
@ApiOperation("退出")
public ResponseEntity<Void> logout() {
authService.removeToken();
return new ResponseEntity<>(HttpStatus.OK);
}
}
请问:
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
中的 @__
是什么意思?
lombok doc