other: 配置导出 Golang 结构体注释优化
This commit is contained in:
parent
130869af4e
commit
9349e3cdbe
|
@ -38,7 +38,7 @@ func (slf *Xlsx) GetDisplayName() string {
|
|||
}
|
||||
|
||||
func (slf *Xlsx) GetDescription() string {
|
||||
return "暂无描述"
|
||||
return slf.GetDisplayName()
|
||||
}
|
||||
|
||||
func (slf *Xlsx) GetIndexCount() int {
|
||||
|
@ -57,10 +57,10 @@ func (slf *Xlsx) GetFields() []pce.DataField {
|
|||
}
|
||||
field = pce.DataField{
|
||||
Index: index,
|
||||
Name: strings.ReplaceAll(strings.ReplaceAll(str.FirstUpper(name.String()), "\r", ""), "\n", ""),
|
||||
Name: strings.ReplaceAll(strings.ReplaceAll(str.FirstUpper(name.String()), "\r", " "), "\n", " "),
|
||||
Type: fieldType.String(),
|
||||
ExportType: exportType.String(),
|
||||
Desc: strings.ReplaceAll(strings.ReplaceAll(desc.String(), "\r", ""), "\n", ""),
|
||||
Desc: strings.ReplaceAll(strings.ReplaceAll(desc.String(), "\r", " "), "\n", " "),
|
||||
}
|
||||
if len(field.Name) == 0 || len(field.Type) == 0 || len(field.ExportType) == 0 {
|
||||
return field, false
|
||||
|
|
|
@ -34,7 +34,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
|
||||
const (
|
||||
{{- range .Templates}}
|
||||
{{.Name}}Sign Sign = "{{.Name}}"
|
||||
{{.Name}}Sign Sign = "{{.Name}}" // {{.Desc}}
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
|
@ -52,7 +52,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
var (
|
||||
{{- range .Templates}}
|
||||
{{- if $.HasIndex .}}
|
||||
{{.Name}} {{$.GetVariable .}}
|
||||
{{.Name}} {{$.GetVariable .}} // {{.Desc}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
)
|
||||
|
@ -60,7 +60,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
var (
|
||||
{{- range .Templates}}
|
||||
{{- if $.HasIndex .}}{{- else}}
|
||||
{{.Name}} *{{$.GetConfigName .}}
|
||||
{{.Name}} *{{$.GetConfigName .}} // {{.Desc}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
)
|
||||
|
@ -68,7 +68,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
var (
|
||||
{{- range .Templates}}
|
||||
{{- if $.HasIndex .}}
|
||||
_{{.Name}} {{$.GetVariable .}}
|
||||
_{{.Name}} {{$.GetVariable .}} // {{.Desc}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
)
|
||||
|
@ -76,12 +76,13 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
var (
|
||||
{{- range .Templates}}
|
||||
{{- if $.HasIndex .}}{{- else}}
|
||||
_{{.Name}} *{{$.GetConfigName .}}
|
||||
_{{.Name}} *{{$.GetConfigName .}} // {{.Desc}}
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
{{- range .Templates}}
|
||||
// {{$.GetConfigName .}} {{.Desc}}
|
||||
type {{$.GetConfigName .}} struct {
|
||||
{{- range .Fields}}
|
||||
{{- if .IsSlice}}
|
||||
|
@ -110,6 +111,7 @@ func (slf *Golang) Render(templates ...*pce.TmplStruct) (string, error) {
|
|||
|
||||
{{- range .Templates}}
|
||||
{{- range .AllChildren}}
|
||||
// {{.Name}} {{.Desc}}
|
||||
type {{.Name}} struct {
|
||||
{{- range .Fields}}
|
||||
{{- if .IsSlice}}
|
||||
|
|
Loading…
Reference in New Issue