Documentation ¶
Index ¶
- Variables
- func GetUserDB(ctx context.Context, defDB *gorm.DB) *gorm.DB
- type User
- type UserRepo
- func (a *UserRepo) Create(ctx context.Context, user *User) error
- func (a *UserRepo) Delete(ctx context.Context, id uint64) error
- func (a *UserRepo) FindOneById(ctx context.Context, id uint64) (*User, error)
- func (a *UserRepo) Get(ctx context.Context, username string) (*User, error)
- func (a *UserRepo) GetPage(ctx context.Context, pageNum int, pageSize int, name string) (*[]*User, int64, error)
- func (a *UserRepo) Update(ctx context.Context, user *User) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type User ¶
type User struct { ID uint64 `gorm:"column:id;primary_key;AUTO_INCREMENT"` CreatedAt types.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"` UpdatedAt types.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"` Username string `gorm:"column:username"` Password string `gorm:"column:password"` Avatar string `gorm:"column:avatar;default:https://zbj-bucket1.oss-cn-shenzhen.aliyuncs.com/avatar.JPG"` UserType int `gorm:"column:user_type;default:0;NOT NULL"` State int `gorm:"column:state;default:1;NOT NULL"` CreatedBy string `gorm:"column:created_by"` ModifiedBy string `gorm:"column:modified_by"` }
Click to show internal directories.
Click to hide internal directories.