model

package
v0.0.0-...-59ce3e0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "UNKNOWN",
		1: "PENDING",
	}
	Status_value = map[string]int32{
		"UNKNOWN": 0,
		"PENDING": 1,
	}
)

Enum value maps for Status.

View Source
var File_model_proto protoreflect.FileDescriptor

Functions

func Scan

func Scan(data any, value any) error

Scan for scanner helper

func UserModelAddress

func UserModelAddress(x string) mysqlx.Option

func UserModelId

func UserModelId(x int32) mysqlx.Option

func UserModelName

func UserModelName(x string) mysqlx.Option

func Value

func Value(data any) (any, error)

Value for valuer helper

Types

type Status

type Status int32
const (
	Status_UNKNOWN Status = 0
	Status_PENDING Status = 1
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type User

type User struct {
	Id          int32                `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name        string               `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Email       string               `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Address     string               `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
	Phone       string               `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"`
	Score       float32              `protobuf:"fixed32,6,opt,name=score,proto3" json:"score,omitempty"`
	Balance     float64              `protobuf:"fixed64,7,opt,name=balance,proto3" json:"balance,omitempty"`
	CreateTime  *timestamp.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	UpdateTime  *timestamp.Timestamp `protobuf:"bytes,9,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
	DeletedTime *timestamp.Timestamp `protobuf:"bytes,11,opt,name=deleted_time,json=deletedTime,proto3" json:"deleted_time,omitempty"`
	Date        *timestamp.Timestamp `protobuf:"bytes,10,opt,name=date,proto3" json:"date,omitempty"`
	Extra       []byte               `protobuf:"bytes,12,opt,name=extra,proto3" json:"extra,omitempty"`
	Author      *User_Author         `protobuf:"bytes,13,opt,name=author,proto3" json:"author,omitempty"`
	Status      Status               `protobuf:"varint,14,opt,name=status,proto3,enum=model.Status" json:"status,omitempty"`
	Status1     Status               `protobuf:"varint,15,opt,name=status1,proto3,enum=model.Status" json:"status1,omitempty"`
	Status2     Status               `protobuf:"varint,16,opt,name=status2,proto3,enum=model.Status" json:"status2,omitempty"`
	T1          int64                `protobuf:"varint,18,opt,name=t1,proto3" json:"t1,omitempty"`
	T2          uint64               `protobuf:"varint,19,opt,name=t2,proto3" json:"t2,omitempty"`
	T3          string               `protobuf:"bytes,20,opt,name=t3,proto3" json:"t3,omitempty"`
	D1          int64                `protobuf:"varint,21,opt,name=d1,proto3" json:"d1,omitempty"`
	Ids         []int32              `protobuf:"varint,22,rep,packed,name=ids,proto3" json:"ids,omitempty"`
	M1          map[string]string    `` /* 146-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAddress

func (x *User) GetAddress() string

func (*User) GetAuthor

func (x *User) GetAuthor() *User_Author

func (*User) GetBalance

func (x *User) GetBalance() float64

func (*User) GetCreateTime

func (x *User) GetCreateTime() *timestamp.Timestamp

func (*User) GetD1

func (x *User) GetD1() int64

func (*User) GetDate

func (x *User) GetDate() *timestamp.Timestamp

func (*User) GetDeletedTime

func (x *User) GetDeletedTime() *timestamp.Timestamp

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetExtra

func (x *User) GetExtra() []byte

func (*User) GetId

func (x *User) GetId() int32

func (*User) GetIds

func (x *User) GetIds() []int32

func (*User) GetM1

func (x *User) GetM1() map[string]string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetPhone

func (x *User) GetPhone() string

func (*User) GetScore

func (x *User) GetScore() float32

func (*User) GetStatus

func (x *User) GetStatus() Status

func (*User) GetStatus1

func (x *User) GetStatus1() Status

func (*User) GetStatus2

func (x *User) GetStatus2() Status

func (*User) GetT1

func (x *User) GetT1() int64

func (*User) GetT2

func (x *User) GetT2() uint64

func (*User) GetT3

func (x *User) GetT3() string

func (*User) GetUpdateTime

func (x *User) GetUpdateTime() *timestamp.Timestamp

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) UserModel

func (x *User) UserModel() (*UserModel, error)

type UserModel

type UserModel struct {
	Id          int32             `gorm:"column:id;type:bigint;primaryKey" json:"id,omitempty"`
	Name        string            `gorm:"column:name;index:idx_name_addr,unique" json:"name,omitempty"`
	Email       string            `gorm:"column:email" json:"email,omitempty"`
	Address     string            `gorm:"column:address;index:idx_name_addr,unique" json:"address,omitempty"`
	Phone       string            `gorm:"column:phone" json:"phone,omitempty"`
	Score       float32           `gorm:"column:score;type:decimal(10,2) unsigned;not null" json:"score,omitempty"`
	Balance     float64           `gorm:"column:balance" json:"balance,omitempty"`
	CreateTime  time.Time         `gorm:"column:create_time;type:datetime;autoCreateTime;not null" json:"create_time,omitempty"`
	UpdateTime  time.Time         `gorm:"column:update_time;type:datetime;autoUpdateTime;not null" json:"update_time,omitempty"`
	DeletedTime time.Time         `gorm:"column:deleted_time;type:datetime;not null" json:"deleted_time,omitempty"`
	Date        datatypes.Date    `gorm:"column:date;type:date" json:"date,omitempty"`
	Extra       []byte            `gorm:"column:extra;type:tinyblob;default:'abc'" json:"extra,omitempty"`
	Author      *User_AuthorModel `gorm:"-" json:"author,omitempty"`
	Status      string            `gorm:"column:status;type:enum('PENDING','UNKNOWN');default:'UNKNOWN'" json:"status,omitempty"`
	Status1     string            `gorm:"column:status1;default:'UNKNOWN'" json:"status1,omitempty"`
	Status2     Status            `gorm:"column:status2;type:int;default:0" json:"status2,omitempty"`
	T1          time.Time         `gorm:"column:t1;type:datetime;autoCreateTime;not null" json:"t1,omitempty"`
	T2          time.Time         `gorm:"column:t2;type:datetime;autoUpdateTime;not null" json:"t2,omitempty"`
	T3          time.Time         `gorm:"column:t3;type:datetime;not null" json:"t3,omitempty"`
	D1          datatypes.Date    `gorm:"column:d1;type:date" json:"d1,omitempty"`
	Ids         UserModelIdsList  `gorm:"column:ids;type:longtext" json:"ids,omitempty"`
	M1          UserModelM1Map    `gorm:"column:m1;type:longtext" json:"m1,omitempty"`
}

GormModel is an option for User

func (*UserModel) TableName

func (x *UserModel) TableName() string

func (*UserModel) User

func (x *UserModel) User() (*User, error)

type UserModelIdsList

type UserModelIdsList []int32

func (*UserModelIdsList) Scan

func (x *UserModelIdsList) Scan(value any) error

func (UserModelIdsList) Value

func (x UserModelIdsList) Value() (driver.Value, error)

type UserModelM1Map

type UserModelM1Map map[string]string

func (*UserModelM1Map) Scan

func (x *UserModelM1Map) Scan(value any) error

func (UserModelM1Map) Value

func (x UserModelM1Map) Value() (driver.Value, error)

type User_Author

type User_Author struct {
	Name        string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Email       string               `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	DeletedTime *timestamp.Timestamp `protobuf:"bytes,11,opt,name=deleted_time,json=deletedTime,proto3" json:"deleted_time,omitempty"`
	// contains filtered or unexported fields
}

func (*User_Author) Descriptor deprecated

func (*User_Author) Descriptor() ([]byte, []int)

Deprecated: Use User_Author.ProtoReflect.Descriptor instead.

func (*User_Author) GetDeletedTime

func (x *User_Author) GetDeletedTime() *timestamp.Timestamp

func (*User_Author) GetEmail

func (x *User_Author) GetEmail() string

func (*User_Author) GetName

func (x *User_Author) GetName() string

func (*User_Author) ProtoMessage

func (*User_Author) ProtoMessage()

func (*User_Author) ProtoReflect

func (x *User_Author) ProtoReflect() protoreflect.Message

func (*User_Author) Reset

func (x *User_Author) Reset()

func (*User_Author) String

func (x *User_Author) String() string

func (*User_Author) User_AuthorModel

func (x *User_Author) User_AuthorModel() (*User_AuthorModel, error)

type User_AuthorModel

type User_AuthorModel struct {
	Name        string         `gorm:"column:name" json:"name,omitempty"`
	Email       string         `gorm:"column:email" json:"email,omitempty"`
	DeletedTime gorm.DeletedAt `gorm:"column:deleted_time;type:datetime;index:idx_deleted_time" json:"deleted_time,omitempty"`
}

GormModel is an option for User_Author

func (*User_AuthorModel) User_Author

func (x *User_AuthorModel) User_Author() (*User_Author, error)

Jump to

Keyboard shortcuts

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