scaffold

package
v0.0.0-...-95b0639 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApiTpl string
View Source
var ContentConfig string
View Source
var EmbedTplMap = map[string]string{
	"model":                        ModelTpl,
	"request":                      RequestTpl,
	"response":                     ResponseTpl,
	"repo":                         RepoTpl,
	"service":                      SrvTpl,
	"api":                          ApiTpl,
	"router":                       RouterTpl,
	"wire":                         WireTpl,
	"web/config/content.config.ts": ContentConfig,
	"web/config/modal.config.ts":   ModalConfig,
	"web/config/search.config.ts":  SearchConfig,
}
View Source
var ModalConfig string
View Source
var ModelTpl string
View Source
var RepoTpl string
View Source
var RequestTpl string
View Source
var ResponseTpl string
View Source
var RouterTpl string
View Source
var SearchConfig string
View Source
var Sql2structCmd = &cobra.Command{
	Use:   "gen",
	Short: "a structure tool that structure sql to golang gorm struct",
	Long:  "a golang gin gorm scaffold tool, generate file like ctrl, srv, request, model.",
	Run: func(cmd *cobra.Command, args []string) {
		run()
	},
}
View Source
var SqlTpl string
View Source
var SrvTpl string
View Source
var WireTpl string

Functions

func RequestValid

func RequestValid(field *Field) string

Types

type Field

type Field struct {
	Name          string `json:"name"`
	Type          string `json:"type"`
	Comment       string `json:"comment"`
	ColumnDefault string `json:"column_default"`
	StringMaxLen  int    `json:"string_max_len"`
	Valid         string `json:"valid"`
}

type ModelData

type ModelData struct {
	PackageName    string
	ApiPackage     string
	TableName      string
	FileName       string
	SnakeModelName string
	ModelName      string
	BaseModelName  string
	UrlPath        string
	TableComment   string `json:"table_comment"`
	SelfRef        bool   `json:"self_ref"`
	Fields         []*Field
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL