user

package
v0.0.0-...-c8dbcfe Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserSet = wire.NewSet(wire.Struct(new(UserRepo), "*"))
View Source
var UsertagSet = wire.NewSet(wire.Struct(new(UsertagRepo), "*"))

Functions

func GetUserDB

func GetUserDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

func GetUsertagDB

func GetUsertagDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

Types

type SchemaUser

type SchemaUser schema.User

func (SchemaUser) ToUser

func (a SchemaUser) ToUser() *User

type SchemaUsertag

type SchemaUsertag schema.Usertag

func (SchemaUsertag) ToUsertag

func (a SchemaUsertag) ToUsertag() *Usertag

type User

type User struct {
	util.Model
	UserName      string   `gorm:"size:64;uniqueIndex;default:'';not null;"` // 用户名
	RealName      string   `gorm:"size:64;index;default:'';"`                // 真实姓名
	Password      string   `gorm:"size:40;default:'';"`                      // 密码
	Salt          string   `gorm:"size:4;default:'';"`                       // 密码加盐
	TeethlinkID   uint64   `gorm:""`                                         // 在teethlink 那边的id
	MemberID      uint64   `gorm:""`                                         // 该用户与哪位成员(经销商)绑定
	Address       string   `gorm:"size:50;default:'';"`                      // 地址
	Email         *string  `gorm:"size:255;"`                                // 邮箱
	Phone         *string  `gorm:"size:20;"`                                 // 手机号
	Status        int      `gorm:"index;"`                                   // 状态(1:启用 0:停用)
	Creator       uint64   `gorm:""`                                         // 创建者
	TotalMoney    *float32 `gorm:"default:0;"`                               // 总充值金额
	LeftMoney     *float32 `gorm:"default:0;"`                               // 剩余金额
	UsebleStorage *uint64  `gorm:""`                                         // 可用存储
	UsedStorage   *uint64  `gorm:""`                                         // 已用存储
	MemberNumber  *uint64  `gorm:"default:0;"`                               // 子账户数量
	UsertagID     uint64   `gorm:"default:0;"`                               // usertag唯一标识
}

func (User) ToSchemaUser

func (a User) ToSchemaUser() *schema.User

type UserRepo

type UserRepo struct {
	DB *gorm.DB
}

func (*UserRepo) CountByMemberID

func (a *UserRepo) CountByMemberID(ctx context.Context, ds []uint64) []*schema.AgentOrderStatistic

func (*UserRepo) Create

func (a *UserRepo) Create(ctx context.Context, item schema.User) error

func (*UserRepo) Delete

func (a *UserRepo) Delete(ctx context.Context, id uint64) error

func (*UserRepo) Get

func (a *UserRepo) Get(ctx context.Context, id uint64, opts ...schema.UserQueryOptions) (*schema.User, error)

func (*UserRepo) GetByTeethlinkID

func (a *UserRepo) GetByTeethlinkID(ctx context.Context, id uint64) (*schema.User, error)

func (*UserRepo) Query

func (*UserRepo) Update

func (a *UserRepo) Update(ctx context.Context, id uint64, item schema.User) error

func (*UserRepo) UpdateStatus

func (a *UserRepo) UpdateStatus(ctx context.Context, id uint64, status int) error

type Users

type Users []*User

func (Users) ToSchemaUsers

func (a Users) ToSchemaUsers() []*schema.User

type Usertag

type Usertag struct {
	util.Model
	TagName string `gorm:"size:64;uniqueIndex;default:'';not null;"` // 用户名
	Memo    string `gorm:""`                                         // 备注
	Status  int    `gorm:"index;"`                                   // 状态(1:启用 0:停用)
	Creator uint64 `gorm:""`                                         // 创建者
}

func (Usertag) ToSchemaUsertag

func (a Usertag) ToSchemaUsertag() *schema.Usertag

type UsertagRepo

type UsertagRepo struct {
	DB *gorm.DB
}

func (*UsertagRepo) Create

func (a *UsertagRepo) Create(ctx context.Context, item schema.Usertag) error

func (*UsertagRepo) Delete

func (a *UsertagRepo) Delete(ctx context.Context, id uint64) error

func (*UsertagRepo) Get

func (*UsertagRepo) Query

func (*UsertagRepo) Update

func (a *UsertagRepo) Update(ctx context.Context, id uint64, item schema.Usertag) error

func (*UsertagRepo) UpdateStatus

func (a *UsertagRepo) UpdateStatus(ctx context.Context, id uint64, status int) error

type Usertags

type Usertags []*Usertag

func (Usertags) ToSchemaUsertags

func (a Usertags) ToSchemaUsertags() []*schema.Usertag

Jump to

Keyboard shortcuts

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