model

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Id             int    `json:"id" form:"id" uri:"id" gorm:"primaryKey;autoIncrement;comment:'标识'" `
	Name           string `json:"name" form:"name" gorm:"comment:'名称'"`
	ProfilePicture string `json:"profile_picture" form:"profile_picture" gorm:"default:Null;comment:'头像'"`
	Username       string `json:"username" form:"username" comment:"用户名"`
	Salt           string `json:"salt,omitempty" form:"salt" gorm:"comment:'盐'" `
	Password       string `json:"password,omitempty" form:"password" gorm:"comment:'密码'"`
	Status         string `json:"status" form:"status" gorm:"default:true;comment:'状态:启用=true,禁用=false'"`
	Super          string `json:"super" form:"super" gorm:"default:true;comment:'超级管理员:是=true,否=false'"`
	RoleId         int    `json:"role_id" form:"role_id" gorm:"comment:'角色标识'"`
}

管理员

func (*Admin) BeforeCreate

func (m *Admin) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate 在创建之前

func (*Admin) BeforeUpdate

func (m *Admin) BeforeUpdate(tx *gorm.DB) (err error)

BeforeUpdate 在跟新之前

func (Admin) TableName

func (Admin) TableName() string

TableName

Jump to

Keyboard shortcuts

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