domain

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

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID         int64  // id
	Account    string // 账号
	Password   string // 密码
	UnionID    string // 微信开放平台id
	MpOpenID   string // 公众号openId
	NickName   string // 用户昵称
	Avatar     string // 用户头像
	Profile    string // 用户简介
	Role       string // 用户角色:user/admin/ban
	CreateTime int64  // 创建时间
	UpdateTime int64  // 更新时间
}

func (*User) CheckPassword

func (u *User) CheckPassword(pwd string) bool

func (*User) EncryptPassword

func (u *User) EncryptPassword(pwd string)

type UserRepo

type UserRepo interface {
	FindByAccount(ctx context.Context, account string) (*User, error)
	FindById(ctx context.Context, id int64) (*User, error)
	Create(ctx context.Context, user *User) error
	Update(ctx context.Context, user *User) error
	Delete(ctx context.Context, id int64) error
	Count(ctx context.Context, conditions ...gen.Condition) (int64, error)
	FindByPage(ctx context.Context, current, size int, ud *User) ([]*User, int64, error)
	Find(ctx context.Context, conditions ...gen.Condition) (*User, error)
}

Jump to

Keyboard shortcuts

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