Documentation
¶
Index ¶
- func NewUserRepo(db *gorm.DB) repo.UserRepo
- type User
- type UserAdapter
- func (m *UserAdapter) Count(ctx context.Context, query *gormx.Query) (int64, error)
- func (m *UserAdapter) Create(ctx context.Context, es ...*entity.User) error
- func (m *UserAdapter) DB(ctx context.Context) *gorm.DB
- func (m *UserAdapter) Delete(ctx context.Context, id int64) error
- func (r *UserAdapter) GetByID(ctx context.Context, id int64) (*entity.User, error)
- func (m *UserAdapter) IsDuplicatedKeyError(err error) bool
- func (m *UserAdapter) IsNotFoundError(err error) bool
- func (m *UserAdapter) List(ctx context.Context, query *gormx.Query) ([]*entity.User, error)
- func (m *UserAdapter) Update(ctx context.Context, e *entity.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type User ¶
type User struct {
Id uint32 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Uid int64 `gorm:"column:uid" json:"uid"`
NickName string `gorm:"column:nick_name" json:"nick_name"`
AvatarUri string `gorm:"column:avatar_uri" json:"avatar_uri"`
ReadingPreference int8 `gorm:"column:reading_preference" json:"reading_preference"`
CreateTime time.Time `gorm:"column:create_time" json:"create_time"`
UpdateTime time.Time `gorm:"column:update_time" json:"update_time"`
AutoBuy int8 `gorm:"column:auto_buy" json:"auto_buy"`
IsAutoBuy int8 `gorm:"column:is_auto_buy" json:"is_auto_buy"`
}
User represents a user struct data.
type UserAdapter ¶
type UserAdapter struct {
// contains filtered or unexported fields
}
UserAdapter represents a user adapter.
func (*UserAdapter) Delete ¶
func (m *UserAdapter) Delete(ctx context.Context, id int64) error
Delete delete user.
func (*UserAdapter) IsDuplicatedKeyError ¶
func (m *UserAdapter) IsDuplicatedKeyError(err error) bool
IsDuplicatedKeyError use to check error is unique key conflict error.
func (*UserAdapter) IsNotFoundError ¶
func (m *UserAdapter) IsNotFoundError(err error) bool
IsNotFoundError use to check error is record not found error.
Click to show internal directories.
Click to hide internal directories.