util

package
v0.0.0-...-9dac4f2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: BSD-2-Clause, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbPath

func AbPath(file string) string

func Execute

func Execute(param *TableWrapper, tpl string) (string, error)

func GenDao

func GenDao(dir, table string, tpl map[string]string) error

GenDao 生产dao,方便外部调用

func GenFile

func GenFile(kind string, baseParam *BaseParam, param *TableWrapper, format string) error

func GenParam

func GenParam(dir, project, table, tableName string) (*BaseParam, *TableWrapper)

func GetCurrentAbPath

func GetCurrentAbPath() string

GetCurrentAbPath 最终方案-全兼容

func GetCurrentAbPathByCaller

func GetCurrentAbPathByCaller(skip int) string

GetCurrentAbPathByCaller 获取当前执行文件绝对路径(go run)

func GetCurrentAbPathByExecutable

func GetCurrentAbPathByExecutable() string

GetCurrentAbPathByExecutable 获取当前执行文件绝对路径

func LowerCameName

func LowerCameName(s string) string

LowerCameName 小驼峰

func RegController

func RegController(fst *token.FileSet, f *ast.File, table string, regPath string) error

func RegRouter

func RegRouter(fst *token.FileSet, f *ast.File, parentName, table, regPath string) error

func RegService

func RegService(fst *token.FileSet, f *ast.File, table string, regPath string) error

func Strikethrough

func Strikethrough(s string) string

Strikethrough 中划线

func UpperCamelName

func UpperCamelName(s string) string

UpperCamelName 大驼峰

Types

type BaseParam

type BaseParam struct {
	Table   string
	Project string
	Dir     string
	Package string
}

type Conf

type Conf struct {
	ProjectName    string `yaml:"project_name"`
	ProjectAbsPath string `yaml:"project_abs_path"`
	Config         []config
	ProjectMode    string `yaml:"project_mode"`
}

func InitConf

func InitConf(path string) (*Conf, error)

InitConf 初识化配置

func InitConf2

func InitConf2(data string) (*Conf, error)

InitConf2 初识化配置,通过配置数据

type TableWrapper

type TableWrapper struct {
	// 表名称
	Name string
	// 小驼峰
	CamlName string
	// 大驼峰
	UpperCamlName string
	// 中划线
	MidlineName string
	// 包名
	Package string
	// 项目名
	ProjectName string
	// 反引号
	Backquote string
	// 表名称解释
	NameTrans string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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