models

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthModuleLDAP = "ldap"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	HandleUserCode string         `json:"handle_user_code" gorm:"column:handle_user_code" swaggerignore:"true"`
	HandleUserName string         `json:"handle_user_name" gorm:"column:handle_user_name"` //上次操作用户
	CreatedAt      time.Time      `json:"create_time" gorm:"column:create_time"`           //创建时间
	UpdatedAt      time.Time      `json:"update_time" gorm:"column:update_time"`           //更新时间
	DeletedAt      gorm.DeletedAt `json:"deleted_at"  gorm:"index" swaggertype:"string" swaggerignore:"true"`
}

func (*BaseModel) BeforeSave

func (b *BaseModel) BeforeSave(tx *gorm.DB) error

type Extend

type Extend map[string]interface{}

func (Extend) GormDataType

func (t Extend) GormDataType() string

func (*Extend) Scan

func (t *Extend) Scan(value interface{}) error

func (Extend) Value

func (t Extend) Value() (driver.Value, error)

type User

type User struct {
	ID           int64  `json:"id" gorm:"index"`                         //ID创建时不用传
	AuthModule   string `json:"auth_module"  gorm:"auth_module"`         //认证方式
	SuperAdmin   bool   `json:"super_admin" gorm:"column:super_admin"`   //是否是超级用户
	Name         string `json:"name" gorm:"column:name;unique"`          //用户名
	DisplayName  string `json:"display_name" gorm:"column:display_name"` //显示名称
	Role         string `json:"role" gorm:"column:role"`                 //角色
	Group        int    `json:"group" gorm:"column:group"`               //group
	Organization string `json:"organization" gorm:"column:organization"` //工作组织
	Affiliation  string `json:"affiliation" gorm:"column:affiliation"`   //工作单位
	Position     string `json:"position" gorm:"column:position"`         //职位
	Password     string `json:"password" gorm:"column:password"`         //用户密码不更新密码不用填
	Email        string `json:"email" gorm:"column:email"`               //邮箱地址
	Mobile       string `json:"mobile" gorm:"column:mobile"`             //手机号
	Extend       Extend `json:"extend" gorm:"column:extend"`             //扩展数据
	BaseModel
}

Jump to

Keyboard shortcuts

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