{"repo":"farseer-go/webapi","free":true,"listed":false,"github":"https://github.com/farseer-go/webapi","clone":"git clone https://github.com/farseer-go/webapi.git","description":"用于快速构建api服务，带来极简、优雅的开发体验。编写api服务时，不需要使用httpRequest、httpResponse等数据结构。","language":"Go","stars":74,"topics":["controller","action","model","mvc","api","webapi"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"webapi 概述 包： \"github.com/farseer-go/webapi\" 模块： webapi.Module - Document - English - 中文 - English - Source - github 用于快速构建api服务，带来极简、优雅的开发体验。编写api服务时，不需要使用httpRequest、httpResponse等数据结构。 webapi使用了中间件的管道模型编写，让我们加入非业务逻辑时非常简单。 包含两种风格来提供API服务： - MinimalApi ：动态API风格（直接绑定到逻辑层） - Mvc ：Controller、Action风格 使用minimalApi时，甚至不需要UI层来提供API服务。 webapi有哪些功能 - 支持中间件 - 入参、出参隐式绑定 - 支持静态目录绑定 - ActionFilter过虑器 - ActionResult抽象结果 - Area区域设置 - MinimalApi模式 - Mvc模式 - HttpContext上下文 - Header隐式绑定 大部份情况下，除了main需要配置webapi路由外，在你的api handle中就是一个普通的func函数，不需要依赖webapi组件。webapi会根据 func函数 的 出入参 来 隐式绑定数据 。 函数中， 出入参都会自动绑定数据 如果是 application/json ，则会自动被反序列化成model，如果是 x-www-form-urlencoded ，则会将每一项的key/value匹配到model字段中 可以看到，整个过程， 不需要 做 json序列化 、 httpRequest 、 httpResponse 的操作。","default_branch":null,"files":null,"tree":[],"storefront":"/r/farseer-go","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/farseer-go/webapi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}