models

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 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 00:56:11 source: pro/user.proto

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 UserModel

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

	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