template

package
v1.10.46 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Imports = `` /* 364-byte string literal not displayed */

	ImportsNoCache = `` /* 275-byte string literal not displayed */

)
View Source
var Delete = `` /* 251-byte string literal not displayed */
View Source
var DeleteMethod = `Delete( condition map[string]interface{} ) error`
View Source
var Error = `package {{.pkg}}

import "github.com/sjclijie/go-zero/core/stores/sqlx"

var ErrNotFound = sqlx.ErrNotFound
`
View Source
var Field = `{{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}}`
View Source
var FindList = `` /* 307-byte string literal not displayed */

通过id查询

View Source
var FindListMethod = `QueryList( condition map[string]interface{} ) ( []*{{.upperStartCamelObject}}, error)`
View Source
var FindOne = `` /* 299-byte string literal not displayed */

通过id查询

View Source
var FindOneByField = `` /* 1118-byte string literal not displayed */

通过指定字段查询

View Source
var FindOneByFieldExtraMethod = `` /* 155-byte string literal not displayed */
View Source
var FindOneByFieldMethod = `FindOneBy{{.upperField}}({{.in}}) (*{{.upperStartCamelObject}}, error) `
View Source
var FindOneMethod = `Query( condition map[string]interface{} ) ( *{{.upperStartCamelObject}}, error)`
View Source
var Insert = `` /* 161-byte string literal not displayed */
View Source
var InsertMethod = `Insert(data *{{.upperStartCamelObject}}) (int64,error)`
View Source
var Model = `package {{.pkg}}
{{.imports}}
{{.vars}}
{{.types}}
{{.new}}
{{.insert}}
{{.find}}
{{.update}}
{{.delete}}
{{.extraMethod}}
`
View Source
var New = `` /* 738-byte string literal not displayed */
View Source
var Tag = "`gorm:\"column:{{.field}}{{if .nullAble}};default:{{.defaultValue}}{{end}}\"`"
View Source
var Types = `` /* 223-byte string literal not displayed */
View Source
var Update = `` /* 235-byte string literal not displayed */
View Source
var UpdateMethod = `Update(condition map[string]interface{}, data *{{.upperStartCamelObject}})(int64, error)`
View Source
var Vars = fmt.Sprintf(`
var (
	{{.lowerStartCamelObject}}FieldNames          = builderx.RawFieldNames(&{{.upperStartCamelObject}}{})
	{{.lowerStartCamelObject}}Rows                = strings.Join({{.lowerStartCamelObject}}FieldNames, ",")
	{{.lowerStartCamelObject}}RowsExpectAutoSet   = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}",{{end}} "%screate_time%s", "%supdate_time%s"), ",")
	{{.lowerStartCamelObject}}RowsWithPlaceHolder = strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", "%screate_time%s", "%supdate_time%s"), "=?,") + "=?"

	{{if .withCache}}{{.cacheKeys}}{{end}}
	{{.lowerStartCamelObject}}TableName = "{{.tableName}}"
)
`, "`", "`", "`", "`", "`", "`", "`", "`")

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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