code_generate

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigHump

func BigHump(str string) string

BigHump 大驼峰

func ExistRemarkField

func ExistRemarkField(cfg *CodeGenConfig) bool

ExistRemarkField 是否存在备注字段

func ExistStatusField

func ExistStatusField(cfg *CodeGenConfig) bool

ExistStatusField 是否存在可用状态字段

func GenController

func GenController(cfg *CodeGenConfig, packageName string, sys bool) string

GenController 生成Controller

func GenDao

func GenDao(cfg *CodeGenConfig, packageName string, sys bool) string

GenDao 生成Dao

func GenEditVue

func GenEditVue(cfg *CodeGenConfig, packageName string) string

GenEditVue 生成编辑页Vue

func GenListVue

func GenListVue(cfg *CodeGenConfig, packageName string) string

GenListVue 生成列表页Vue

func GenPO

func GenPO(cfg *CodeGenConfig, packageName string, sys bool) string

GenPO 生成PO

func GenRouter

func GenRouter(cfg *CodeGenConfig, packageName string, sys bool) string

GenRouter 生成Router

func GenService

func GenService(cfg *CodeGenConfig, packageName string, sys bool) string

GenService 生成Service

func GoLangTypeMapping

func GoLangTypeMapping(fileName, dbType string) string

GoLangTypeMapping 数据库类型映射

func SmallHump

func SmallHump(str string) string

SmallHump 小驼峰

func WriteFile

func WriteFile(content, path, fileName string)

WriteFile 写文件

Types

type CodeGenConfig

type CodeGenConfig struct {
	TableName     string   `gorm:"column:TABLE_NAME"`
	TableComment  string   `gorm:"column:TABLE_COMMENT"`
	Fields        []Fields `gorm:"-"`
	StandardTable bool     `gorm:"-"`
	TargetPath    string   `gorm:"-"`
}

func GetCfg

func GetCfg(dsn string, tableName string) *CodeGenConfig

GetCfg 获取配置

type Fields

type Fields struct {
	FieldName    string `gorm:"column:COLUMN_NAME"`
	FieldType    string `gorm:"column:DATA_TYPE"`
	FieldComment string `gorm:"column:COLUMN_COMMENT"`
}

Jump to

Keyboard shortcuts

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