tools

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ColumnTemplate = "application/modules/generate/source/columns.ts"
View Source
const Out = "frontend/src/views"
View Source
const OutDir = "frontend/src/element"
View Source
const ViewTemplate = "application/modules/generate/source/template.vue"

Variables

This section is empty.

Functions

func FormatStr

func FormatStr(str string) string

func GenerateColumn

func GenerateColumn(table Table, fields []Field)

func GenerateView

func GenerateView(table Table, fields []Field)

func GetTableComment

func GetTableComment(comment string) string

func OpenFile

func OpenFile(filename string) (*os.File, error)

OpenFile 判断文件是否存在 存在则OpenFile 不存在则Create

func WriteFile

func WriteFile(fileName string, code string)

Types

type Field

type Field struct {
	ColumnName    string `json:"column_name"`
	DataType      string `json:"data_type"`
	ColumnComment string `json:"column_comment"`
}

type Table

type Table struct {
	Name    string `json:"Name,omitempty"`
	Comment string `json:"Comment,omitempty"`
}

Jump to

Keyboard shortcuts

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