This commit is contained in:
xxj
2021-09-29 10:45:09 +08:00
parent 99247801b5
commit c93144cad6
2 changed files with 4 additions and 2 deletions

View File

@@ -26,5 +26,6 @@ type DocModel struct {
RouterPath string
Methods []string
Note string
MethodName string
Req, Resp *StructInfo
}

View File

@@ -24,7 +24,7 @@ func NewDoc(group string) *model {
}
// 添加一个
func (m *model) AddOne(group string, routerPath string, methods []string, note string, req, resp *StructInfo) {
func (m *model) AddOne(group, methodName, routerPath string, methods []string, note string, req, resp *StructInfo) {
if m.MP[group] == nil {
m.MP[group] = make(map[string]DocModel)
}
@@ -37,6 +37,7 @@ func (m *model) AddOne(group string, routerPath string, methods []string, note s
Note: note,
Req: req,
Resp: resp,
MethodName: methodName,
}
}
@@ -112,7 +113,7 @@ func (m *model) GenMarkdown(outPath string) {
sub.Methods = v1.Methods
sub.Note = v1.Note
sub.InterfaceName = v1.RouterPath
sub.InterfaceName = v1.MethodName
sub.RouterPath = buildRelativePath(myswagger.GetHost(), buildRelativePath(m.Group, v1.RouterPath))
tmp.Item = append(tmp.Item, sub)
}