Documentation ¶
Index ¶
- Variables
- func GetUserDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- func GetUserRoleDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- type SchemaUser
- type SchemaUserRole
- type User
- type UserRepo
- func (a *UserRepo) Create(ctx context.Context, item schema.User) error
- func (a *UserRepo) Delete(ctx context.Context, id uint64) error
- func (a *UserRepo) Get(ctx context.Context, id uint64, opts ...schema.UserQueryOptions) (*schema.User, error)
- func (a *UserRepo) Query(ctx context.Context, params schema.UserQueryParam, ...) (*schema.UserQueryResult, error)
- func (a *UserRepo) Update(ctx context.Context, id uint64, item schema.User) error
- func (a *UserRepo) UpdatePassword(ctx context.Context, id uint64, password string) error
- func (a *UserRepo) UpdateStatus(ctx context.Context, id uint64, status int) error
- type UserRole
- type UserRoleRepo
- func (a *UserRoleRepo) Create(ctx context.Context, item schema.UserRole) error
- func (a *UserRoleRepo) Delete(ctx context.Context, id uint64) error
- func (a *UserRoleRepo) DeleteByUserID(ctx context.Context, userID uint64) error
- func (a *UserRoleRepo) Get(ctx context.Context, id uint64, opts ...schema.UserRoleQueryOptions) (*schema.UserRole, error)
- func (a *UserRoleRepo) Query(ctx context.Context, params schema.UserRoleQueryParam, ...) (*schema.UserRoleQueryResult, error)
- func (a *UserRoleRepo) Update(ctx context.Context, id uint64, item schema.UserRole) error
- type UserRoles
- type Users
Constants ¶
This section is empty.
Variables ¶
View Source
var UserRoleSet = wire.NewSet(wire.Struct(new(UserRoleRepo), "*"))
Functions ¶
Types ¶
type SchemaUser ¶
func (SchemaUser) ToUser ¶
func (a SchemaUser) ToUser() *User
type SchemaUserRole ¶
func (SchemaUserRole) ToUserRole ¶
func (a SchemaUserRole) ToUserRole() *UserRole
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:'';"` // 密码 Email *string `gorm:"size:255;"` // 邮箱 Phone *string `gorm:"size:20;"` // 手机号 Status int `gorm:"index;default:0;"` // 状态(1:启用 2:停用) Creator uint64 `gorm:""` // 创建者 }
func (User) ToSchemaUser ¶
type UserRepo ¶
func (*UserRepo) Query ¶
func (a *UserRepo) Query(ctx context.Context, params schema.UserQueryParam, opts ...schema.UserQueryOptions) (*schema.UserQueryResult, error)
func (*UserRepo) UpdatePassword ¶
type UserRole ¶
type UserRole struct { util.Model UserID uint64 `gorm:"index;default:0;"` // 用户内码 RoleID uint64 `gorm:"index;default:0;"` // 角色内码 }
func (UserRole) ToSchemaUserRole ¶
type UserRoleRepo ¶
func (*UserRoleRepo) DeleteByUserID ¶
func (a *UserRoleRepo) DeleteByUserID(ctx context.Context, userID uint64) error
func (*UserRoleRepo) Get ¶
func (a *UserRoleRepo) Get(ctx context.Context, id uint64, opts ...schema.UserRoleQueryOptions) (*schema.UserRole, error)
func (*UserRoleRepo) Query ¶
func (a *UserRoleRepo) Query(ctx context.Context, params schema.UserRoleQueryParam, opts ...schema.UserRoleQueryOptions) (*schema.UserRoleQueryResult, error)
Click to show internal directories.
Click to hide internal directories.