Firefly 4.9.1 正式版发布,新增项目脚手架生成器

栏目: 后端 · 前端 · 发布时间: 6年前

内容简介:Firefly 4.9.1 正式版新增了 OAuth2 APIs、项目脚手架生成器、CORSHandler、AsyncWebJarHandler,并修复了一些bug。项目脚手架生成器可以通过命令一键生成 Firefly Kotlin web 项目。例如:这个命令在当前目录创建了一个 Firefly Kotlin web 项目。然后在 IDE 中导入 abc-haha 目录即可运行改项目。详细命令说明请参考

Firefly 4.9.1 正式版新增了 OAuth2 APIs、项目脚手架生成器、CORSHandler、AsyncWebJarHandler,并修复了一些bug。

项目脚手架生成器

项目脚手架生成器可以通过命令一键生成 Firefly Kotlin web 项目。例如:

fireflyCli -g com.test.abc -a abc-haha -p com.test.abc -d www.abc.com -j www.abc.com

这个命令在当前目录创建了一个 Firefly Kotlin web 项目。然后在 IDE 中导入 abc-haha 目录即可运行改项目。详细命令说明请参考 CLI文档

OAuth2 APIs

这个版本新增了 OAuths2 协议支持,支持OAuth2四种授权模式(Authorization Code Grant, Implicit Grant, Resource Owner Password Credentials Grant, 和 Client Credentials Grant),详细说明参考 OAuth2文档

CORS handler

新增的 CORSHandler 方便Firefly web项目提供跨域访问设置。例如:

CORSConfiguration config = new CORSConfiguration();
config.setAllowOrigins(new HashSet<>(Arrays.asList("http://foo.com", "http://bar.com")));
config.setExposeHeaders(Arrays.asList("a1", "a2"));
config.setAllowHeaders(new HashSet<>(Arrays.asList("a1", "a2", "a3", "a4")));
CORSHandler corsHandler = new CORSHandler();
corsHandler.setConfiguration(config);

HTTP2ServerBuilder s = $.httpServer();

s.router().path("/cors/*").handler(corsHandler)
 .router().path("/cors/foo").handler(ctx -> ctx.end("foo"))
 .router().path("/cors/bar").handler(ctx -> {
    JsonObject jsonObject = ctx.getJsonObjectBody();
    Map<String, Object> map = new HashMap<>(jsonObject);
    map.put("bar", "x1");
    ctx.writeJson(map).end();
})
 .listen(host, port);

更新日志:

  1. 新增 OAuth2 APIs

  2. 新增 CLI 代码生成器

  3. 新增 AsyncWebJarHandler

  4. 新增 JsonProperty Annotation 用来映射 json 字段和 javabean 中的字段

  5. HTTP, WebSocket, and DB Kotlin asynchronous APIs 新增 timeout 参数

  6. 新增 CORSHandler

  7. RoutingContext 新增 createSession 方法

  8. RoutingContext 新增 asyncNext suspend 方法

  9. 新增图像处理组件

  10. 修正网络框架输出很大的数据时数据错乱问题

  11. 修正 JsonStringReader.readLong() 读取空白字符串异常问题


以上所述就是小编给大家介绍的《Firefly 4.9.1 正式版发布,新增项目脚手架生成器》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Programming Computer Vision with Python

Programming Computer Vision with Python

Jan Erik Solem / O'Reilly Media / 2012-6-22 / USD 39.99

If you want a basic understanding of computer vision's underlying theory and algorithms, this hands-on introduction is the ideal place to start. As a student, researcher, hacker, or enthusiast, you'll......一起来看看 《Programming Computer Vision with Python》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试