command
Version:
v1.0.12
Opens a new window with list of versions in this module.
Published: Sep 19, 2020
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gensv
server路由代码生成
项目简介
自动生成server路由代码
支持以下功能:
- 定义http方法(get/post/put...)
- 定义请求路径
- 定义请求绑定方式(uri/header/query/json/xml/yaml)
- 记录日志trace id
- 自定义swagger summary
- 自定义接口版本号
使用方式:
- api.go文件中新增 以Server结束的interface
- 在api 文件夹中执行 go generate命令 将会生成相应的Server代码
注意:
swagger Param类型会根据bind进行猜测,若无bind将默认使用body,暂不支持定义form
定义了version的接口,将会根据version进行分组
注解参数:
名称 |
默认值 |
可用范围 |
说明 |
可选值 |
示例 |
summary |
根据方法名称生成 |
全部 |
swagger接口名 |
|
demo |
method |
get |
全部 |
http method |
get/post/put... |
get |
path |
根据方法名称生成 |
全部 |
请求路径 |
- |
/sayHello |
bind |
|
全部 |
请求参数绑定类型 |
uri/query/header/json/xml/yaml |
json |
version |
|
全部 |
接口版本号 |
- |
v1 |
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.