models

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Code generated by goal-cli. DO NOT EDIT. versions:

goal-cli v0.5.24
go       go1.23.2

updated_at: 2024-10-09 19:07:27 source: pro/Article.proto

Code generated by goal-cli. DO NOT EDIT. versions:

goal-cli v0.5.24
go       go1.23.2

updated_at: 2024-10-09 19:07:27 source: pro/user.proto

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArticleMigrator added in v0.4.3

func ArticleMigrator() migrate.Migrator

func ArticleModelLocalKeyGetter added in v0.4.3

func ArticleModelLocalKeyGetter(key string) func(item *ArticleModel) any

func ArticleModelMultiRelationSetter added in v0.4.3

func ArticleModelMultiRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)

func ArticleModelRelationGetter added in v0.4.3

func ArticleModelRelationGetter[T any](query func() *table.Table[T], foreignKey string) func(keys []any) map[string][]any

func ArticleModelSingleRelationSetter added in v0.4.3

func ArticleModelSingleRelationSetter[T any](key contracts.RelationType) func(item *ArticleModel, value []any)

func ArticleModelThroughRelationGetter added in v0.4.3

func ArticleModelThroughRelationGetter[T any](query func() *table.Table[T], midTable, firstKey, secondKey, secondLocalKey string) func(keys []any) map[string][]any

func ArticleQuery

func ArticleQuery() *table.Table[ArticleModel]

func ArticleQueryWithExecutor added in v0.4.3

func ArticleQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[ArticleModel]

func UserAuthProvider added in v0.4.2

func UserAuthProvider(identify string) contracts.Authenticatable

func UserMigrator added in v0.4.2

func UserMigrator() migrate.Migrator

func UserModelLocalKeyGetter added in v0.4.2

func UserModelLocalKeyGetter(key string) func(item *UserModel) any

func UserModelMultiRelationSetter added in v0.4.2

func UserModelMultiRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)

func UserModelRelationGetter added in v0.4.2

func UserModelRelationGetter[T any](query func() *table.Table[T], foreignKey string) func(keys []any) map[string][]any

func UserModelSingleRelationSetter added in v0.4.2

func UserModelSingleRelationSetter[T any](key contracts.RelationType) func(item *UserModel, value []any)

func UserModelThroughRelationGetter added in v0.4.2

func UserModelThroughRelationGetter[T any](query func() *table.Table[T], midTable, firstKey, secondKey, secondLocalKey string) func(keys []any) map[string][]any

func UserQuery

func UserQuery() *table.Table[UserModel]

func UserQueryWithExecutor added in v0.4.2

func UserQueryWithExecutor(executor contracts.SqlExecutor) *table.Table[UserModel]

Types

type ArticleModel

type ArticleModel struct {
	Id uint32 `json:"id" db:"id;type:INT UNSIGNED;not null;primary key;AUTO_INCREMENT;"`

	Title string `json:"title" db:"title;type:VARCHAR(255);not null;"`

	CreatedAt string `json:"created_at" db:"created_at;type:timestamp;default CURRENT_TIMESTAMP;"`

	UpdatedAt string `json:"updated_at" db:"updated_at;type:timestamp;DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"`
	// contains filtered or unexported fields
}

ArticleModel @timestamps

func NewArticleModel added in v0.4.3

func NewArticleModel(fields contracts.Fields) *ArticleModel

func (*ArticleModel) Delete added in v0.4.3

func (model *ArticleModel) Delete() contracts.Exception

func (*ArticleModel) Except added in v0.4.3

func (model *ArticleModel) Except(keys ...string) contracts.Fields

func (*ArticleModel) Exists added in v0.4.3

func (model *ArticleModel) Exists() bool

func (*ArticleModel) Get added in v0.4.3

func (model *ArticleModel) Get(key string) any

func (*ArticleModel) GetCreatedAt added in v0.4.3

func (model *ArticleModel) GetCreatedAt() string

func (*ArticleModel) GetId added in v0.4.3

func (model *ArticleModel) GetId() uint32

func (*ArticleModel) GetPrimaryKey added in v0.4.3

func (model *ArticleModel) GetPrimaryKey() any

func (*ArticleModel) GetTitle added in v0.4.3

func (model *ArticleModel) GetTitle() string

func (*ArticleModel) GetUpdatedAt added in v0.4.3

func (model *ArticleModel) GetUpdatedAt() string

func (*ArticleModel) Hidden added in v0.4.3

func (model *ArticleModel) Hidden(fields ...string) *ArticleModel

