This commit is contained in:
@@ -12,7 +12,8 @@ import java.nio.*;
|
|||||||
import java.nio.channels.CompletionHandler;
|
import java.nio.channels.CompletionHandler;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.*;
|
||||||
|
import org.redkale.convert.Convert;
|
||||||
import org.redkale.convert.json.*;
|
import org.redkale.convert.json.*;
|
||||||
import org.redkale.net.http.*;
|
import org.redkale.net.http.*;
|
||||||
|
|
||||||
@@ -34,6 +35,9 @@ public interface HttpResponseDesc {
|
|||||||
//传入的CompletionHandler子类必须是public,且保证其子类可被继承且completed、failed可被重载且包含空参数的构造函数
|
//传入的CompletionHandler子类必须是public,且保证其子类可被继承且completed、failed可被重载且包含空参数的构造函数
|
||||||
public <H extends CompletionHandler> H createAsyncHandler(Class<H> handlerClass);
|
public <H extends CompletionHandler> H createAsyncHandler(Class<H> handlerClass);
|
||||||
|
|
||||||
|
//获取ByteBuffer生成器
|
||||||
|
public Supplier<ByteBuffer> getBufferSupplier();
|
||||||
|
|
||||||
//设置状态码
|
//设置状态码
|
||||||
public void setStatus(int status);
|
public void setStatus(int status);
|
||||||
|
|
||||||
@@ -80,9 +84,17 @@ public interface HttpResponseDesc {
|
|||||||
//将对象以JSON格式输出
|
//将对象以JSON格式输出
|
||||||
public void finishJson(Object obj);
|
public void finishJson(Object obj);
|
||||||
|
|
||||||
|
//将对象数组用Map的形式以JSON格式输出
|
||||||
|
//例如: finishMap("a",2,"b",3) 输出结果为 {"a":2,"b":3}
|
||||||
|
public void finishMapJson(final Object... objs);
|
||||||
|
|
||||||
//将对象以JSON格式输出
|
//将对象以JSON格式输出
|
||||||
public void finishJson(JsonConvert convert, Object obj);
|
public void finishJson(JsonConvert convert, Object obj);
|
||||||
|
|
||||||
|
//将对象数组用Map的形式以JSON格式输出
|
||||||
|
//例如: finishMap("a",2,"b",3) 输出结果为 {"a":2,"b":3}
|
||||||
|
public void finishMapJson(final JsonConvert convert, final Object... objs);
|
||||||
|
|
||||||
//将对象以JSON格式输出
|
//将对象以JSON格式输出
|
||||||
public void finishJson(Type type, Object obj);
|
public void finishJson(Type type, Object obj);
|
||||||
|
|
||||||
@@ -119,6 +131,15 @@ public interface HttpResponseDesc {
|
|||||||
//以指定响应码附带内容输出, message 可以为null
|
//以指定响应码附带内容输出, message 可以为null
|
||||||
public void finish(int status, String message);
|
public void finish(int status, String message);
|
||||||
|
|
||||||
|
//将结果对象输出
|
||||||
|
public void finish(final Object obj);
|
||||||
|
|
||||||
|
//将结果对象输出
|
||||||
|
public void finish(final Convert convert, final Object obj);
|
||||||
|
|
||||||
|
//将结果对象输出
|
||||||
|
public void finish(final Convert convert, final Type type, final Object obj);
|
||||||
|
|
||||||
//以304状态码输出
|
//以304状态码输出
|
||||||
public void finish304();
|
public void finish304();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user