fix inner type generate error (#377)

* fix point type bug

* optimized

* fix inner type error
This commit is contained in:
kingxt
2021-01-13 11:54:53 +08:00
committed by GitHub
parent cf3a1020b0
commit 9cd2015661
8 changed files with 92 additions and 54 deletions

View File

@@ -8,8 +8,11 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/util"
)
const bodyTagKey = "json"
const formTagKey = "form"
const (
bodyTagKey = "json"
formTagKey = "form"
defaultSummaryKey = "summary"
)
var definedKeys = []string{bodyTagKey, formTagKey, "path"}
@@ -155,7 +158,12 @@ func (t DefineStruct) GetNonBodyMembers() []Member {
}
func (r Route) JoinedDoc() string {
return strings.Join(r.Docs, " ")
doc := r.AtDoc.Text
if r.AtDoc.Properties != nil {
doc += r.AtDoc.Properties[defaultSummaryKey]
}
doc += strings.Join(r.Docs, " ")
return strings.TrimSpace(doc)
}
func (r Route) GetAnnotation(key string) string {

View File

@@ -61,6 +61,7 @@ type (
ResponseType Type
Docs Doc
Handler string
AtDoc AtDoc
}
Service struct {
@@ -109,4 +110,9 @@ type (
RawName string
Type Type
}
AtDoc struct {
Properties map[string]string
Text string
}
)