fix inner type generate error (#377)
* fix point type bug * optimized * fix inner type error
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user