feat: add logout operation description and update schema annotations in LoginRequest

This commit is contained in:
2026-04-17 10:57:41 +08:00
parent f0a8006097
commit 17048104d9
2 changed files with 3 additions and 2 deletions
@@ -45,6 +45,7 @@ public class AuthController {
.body(UserResponse.from(user)); .body(UserResponse.from(user));
} }
@Operation(description = "退出登录")
@PostMapping("/logout") @PostMapping("/logout")
public ResponseEntity<Void> logout() { public ResponseEntity<Void> logout() {
var expiredCookie = cookieService.buildCookie(CookieName.ACCESS_TOKEN, "", Duration.ZERO); var expiredCookie = cookieService.buildCookie(CookieName.ACCESS_TOKEN, "", Duration.ZERO);
@@ -6,10 +6,10 @@ import jakarta.validation.constraints.NotBlank;
@Schema(description = "登录请求") @Schema(description = "登录请求")
public record LoginRequest( public record LoginRequest(
@NotBlank(message = "登录名称不能为空") @NotBlank(message = "登录名称不能为空")
@Schema(description = "用户名或电子邮箱") @Schema(description = "用户名或电子邮箱", requiredMode = Schema.RequiredMode.REQUIRED)
String principle, String principle,
@NotBlank(message = "登录口令不能为空") @NotBlank(message = "登录口令不能为空")
@Schema(description = "密码") @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED)
String credential String credential
) { ) {
} }