1 Star 1 Fork 2

kristas / booting-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
def.go 771 Bytes
一键复制 编辑 原始数据 按行查看 历史
kristas 提交于 2021-04-27 14:30 . feat: add open-api
package controller
import (
"fmt"
"reflect"
)
const (
Path = "path"
Query = "query"
Body = "body"
Header = "header"
Form = "form"
Multipart = "multipart"
Context = "context"
Request = "request"
Response = "response"
App = "app"
)
const (
GET = "GET"
POST = "POST"
PUT = "PUT"
PATCH = "PATCH"
DELETE = "DELETE"
)
var (
methodDefine = []string{GET, POST, PUT, PATCH, DELETE}
sourceDefine = []string{Path, Query, Body, Form, Header, Multipart, Context, Request, Response, App}
defaultSource = Query
)
type Param struct {
Name string
Source string
Type reflect.Type
}
func (r Param) String() string {
return fmt.Sprintf("Param:{name:%s, source:%s, type: %s}", r.Name, r.Source, r.Type.String())
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/kristas/booting-go.git
git@gitee.com:kristas/booting-go.git
kristas
booting-go
booting-go
v1.2.9

搜索帮助

344bd9b3 5694891 D2dac590 5694891