类 ResponseModule
java.lang.Object
org.ssssssss.magicapi.modules.servlet.ResponseModule
response模块
- 作者:
- mxd
-
嵌套类概要
嵌套类 -
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明添加Headerstatic org.springframework.http.ResponseEntity<?> 文件下载end()获取OutputStreamprivate MagicHttpServletResponseorg.springframework.http.ResponseEntity展示图片org.springframework.http.ResponseEntity<Object> 自定义json结果自行构建分页结果重定向设置headerorg.springframework.http.ResponseEntity输出文本
-
字段详细资料
-
resultProvider
-
-
构造器详细资料
-
ResponseModule
-
-
方法详细资料
-
download
@Comment("\u6587\u4ef6\u4e0b\u8f7d") public static org.springframework.http.ResponseEntity<?> download(@Comment(name="value",value="\u6587\u4ef6\u5185\u5bb9\uff0c\u5982`byte[]`") Object value, @Comment(name="filename",value="\u6587\u4ef6\u540d") String filename) throws UnsupportedEncodingException 文件下载- 参数:
value- 文件内容filename- 文件名- 抛出:
UnsupportedEncodingException
-
page
@Comment("\u8fd4\u56de\u81ea\u5b9a\u4e49\u5206\u9875\u7ed3\u679c") public Object page(@Comment(name="total",value="\u603b\u6761\u6570") long total, @Comment(name="values",value="\u5f53\u524d\u7ed3\u679c\u96c6") List<Map<String, Object>> values) 自行构建分页结果- 参数:
total- 条数values- 数据内容
-
json
@Comment("\u81ea\u5b9a\u4e49\u8fd4\u56dejson\u5185\u5bb9") public org.springframework.http.ResponseEntity<Object> json(@Comment(name="value",value="\u8fd4\u56de\u5bf9\u8c61") Object value) 自定义json结果- 参数:
value- json内容
-
addHeader
@Comment("\u6dfb\u52a0response header") public ResponseModule addHeader(@Comment(name="key",value="header\u540d") String key, @Comment(name="value",value="header\u503c") String value) 添加Header -
setHeader
@Comment("\u8bbe\u7f6eresponse header") public ResponseModule setHeader(@Comment(name="key",value="header\u540d") String key, @Comment(name="value",value="header\u503c") String value) 设置header -
getOutputStream
获取OutputStream- 抛出:
IOException- 从以下版本开始:
- 1.2.3
-
end
@Comment("\u7ec8\u6b62\u8f93\u51fa\uff0c\u6267\u884c\u6b64\u65b9\u6cd5\u540e\u4e0d\u4f1a\u5bf9\u7ed3\u679c\u8fdb\u884c\u4efb\u4f55\u8f93\u51fa\u53ca\u5904\u7406") public ResponseModule.NullValue end() -
getResponse
-
image
@Comment("\u8f93\u51fa\u56fe\u7247") public org.springframework.http.ResponseEntity image(@Comment(name="value",value="\u56fe\u7247\u5185\u5bb9\uff0c\u5982`byte[]`") Object value, @Comment(name="mime",value="\u56fe\u7247\u7c7b\u578b\uff0c\u5982`image/png`\u3001`image/jpeg`\u3001`image/gif`") String mime) 展示图片- 参数:
value- 图片内容mime- 图片类型,image/png,image/jpeg,image/gif
-
text
@Comment("\u8f93\u51fa\u6587\u672c") public org.springframework.http.ResponseEntity text(@Comment(name="text",value="\u6587\u672c\u5185\u5bb9") String text) 输出文本- 参数:
text- 文本内容
-
redirect
@Comment("\u91cd\u5b9a\u5411") public ResponseModule.NullValue redirect(@Comment(name="url",value="\u76ee\u6807\u7f51\u5740") String url) throws IOException 重定向- 参数:
url- 目标网址- 抛出:
IOException
-