func (*ArticleModel) Only added in v0.4.3

func (model *ArticleModel) Only(key ...string) contracts.Fields

func (*ArticleModel) Refresh added in v0.4.3

func (model *ArticleModel) Refresh() contracts.Exception

func (*ArticleModel) Save added in v0.4.3

func (model *ArticleModel) Save() contracts.Exception

func (*ArticleModel) Set added in v0.4.3

func (model *ArticleModel) Set(fields contracts.Fields)

func (*ArticleModel) SetCreatedAt added in v0.4.3

func (model *ArticleModel) SetCreatedAt(value string)

func (*ArticleModel) SetId added in v0.4.3

func (model *ArticleModel) SetId(value uint32)

func (*ArticleModel) SetTitle added in v0.4.3

func (model *ArticleModel) SetTitle(value string)

func (*ArticleModel) SetUpdatedAt added in v0.4.3

func (model *ArticleModel) SetUpdatedAt(value string)

func (*ArticleModel) ToFields added in v0.4.3

func (model *ArticleModel) ToFields() contracts.Fields

func (*ArticleModel) Update added in v0.4.3

func (model *ArticleModel) Update(fields contracts.Fields) contracts.Exception

type ArticleStatic added in v0.4.3

type ArticleStatic struct {
	TableName       string
	Hidden          []string
	Indexes         []string
	With            []contracts.RelationType
	Appends         map[string]func(model *ArticleModel) any
	IdGetter        func(model *ArticleModel, raw uint32) uint32
	IdSetter        func(model *ArticleModel, raw uint32) uint32
	TitleGetter     func(model *ArticleModel, raw string) string
	TitleSetter     func(model *ArticleModel, raw string) string
	CreatedAtGetter func(model *ArticleModel, raw string) string
	CreatedAtSetter func(model *ArticleModel, raw string) string
	UpdatedAtGetter func(model *ArticleModel, raw string) string
	UpdatedAtSetter func(model *ArticleModel, raw string) string

	Saving           func(model *ArticleModel) contracts.Exception
	Saved            func(model *ArticleModel)
	Updating         func(model *ArticleModel, fields contracts.Fields) contracts.Exception
	Updated          func(model *ArticleModel, fields contracts.Fields)
	Deleting         func(model *ArticleModel) contracts.Exception
	Deleted          func(model *ArticleModel)
	PrimaryKeyGetter func(model *ArticleModel) any
}
var ArticleDefine ArticleStatic

type UserModel

type UserModel struct {
	Id int64 `json:"id" db:"id;type:BIGINT;not null;primary key;AUTO_INCREMENT;"`

	Name string `json:"name" db:"name;type:VARCHAR(255);not null;"`

	Avatar string `json:"avatar" db:"avatar;type:VARCHAR(255);not null;"`
	//@index
	//@goTag:db:"open_id;type:varchar(255);default 'xxasdasdsx'"
	OpenId string `db:"open_id;type:varchar(255);default 'xxasdasdsx'" json:"open_id"`

	WechatInfo *user.WechatInfoData `json:"wechat_info" db:"wechat_info;type:json;not null;"`

	Channel string `json:"channel" db:"channel;type:VARCHAR(255);not null;"`
	//@hidden
	Password string `json:"password" db:"password;type:VARCHAR(255);not null;"`

	CreatedAt string `json:"created_at" db:"created_at;type:timestamp;default CURRENT_TIMESTAMP;"`

	UpdatedAt string `json:"updated_at" db:"updated_at;type:timestamp;DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;"`
	// contains filtered or unexported fields
}

UserModel 用户注释 @authenticatable @timestamps

func NewUserModel added in v0.4.2

func NewUserModel(fields contracts.Fields) *UserModel

func (*UserModel) Delete added in v0.4.2

func (model *UserModel) Delete() contracts.Exception

func (*UserModel) Except added in v0.4.2

func (model *UserModel) Except(keys ...string) contracts.Fields

func (*UserModel) Exists added in v0.4.2

func (model *UserModel) Exists() bool

func (*UserModel) Get added in v0.4.2

func (model *UserModel) Get(key string) any

func (*UserModel) GetAuthenticatableKey added in v0.4.2

func (model *UserModel) GetAuthenticatableKey() string

func (*UserModel) GetAvatar added in v0.4.2

func (model *UserModel) GetAvatar() string

func (*UserModel) GetChannel added in v0.4.2

func (model *UserModel) GetChannel() string

func (*UserModel) GetCreatedAt added in v0.4.2

func (model *UserModel) GetCreatedAt() string

