create

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOutPath = "./internal/repository/mysql"
	VersionText    = "数据库生成GORM Repository文件"
)

Variables

View Source
var CmdCreate = &cobra.Command{
	Use:     "create [type] [controller-name]",
	Short:   "Create a new ctl/logic/repo",
	Example: "kun create ctl user",
	Args:    cobra.ExactArgs(2),
	Run: func(cmd *cobra.Command, args []string) {

	},
}
View Source
var CmdCreateAll = &cobra.Command{
	Use:     "all",
	Short:   "Create a new controller & logic",
	Example: "kun create all user",
	Args:    cobra.ExactArgs(1),
	Run:     runCreate,
}
View Source
var CmdCreateController = &cobra.Command{
	Use:     "ctl",
	Short:   "Create a new controller",
	Example: "kun create ctl user",
	Args:    cobra.ExactArgs(1),
	Run:     runCreate,
}
View Source
var CmdCreateLogic = &cobra.Command{
	Use:     "logic",
	Short:   "Create a new logic",
	Example: "kun create logic user",
	Args:    cobra.ExactArgs(1),
	Run:     runCreate,
}
View Source
var CmdCreateRepository = &cobra.Command{
	Use:     "repo",
	Short:   "Create a new repository",
	Example: "kun create repo \"name:pwd@tcp(127.0.0.1:3306)/dbname\" [t1,t2|t1|*]",
	Args:    cobra.ExactArgs(2),
	Run:     genRepo,
}

Functions

This section is empty.

Types

type CmdParams

type CmdParams struct {
	DSN     string   // user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local
	Tables  []string // 输入所需的数据表或将其留空,留空数据库中所有的数据表
	OutPath string   // 指定输出目录
	Prefix  string   // 表前缀,不为空则model不包含前缀
	DBType  string   // 数据库类型
}

CmdParams is command line parameters

type Create

type Create struct {
	ProjectName        string
	CmdType            string
	CreateType         string
	FilePath           string
	FileName           string
	FileNameTitleLower string
	FileNameFirstChar  string
	PackageName        string
	IsFull             bool
}

func NewCreate

func NewCreate() *Create

type DBType

type DBType string

database type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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