Documentation ¶
Index ¶
- Constants
- type ServerFLag
- type User
- func (a *User) FindUserById(id int64) (user *User, err error)
- func (a *User) FindUserByNickname(nickname string) (user *User, err error)
- func (a *User) FindUserByUsername(username string) (user *User, err error)
- func (a *User) List(page, pageSize int64) (int64, []*User, error)
- func (a *User) TableName() string
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 ¶
FindUserById 根据 id 查找user账户信息
func (*User) FindUserByNickname ¶
FindUserByNickname 根据 nickname 查找user账户信息
func (*User) FindUserByUsername ¶
FindUserByUsername 根据 username 查找user账户信息
Click to show internal directories.
Click to hide internal directories.