类 ResponseUtils

java.lang.Object
cn.herodotus.stirrup.web.core.reactive.utils.ResponseUtils

public class ResponseUtils extends Object

Description: WebFlux 响应工具类

作者:
: gengwei.zheng
Date:
: 2024/4/21 16:27
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static reactor.core.publisher.Mono<Void>
    renderError(org.springframework.web.server.ServerWebExchange exchange, cn.herodotus.stirrup.core.definition.domain.Feedback feedback, int status)
    响应中返回统一格式错误信息
    static reactor.core.publisher.Mono<Void>
    renderJson(org.springframework.http.server.reactive.ServerHttpResponse response, cn.herodotus.stirrup.core.definition.domain.Result<String> result)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • ResponseUtils

      public ResponseUtils()
  • 方法详细资料

    • renderJson

      public static reactor.core.publisher.Mono<Void> renderJson(org.springframework.http.server.reactive.ServerHttpResponse response, cn.herodotus.stirrup.core.definition.domain.Result<String> result)
    • renderError

      public static reactor.core.publisher.Mono<Void> renderError(org.springframework.web.server.ServerWebExchange exchange, cn.herodotus.stirrup.core.definition.domain.Feedback feedback, int status)
      响应中返回统一格式错误信息
      参数:
      exchange - 请求 ServerWebExchange
      feedback - 错误信息 Feedback
      status - 错误状态 HttpStatus
      返回:
      Mono