func (*UserModel) GetId added in v0.4.2

func (model *UserModel) GetId() int64

func (*UserModel) GetName added in v0.4.2

func (model *UserModel) GetName() string

func (*UserModel) GetOpenId added in v0.4.2

func (model *UserModel) GetOpenId() string

func (*UserModel) GetPassword added in v0.4.2

func (model *UserModel) GetPassword() string

func (*UserModel) GetPrimaryKey added in v0.4.2

func (model *UserModel) GetPrimaryKey() any

func (*UserModel) GetUpdatedAt added in v0.4.2

func (model *UserModel) GetUpdatedAt() string

func (*UserModel) GetWechatInfo added in v0.4.2

func (model *UserModel) GetWechatInfo() *user.WechatInfoData

func (*UserModel) Hidden added in v0.4.2

func (model *UserModel) Hidden(fields ...string) *UserModel

func (*UserModel) Only added in v0.4.2

func (model *UserModel) Only(key ...string) contracts.Fields

func (*UserModel) Refresh added in v0.4.2

func (model *UserModel) Refresh() contracts.Exception

func (*UserModel) Save added in v0.4.2

func (model *UserModel) Save() contracts.Exception

func (*UserModel) Set added in v0.4.2

func (model *UserModel) Set(fields contracts.Fields)

func (*UserModel) SetAvatar added in v0.4.2

func (model *UserModel) SetAvatar(value string)

func (*UserModel) SetChannel added in v0.4.2

func (model *UserModel) SetChannel(value string)

func (*UserModel) SetCreatedAt added in v0.4.2

func (model *UserModel) SetCreatedAt(value string)

func (*UserModel) SetId added in v0.4.2

func (model *UserModel) SetId(value int64)

func (*UserModel) SetName added in v0.4.2

func (model *UserModel) SetName(value string)

func (*UserModel) SetOpenId added in v0.4.2

func (model *UserModel) SetOpenId(value string)

func (*UserModel) SetPassword added in v0.4.2

func (model *UserModel) SetPassword(value string)

func (*UserModel) SetUpdatedAt added in v0.4.2

func (model *UserModel) SetUpdatedAt(value string)

func (*UserModel) SetWechatInfo added in v0.4.2

func (model *UserModel) SetWechatInfo(value *user.WechatInfoData)

func (*UserModel) ToFields added in v0.4.2

func (model *UserModel) ToFields() contracts.Fields

func (*UserModel) Update added in v0.4.2

func (model *UserModel) Update(fields contracts.Fields) contracts.Exception

type UserStatic added in v0.4.2

type UserStatic struct {
	TableName        string
	Hidden           []string
	Indexes          []string
	With             []contracts.RelationType
	Appends          map[string]func(model *UserModel) any
	IdGetter         func(model *UserModel, raw int64) int64
	IdSetter         func(model *UserModel, raw int64) int64
	NameGetter       func(model *UserModel, raw string) string
	NameSetter       func(model *UserModel, raw string) string
	AvatarGetter     func(model *UserModel, raw string) string
	AvatarSetter     func(model *UserModel, raw string) string
	OpenIdGetter     func(model *UserModel, raw string) string
	OpenIdSetter     func(model *UserModel, raw string) string
	WechatInfoGetter func(model *UserModel, raw *user.WechatInfoData) *user.WechatInfoData
	WechatInfoSetter func(model *UserModel, raw *user.WechatInfoData) *user.WechatInfoData
	ChannelGetter    func(model *UserModel, raw string) string
	ChannelSetter    func(model *UserModel, raw string) string
	PasswordGetter   func(model *UserModel, raw string) string
	PasswordSetter   func(model *UserModel, raw string) string
	CreatedAtGetter  func(model *UserModel, raw string) string
	CreatedAtSetter  func(model *UserModel, raw string) string
	UpdatedAtGetter  func(model *UserModel, raw string) string
	UpdatedAtSetter  func(model *UserModel, raw string) string

	Saving           func(model *UserModel) contracts.Exception
	Saved            func(model *UserModel)
	Updating         func(model *UserModel, fields contracts.Fields) contracts.Exception
	Updated          func(model *UserModel, fields contracts.Fields)
	Deleting         func(model *UserModel) contracts.Exception
	Deleted          func(model *UserModel)
	PrimaryKeyGetter func(model *UserModel) any
}
var UserDefine UserStatic

Directories

Path Synopsis
Code generated by goal-cli.
Code generated by goal-cli.

Jump to

Keyboard shortcuts

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