models

package
v0.0.0-...-3b8fdc3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFound = "record not found"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerFLag

type ServerFLag struct {
	Id         int64     `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL"`
	Flag       string    `gorm:"column:flag;NOT NULL;comment:'服务'"`
	ServerName string    `gorm:"column:server_name;NOT NULL;comment:'服务名称'"`
	ServerIp   string    `gorm:"column:server_ip;NOT NULL;comment:'服务ip'"`
	Sum        int       `gorm:"column:sum;NOT NULL;comment:'服务累计数量'"`
	CreatedAt  time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP;NOT NULL;comment:'创建时间'"`
	UpdatedAt  time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;NOT NULL;comment:'更新时间'"`
}

func (*ServerFLag) FindUserByServerNameAndIP

func (se *ServerFLag) FindUserByServerNameAndIP(serverName, ip string) (*ServerFLag, error)

FindUserByServerNameAndIP 根据 server 查找server服务信息

func (*ServerFLag) TableName

func (se *ServerFLag) TableName() string

type User

type User struct {
	Id        int64     `gorm:"column:id;primary_key;AUTO_INCREMENT;NOT NULL"`
	Username  string    `gorm:"column:username;NOT NULL;comment:'用户名'"`
	Nickname  string    `gorm:"column:nickname;NOT NULL;comment:'昵称'"`
	Phone     string    `gorm:"column:phone;NOT NULL;comment:'手机号'"`
	Email     string    `gorm:"column:email;NOT NULL;comment:'邮箱'"`
	Gender    int8      `gorm:"column:gender;default:1;NOT NULL;comment:'性别'"`
	RoleId    string    `gorm:"column:role_id;NOT NULL;comment:'角色id'"`
	Password  string    `gorm:"column:password;NOT NULL;comment:'密码'"`
	Enable    int8      `gorm:"column:enable;default:1;NOT NULL;comment:'是否启用 1: 启用 2: 禁用'"`
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP;NOT NULL;comment:'创建时间'"`
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;NOT NULL;comment:'更新时间'"`
}

func (*User) FindUserById

func (a *User) FindUserById(id int64) (user *User, err error)

FindUserById 根据 id 查找user账户信息

func (*User) FindUserByNickname

func (a *User) FindUserByNickname(nickname string) (user *User, err error)

FindUserByNickname 根据 nickname 查找user账户信息

func (*User) FindUserByUsername

func (a *User) FindUserByUsername(username string) (user *User, err error)

FindUserByUsername 根据 username 查找user账户信息

func (*User) List

func (a *User) List(page, pageSize int64) (int64, []*User, error)

List user列表

func (*User) TableName

func (a *User) TableName() string

Jump to

Keyboard shortcuts

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