code

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeModelList

func CodeModelList()

*@Author Administrator *@Date 9/4/2021 13:46 *@desc

func ControllerAdd

func ControllerAdd(SelectTableName string)

func ControllerDelete

func ControllerDelete(SelectTableName string)

*@Author Administrator *@Date 22/4/2021 15:49 *@desc

func ControllerDetail

func ControllerDetail(SelectTableName string)

*@Author Administrator *@Date 22/4/2021 15:53 *@desc

func ControllerEdit

func ControllerEdit(SelectTableName string)

func ControllerFile

func ControllerFile(SelectTableName string)

*@Author Administrator *@Date 9/4/2021 12:17 *@desc

func ControllerList

func ControllerList(SelectTableName string)

*@Author Administrator *@Date 22/4/2021 15:49 *@desc

func CreateMutiDir

func CreateMutiDir(filePath string) error

调用os.MkdirAll递归创建文件夹

func GetDadatase

func GetDadatase() string

*@Author Administrator *@Date 9/4/2021 13:40 *@desc

func ModeCode

func ModeCode(tableList []TableList, mysql *gorm.DB, mysqldb string, fileName *FileNameChange) string

*@Author Administrator *@Date 8/4/2021 14:44 *@desc

func ModeFiles

func ModeFiles(SelectTableName, st string)

*@Author Administrator *@Date 9/4/2021 12:51 *@desc

func ModePbFile

func ModePbFile(SelectTableName string, st string)

*@Author Administrator *@Date 13/4/2021 14:32 *@desc

func MysqlType

func MysqlType(name string) string

func MysqlTypeGrpc

func MysqlTypeGrpc(name string) string

func OneTable

func OneTable(mysql *gorm.DB, mysqldb, SelectTableName string, fileName *FileNameChange) string

*@Author Administrator *@Date 9/4/2021 13:27 *@desc

func RequestFile

func RequestFile(SelectTableName string)

func RouterFile

func RouterFile(SelectTableName string)

*@Author Administrator *@Date 9/4/2021 12:17 *@desc

func ServiceFile

func ServiceFile(SelectTableName string)

*@Author Administrator *@Date 9/4/2021 12:17 *@desc

Types

type Buffer

type Buffer struct {
	*bytes.Buffer
}

内嵌bytes.Buffer,支持连写

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Append

func (b *Buffer) Append(i interface{}) *Buffer

type FileNameChange

type FileNameChange struct {
}

func (*FileNameChange) Camel2Case

func (f *FileNameChange) Camel2Case(name string) string

驼峰式写法转为下划线写法

func (*FileNameChange) Case2Camel

func (f *FileNameChange) Case2Camel(name string) string

下划线写法转为驼峰写法

func (*FileNameChange) Lcfirst

func (f *FileNameChange) Lcfirst(str string) string

首字母小写

func (*FileNameChange) Ucfirst

func (f *FileNameChange) Ucfirst(str string) string

首字母大写

type Model

type Model struct {
	CreatedAt time.Time      `gorm:"column:created_at;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type TableInfo

type TableInfo struct {
	COLUMN_NAME    string
	IS_NULLABLE    string
	DATA_TYPE      string
	COLUMN_KEY     string
	EXTRA          string
	COLUMN_COMMENT string
}

type TableList

type TableList struct {
	TableName    string `json:"table_name" `
	TableComment string `json:"table_comment" `
}

func TableListAll

func TableListAll(mysqldb string) []TableList

*@Author Administrator *@Date 9/4/2021 13:38 *@desc

Jump to

Keyboard shortcuts

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