1 Star 0 Fork 24

zvty / pond

forked from 不行就再写一个 / pond 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
edwinyxc 提交于 2014-07-18 16:19 . add readme

Pond - 灵活,快速的web开发框架 (基于java 8)

Pond 由以下模块

  • pond-common - 底层库,包括快速开发使用的工具和一些函数式编程特性。
Map<Integer, String> testMap = map.hashMap(new Object[][]{
            {1, "one"}, {2, "two"}, {3, "weee"}, {4, "weee"}
    });
_for(testMap).map((s) -> s + "_new").each((entry) -> echo(entry.getValue()));

for (int i = 0; i < 100; i++) {
    testMap.put(i, String.valueOf(i));
}
_for(testMap).grep((entry) -> (entry.getKey() > 50)).each(S::echo);
  • pond-core - 框架核心
  • IOC 容器。
  • 一套完整灵活的api
  • 嵌入式http服务器 (test)
  • 来自express.js的中间件设计,从此远离传统aop
  • 自带logger
  • 基于正则的路由
  • 采用SPI,方便扩展

    Pond app = Pond.init().debug();
    Router router = new Router();
    router.get("/add", (req, resp) -> resp.send("add"))
            .get("/del", (req, resp) -> resp.send("del"));

    app.get("/", (req, resp) -> {
        resp.send("root");
    }).get("/${id}",
            (req, resp) -> resp.send(req.param("id"))
    ).get("/${id}/text", (req, resp) -> {
        resp.send(S.dump(req));
    }).use("/user", router);

    app.listen(8080);
  • pond-db - 数据库处理相关(默认提供mysql)
  • 简单的连接池
  • DB.fire 快速获取数据
  • Record 针对单表简单封装
  • RecordService 封装简单CURD

List<TestRecord> list =  DB.fire(this::createConnection,t ->
                                t.map(TestRecord.class,
                                "select * from t_crm_order"));
                                
echo(dump(_for(list).map(TestRecord::view).toList()));

###详情请参考项目内测试代码和注释 遇到坑了 ==>请联系 edwinyxc@gmail.com

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zvty/pond.git
git@gitee.com:zvty/pond.git
zvty
pond
pond
master

搜索帮助

Bbcd6f05 5694891 0cc6727d 5694891