user

package
v0.0.0-...-5ad4795 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Add_No_Verify uint8 = iota + 1
	Add_Verify
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type IUserData

type IUserData interface {
	List(ctx context.Context, opts common.ListMeta, orderby []string) (*UserDOList, error)
	Create(ctx context.Context, user *UserDO) error
	Update(ctx context.Context, user *UserDO) error
	GetByMobile(ctx context.Context, mobile string) (*UserDO, error)
	GetById(ctx context.Context, id uint) (*UserDO, error)
}

type UserDO

type UserDO struct {
	BaseModel
	Mobile        string `json:"mobile" gorm:"uniqueIndex;type:varchar(11)"`
	Passwd        string `json:"passwd" gorm:"type:varchar(100);not null"`
	Nickname      string `json:"nickname" gorm:"type:varchar(50)"`
	Avatar        string `json:"avatar" gorm:"type:varchar(150)"`
	Gender        string `json:"gender" gorm:"type:varchar(6);default:male;comment:'male or female'"`
	Online        int    `json:"online" gorm:"type:tinyint"`
	Token         string `json:"token" gorm:"type:varchar(40)"`
	Memo          string `json:"memo" gorm:"type:varchar(140)"`
	FriendAddType uint8  `json:"friend_add_type" gorm:"type:tinyint; default:1; comment:'1需要验证,2无需验证'"`
}

func (*UserDO) TableName

func (u *UserDO) TableName() string

type UserDOList

type UserDOList struct {
	Total int64     `json:"total,omitempty"`
	Items []*UserDO `json:"items"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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