generate

package module
v0.0.0-...-3ed46fb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USERNAME = "root"
	PASSWORD = "123456"
	NETWORK  = "tcp"
	SERVER   = "127.0.0.1"
	PORT     = 3306
	DATABASE = "records?charset=utf8&parseTime=True&loc=Local"
)
View Source
const OUTPUT = "./output/"
View Source
const SUFFIX = ".java"
View Source
const TEMPLATE = "./template/"

Variables

View Source
var Config1 = struct {
	Entity string
	Db     struct {
		TableName string
	}
}{}
View Source
var ConfigYml = struct {
	Author  string
	Entity  string
	Package string
	Db      struct {
		Table    string
		Database string
		Host     string
		Port     int32
		User     string
		Password string
	}
	Templates []struct {
		Template string
	}
}{}

Functions

func ConnectMySql

func ConnectMySql()

func DataType

func DataType(columeType string) string

func FirstCapital

func FirstCapital(str string) string

func FirstLowerCase

func FirstLowerCase(str string) string

func GenTemplate

func GenTemplate()

func GetFileNameNoSuffix

func GetFileNameNoSuffix(s string) string

func Hump

func Hump(str string) string

func InitConfig

func InitConfig()

Types

type Assembly

type Assembly struct {
	Date                string
	Author              string
	EntityName          string
	LowercaseEntityName string
	TableName           string
	PackageName         string
	Fields              []Field
	Columns             []Columns
}

Final assembly block

type Column

type Column struct {
	ColumnName    string
	ColumnComment string
	DataType      string
}

func GetColumn

func GetColumn() []Column

type Columns

type Columns struct {
	Name     string
	TypeName string
	Comment  string
}

type Config

type Config struct {
	Table     string
	Entity    string
	MainClass string
	Database  string
	Url       string
	User      string
	Password  string
}

type Field

type Field struct {
	Name       string
	TypeName   string
	Comment    string
	ColumnName string
}

type Label

type Label struct {
	Name       string
	Id         uint64
	DeleteFlag uint32
}

type Tables

type Tables struct {
	TableName string
}

func GetTables

func GetTables() []Tables

Jump to

Keyboard shortcuts

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