fix 代码生成-卡关字段功能

This commit is contained in:
yxh 2024-09-30 17:53:31 +08:00
parent 00428f540b
commit 70b54b5b1a

View File

@ -23,6 +23,7 @@ package controller
{{if ne .table.ModuleName "system"}} {{if ne .table.ModuleName "system"}}
{{$serviceVal = "systemService"}} {{$serviceVal = "systemService"}}
{{end}} {{end}}
{{$impSystemService := false}}
{{if or .table.ExcelPort .table.ExcelImp}} {{if or .table.ExcelPort .table.ExcelImp}}
{{$excel = true}} {{$excel = true}}
{{end}} {{end}}
@ -53,7 +54,7 @@ import (
{{if gt (len .table.LinkedTables) 0}} {{if gt (len .table.LinkedTables) 0}}
"errors" "errors"
{{if ne $.table.ModuleName "system"}} {{if ne $.table.ModuleName "system"}}
systemService "{{.goModName}}/internal/app/system/service" {{$impSystemService = true}}
{{else}} {{else}}
"{{.goModName}}/internal/app/system/service" "{{.goModName}}/internal/app/system/service"
{{end}} {{end}}
@ -82,6 +83,16 @@ import (
"{{$.goModName}}/library/libUtils" "{{$.goModName}}/library/libUtils"
"github.com/xuri/excelize/v2" "github.com/xuri/excelize/v2"
{{end}} {{end}}
{{if not $impSystemService}}
{{range $index,$column:= .table.Columns}}
{{if eq $column.HtmlType "switch"}}
{{$impSystemService = true}}
{{end}}
{{end}}
{{end}}
{{if $impSystemService}}
systemService "{{.goModName}}/internal/app/system/service"
{{end}}
) )
//// ////
type {{$structName}}Controller struct { type {{$structName}}Controller struct {