model

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllOptions

type AllOptions struct {
	Model  any
	Scopes func(db *gorm.DB) *gorm.DB
}

type BaseModel

type BaseModel struct {
	ID        int64 `json:"id" gorm:"primary_key;auto_increment;size:32;comment:主键ID"`
	CreatedAt int64 `json:"created_at,omitempty" gorm:"index;comment:创建时间"`
	UpdatedAt int64 `json:"updated_at,omitempty" gorm:"index;comment:修改时间"`
}

type CreateModel

type CreateModel struct {
	ID        int64 `json:"id" gorm:"primary_key;auto_increment;size:32;comment:主键ID"`
	CreatedAt int64 `json:"created_at,omitempty" gorm:"index;comment:创建时间"`
}

type DeleteModel

type DeleteModel struct {
	ID        int64          `json:"id" gorm:"primary_key;auto_increment;size:32;comment:主键ID"`
	CreatedAt int64          `json:"created_at,omitempty" gorm:"index;comment:创建时间"`
	UpdatedAt int64          `json:"updated_at,omitempty" gorm:"index;comment:修改时间"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"column:deleted_at;index;comment:删除时间"`
}

type Environment

type Environment struct {
	Keyword     string `json:"keyword" gorm:"unique;not null;size:32;comment:环境关键字"`
	Title       string `json:"title" gorm:"not null;size:32;comment:环境标题"`
	Description string `json:"description" gorm:"not null;size:128;comment:环境描述"`
	Token       string `json:"token,omitempty" gorm:"not null;size:32;comment:连接token"`
	Status      *bool  `json:"status" gorm:"not null;comment:启用状态"`
	Operator    string `json:"operator,omitempty"`
	OperatorId  int64  `json:"operator_id,omitempty"`
}

2

func (*Environment) All

func (u *Environment) All(ctx *gin.Context, m any) ([]Environment, error)

func (*Environment) AllFilter

func (u *Environment) AllFilter(ctx *gin.Context) ([]Environment, error)

func (*Environment) Create

func (e *Environment) Create(ctx kratos.Context) error

func (*Environment) DeleteByID

func (u *Environment) DeleteByID(ctx *gin.Context, id int64) error

func (*Environment) OneByKeyword

func (u *Environment) OneByKeyword(ctx kratos.Context, keyword string) error

func (*Environment) UpdateByID

func (u *Environment) UpdateByID(ctx *gin.Context) error

type EnvironmentFactory

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

func NewEnvironmentFactory

func NewEnvironmentFactory(db *gorm.DB) *EnvironmentFactory

func (*EnvironmentFactory) Create

func (e *EnvironmentFactory) Create(in *Environment) error

func (*EnvironmentFactory) OneByKeyword

func (e *EnvironmentFactory) OneByKeyword(keyword string) (*Environment, error)

type PageOptions

type PageOptions struct {
	Page     int
	PageSize int
	Model    any
	Scopes   func(db *gorm.DB) *gorm.DB
}

type User

type User struct {
	ID          int64   `json:"id" gorm:"primary_key;autoIncrement;size:32;comment:主键ID"`
	Name        string  `json:"name" gorm:"not null;size:32;comment:用户姓名"`
	Nickname    string  `json:"nickname" gorm:"not null;size:128;comment:用户昵称"`
	Sex         *bool   `json:"sex,omitempty" gorm:"not null;comment:用户性别"`
	Phone       string  `json:"phone" gorm:"not null;size:32;comment:用户电话"`
	Password    string  `json:"password,omitempty" gorm:"not null;->:false;<-:create,update;comment:用户密码"`
	Avatar      string  `json:"avatar" gorm:"not null;size:128;comment:用户头像"`
	Email       string  `json:"email,omitempty" gorm:"not null;type:varbinary(128);comment:用户邮箱"`
	Status      *bool   `json:"status,omitempty" gorm:"not null;comment:用户状态"`
	DisableDesc *string `json:"disable_desc" gorm:"not null;size:128;comment:禁用原因"`
	LastLogin   int64   `json:"last_login" gorm:"comment:最后登陆时间"`
	Operator    string  `json:"operator" gorm:"not null;size:128;comment:操作人员名称"`
	OperatorID  int64   `json:"operator_id" gorm:"not null;size:32;comment:操作人员id"`
	CreatedAt   int64   `json:"created_at,omitempty" gorm:"index;comment:创建时间"`
	UpdatedAt   int64   `json:"updated_at,omitempty" gorm:"index;comment:修改时间"`
}

Jump to

Keyboard shortcuts

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