account

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithUserMobile

func WithUserMobile(mobile string) gormx.SqlOptions

Types

type AuthUserData

type AuthUserData struct {
	Uid      string `json:"uid"`
	Password string `json:"password"`
	Type     int    `json:"type"`
	Status   int    `json:"status"`
	Name     string `json:"name"`
	Active   int    `json:"active"`
	Nid      string `json:"nid"`
	Level    int    `json:"level"`
	Gid      string `json:"gid"`
}

type JwtUserClaims

type JwtUserClaims struct {
	jwtgo.StandardClaims
	Info AuthUserData `json:"info"`
}

type User

type User struct {
	gorm.Model
	Account string `gorm:"del_state"`
	Name    string `gorm:"version"`
	Pass    string `gorm:"mobile"`
	Gender  string `gorm:"password"`
	Mobile  string `gorm:"nickname"`
	Phone   string `gorm:"sex"`
	Avatar  string `gorm:"avatar"`
	Info    string `gorm:"info"`
}

func (*User) TableName

func (m *User) TableName() string

type UserAuth

type UserAuth struct {
	Id         int64     `gorm:"id"`
	CreateTime time.Time `gorm:"create_time"`
	UpdateTime time.Time `gorm:"update_time"`
	DeleteTime time.Time `gorm:"delete_time"`
	DelState   int64     `gorm:"del_state"`
	Version    int64     `gorm:"version"` // 版本号
	UserId     int64     `gorm:"user_id"`
	AuthKey    string    `gorm:"auth_key"`  // 平台唯一id
	AuthType   string    `gorm:"auth_type"` // 平台类型
}

func (*UserAuth) Delete

func (u *UserAuth) Delete(ctx context.Context, id int64) error

func (*UserAuth) FindOne

func (u *UserAuth) FindOne(ctx context.Context, id int64) (*UserAuth, error)

func (*UserAuth) FindOneByAuthTypeAuthKey

func (u *UserAuth) FindOneByAuthTypeAuthKey(ctx context.Context, authType string, authKey string) (*UserAuth, error)

func (*UserAuth) FindOneByUserIdAuthType

func (u *UserAuth) FindOneByUserIdAuthType(ctx context.Context, userId int64, authType string) (*UserAuth, error)

func (*UserAuth) Insert

func (u *UserAuth) Insert(ctx context.Context, data *UserAuth) error

func (*UserAuth) Update

func (u *UserAuth) Update(ctx context.Context, data *UserAuth) error

func (*UserAuth) UpdateWithVersion

func (u *UserAuth) UpdateWithVersion(ctx context.Context, data *UserAuth) error

type UserAuthModel

type UserAuthModel interface {
	Insert(ctx context.Context, data *UserAuth) error
	FindOne(ctx context.Context, id int64) (*UserAuth, error)
	FindOneByAuthTypeAuthKey(ctx context.Context, authType string, authKey string) (*UserAuth, error)
	FindOneByUserIdAuthType(ctx context.Context, userId int64, authType string) (*UserAuth, error)
	Update(ctx context.Context, data *UserAuth) error
	UpdateWithVersion(ctx context.Context, data *UserAuth) error
	Delete(ctx context.Context, id int64) error
}

type UserModel

type UserModel interface {
	// contains filtered or unexported methods
}

func NewUserModel

func NewUserModel(c *gofkConf.Config) UserModel

Jump to

Keyboard shortcuts

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