Chú thích & Mẫu hỗ trợ

Chú thích điều chỉnh suy luận của parser source và hình dạng mã được phân tích một cách ổn định.


Chú thích đã chọn

@SelectedRequestParam

query parameter의 key, defaultValue, required, nullable, type override

@SelectedRequestPath

path variable의 key, defaultValue, required, nullable, type override

@SelectedResponseBody

kiểu phản hồi và ghi đè nullable trong method/local/parameter

Mục tiêu chú thích

SelectedRequestParam

LOCAL_VARIABLE, PARAMETER

SelectedRequestPath

LOCAL_VARIABLE, PARAMETER

SelectedResponseBody

LOCAL_VARIABLE, PARAMETER, METHOD

Hình dạng route được khuyến nghị

java
return route()
    .nest(path("/api/member"), builder -> builder
        .nest(path("/search"), search -> search
            .GET("/get-list", accept(MediaType.APPLICATION_JSON), handler::getList)
            .GET("/get-detail/{id}", handler::getDetail))
        .POST("/create", handler::create))
    .build();

Hình dạng handler được khuyến nghị

java
public Mono<ServerResponse> getDetail(ServerRequest request) {
  String id = request.pathVariable("id");
  Mono<MemberResponse> response = service.getDetail(id);

  return ServerResponse.ok()
      .contentType(MediaType.APPLICATION_JSON)
      .body(response, MemberResponse.class);
}

Phạm vi hỗ trợ

© 2026 Byeolnaerim. Bảo lưu mọi quyền.Giới thiệuChính sách xử lý thông tin cá nhân