Documentation ¶
Index ¶
- Variables
- type Interactive
- type InteractiveDao
- type InteractiveDaoMysql
- func (dao *InteractiveDaoMysql) DeletedLike(ctx context.Context, biz string, bizId int64, uid int64) error
- func (dao *InteractiveDaoMysql) IncreaseLikeCount(ctx context.Context, biz string, bizId int64, uid int64) error
- func (dao *InteractiveDaoMysql) IncreaseReadCount(ctx context.Context, biz string, bizId int64) error
- type User
- type UserDao
- type UserDaoImpl
- func (d *UserDaoImpl) FindByEmail(ctx context.Context, email string) (User, error)
- func (d *UserDaoImpl) FindById(ctx context.Context, id int64) (User, error)
- func (d *UserDaoImpl) FindByPhone(ctx context.Context, phone string) (User, error)
- func (d *UserDaoImpl) Insert(ctx context.Context, u User) error
- type UserLikeBiz
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserDuplicateEmail = errors.New("邮箱冲突") ErrUserNotFound = gorm.ErrRecordNotFound )
Functions ¶
This section is empty.
Types ¶
type Interactive ¶
type Interactive struct { Id int64 `gorm:"primaryKey,autoIncrement"` BizId int64 `gorm:"uniqueIndex=bizId_type"` Biz string `gorm:"uniqueIndex=bizId_type"` ReadCount int64 LikeCount int64 FavoriteCount int64 CreateTime int64 UpdateTime int64 }
func (*Interactive) TableName ¶
func (i *Interactive) TableName() string
type InteractiveDao ¶
type InteractiveDaoMysql ¶
type InteractiveDaoMysql struct {
// contains filtered or unexported fields
}
func NewInteractiveDaoMysql ¶
func NewInteractiveDaoMysql(db *gorm.DB, logger *zap.Logger) *InteractiveDaoMysql
func (*InteractiveDaoMysql) DeletedLike ¶
func (*InteractiveDaoMysql) IncreaseLikeCount ¶
func (*InteractiveDaoMysql) IncreaseReadCount ¶
type User ¶
type User struct { Id int64 `gorm:"primaryKey,autoIncrement"` // 用户ID Email sql.NullString `gorm:"unique"` // 用户邮箱 Password string // 用户密码 Phone sql.NullString `gorm:"unique"` CreateTime int64 // 创建时间 毫秒数 UpdateTime int64 // 更新时间 毫秒数 }
User 用户数据库对象
type UserDao ¶
type UserDaoImpl ¶
type UserDaoImpl struct {
// contains filtered or unexported fields
}
func (*UserDaoImpl) FindByEmail ¶
func (*UserDaoImpl) FindByPhone ¶
type UserLikeBiz ¶
type UserLikeBiz struct { Id int64 `gorm:"primaryKey,autoIncrement"` Uid int64 `gorm:"uniqueIndex=uid_biz_bizId"` Biz string `gorm:"uniqueIndex=uid_biz_bizId"` BizId int64 `gorm:"uniqueIndex=uid_biz_bizId"` Status int CreateTime int64 UpdateTime int64 }
func (*UserLikeBiz) TableName ¶
func (b *UserLikeBiz) TableName() string
Click to show internal directories.
Click to hide internal directories.