This commit is contained in:
xxjwxc
2020-04-05 00:06:59 +08:00
parent e871af0822
commit dac863cdb3
2 changed files with 6 additions and 1 deletions

View File

@@ -97,7 +97,7 @@ func (m *model) GenMarkdown(outPath string) {
sub.Methods = v1.Methods
sub.Note = v1.Note
sub.RouterPath = buildRelativePath(m.Group, v1.RouterPath)
sub.RouterPath = buildRelativePath(myswagger.GetHost(), buildRelativePath(m.Group, v1.RouterPath))
tmp.Item = append(tmp.Item, sub)
}
jsonsrc := doc.GenMarkdown(tmp)

View File

@@ -30,6 +30,11 @@ func SetHost(h string) {
host = h
}
// GetHost 获取host
func GetHost() string {
return schemes[0] + "://" + host
}
// SetBasePath set basePath
func SetBasePath(b string) {
if !strings.HasPrefix(b, "/") {