crud

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FunTemplate added in v1.3.6

func FunTemplate() string

FunTemplate .

func FunTemplatePackage added in v1.3.6

func FunTemplatePackage() string

FunTemplatePackage .

func PoDefContent added in v1.8.0

func PoDefContent() string

PoDefContent .

Types

type Generate added in v1.8.3

type Generate struct {
	// contains filtered or unexported fields
}

Generate .

func NewGenerate added in v1.8.3

func NewGenerate() *Generate

NewGenerate .

func (*Generate) Dsn added in v1.8.3

func (t *Generate) Dsn(d string) *Generate

Dsn .

func (*Generate) RunDsn added in v1.8.3

func (t *Generate) RunDsn() (result []ObjectContent, e error)

RunDsn .

func (*Generate) RunJSON added in v1.8.3

func (t *Generate) RunJSON(jsonFileName string) (result []ObjectContent, e error)

RunJSON .

func (*Generate) SetPrefix added in v1.8.3

func (t *Generate) SetPrefix(prefix string) *Generate

SetPrefix .

type Method added in v1.8.3

type Method struct {
	ObjectName   string //结构体名称
	Name         string //方法名称 GoodsName
	VariableType string //类型 int|string
	Variable     string //goodsName
	Column       string //列名 Column id | goods_name
}

Method .

func (obj *{{.ObjectName}}) Set{{.Name}} ({{.Variable}} {{.VariableType}}) {
	obj.{{.Name}} = {{.Variable}}
	obj.setChanges("{{.Column}}", {{.Variable}})
}

{{ end }}

type ObjectContent added in v1.8.3

type ObjectContent struct {
	Name          string   //结构体名称
	TableRealName string   //表名
	Content       string   //结构体内容
	PrimaryType   string   //主键类型
	PrimaryName   string   //主键名称
	SetMethods    []Method //set的方法
	AddMethods    []Method //add的方法
}

ObjectContent .

Jump to

Keyboard shortcuts

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