generate_method

package
v0.0.0-...-c2da2d2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBeans

func GetBeans(param DbParam) map[string][]BeanColumn

func RemoveUnderscoreCapitalize

func RemoveUnderscoreCapitalize(str string) string

去掉下划线, 首字母大写 . ExtYidunConfig

func RemoveUnderscoreLowercase

func RemoveUnderscoreLowercase(str string) string

去掉下划线, 首字母不大写 . demo: extYidunConfig

func Run

func Run()

func WriteBean

func WriteBean(beanMap map[string][]BeanColumn, config *Config)

func WriteController

func WriteController(beanMap map[string][]BeanColumn, config *Config)

func WriteControllerRegister

func WriteControllerRegister(beanMap map[string][]BeanColumn)

func WriteDao

func WriteDao(beanMap map[string][]BeanColumn, config *Config)

func WriteDaoOneTableProjectId

func WriteDaoOneTableProjectId(beanMap map[string][]BeanColumn, config *Config)

func WriteService

func WriteService(beanMap map[string][]BeanColumn, config *Config)

Types

type BeanColumn

type BeanColumn struct {
	Name           string
	Type           string
	Ordinal        int
	COLUMN_COMMENT string
	COLUMN_TYPE    string
	TableConfig    TableConfig
}

type Columns

type Columns struct {
	TableName      string `gorm:"column:TABLE_NAME" json:"tableName"`
	ColumnName     string `gorm:"column:COLUMN_NAME" `
	DataType       string `gorm:"column:DATA_TYPE" `
	Ordinal        int    `gorm:"column:ORDINAL_POSITION" `
	COLUMN_COMMENT string `gorm:"column:COLUMN_COMMENT" `
	COLUMN_TYPE    string `gorm:"column:COLUMN_TYPE" `
}

type Config

type Config struct {
	BeanDir       string
	ServiceDir    string
	DaoDir        string
	ControllerDir string

	IsCoverController bool
}

type DbParam

type DbParam struct {
	User          string
	Password      string
	Host          string
	Port          string
	TableNameLike map[string]TableConfig
	TableSchema   []string
}

type TableConfig

type TableConfig struct {
	Type    string
	Ordinal int
}

Jump to

Keyboard shortcuts

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