mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
support multiple http methods
This commit is contained in:
parent
46fc9d75ae
commit
0099ef2f92
@ -707,7 +707,8 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
|
|||||||
controllerList[pkgpath+controllerName] = make(map[string]*swagger.Item)
|
controllerList[pkgpath+controllerName] = make(map[string]*swagger.Item)
|
||||||
item = &swagger.Item{}
|
item = &swagger.Item{}
|
||||||
}
|
}
|
||||||
switch HTTPMethod {
|
for _, hm := range strings.Split(HTTPMethod, ",") {
|
||||||
|
switch hm {
|
||||||
case "GET":
|
case "GET":
|
||||||
item.Get = &opts
|
item.Get = &opts
|
||||||
case "POST":
|
case "POST":
|
||||||
@ -723,6 +724,7 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
|
|||||||
case "OPTIONS":
|
case "OPTIONS":
|
||||||
item.Options = &opts
|
item.Options = &opts
|
||||||
}
|
}
|
||||||
|
}
|
||||||
controllerList[pkgpath+controllerName][routerPath] = item
|
controllerList[pkgpath+controllerName][routerPath] = item
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user