gen

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

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenExec

func GenExec(c *gin.Context)

GenExec 代码生成

func GenLogic

func GenLogic(ctx context.Context, model ReqModel) error

func GenerateFile

func GenerateFile(info map[string]interface{}, model ReqModel)

func TypeConversion

func TypeConversion(maps []map[string]interface{}, pkName string, t *TableStruct, model ReqModel) map[string]interface{}

TypeConversion: 字段处理

Types

type ReqModel

type ReqModel struct {
	Tables   string `json:"tables" binding:"required"`
	Mod      string `json:"mod"`      // 默认:tuanzicloud.com/cube
	Api      string `json:"api"`      // API文件存放路径,默认:apis
	Model    string `json:"model"`    // Model文件存放路径,默认:models
	Logic    string `json:"logic"`    // Logic文件存放路径: 默认:logics
	Entity   string `json:"entity"`   // Entity文件存放路径:默认:entities
	Module   string `json:"module"`   // 子模块文件夹,默认:空
	Excludes string `json:"excludes"` // modle中不需要的数据库字段:默认:UserPerms,OrgPerms,IsDeleted
}

type TableStruct

type TableStruct struct {
	zorm.EntityStruct
	TableName    string `column:"TABLE_NAME"`    //表名
	TableComment string `column:"TABLE_COMMENT"` //表注释
}

func (*TableStruct) GetPKColumnName

func (t *TableStruct) GetPKColumnName() string

func (*TableStruct) GetTableName

func (t *TableStruct) GetTableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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