Documentation
¶
Index ¶
- Variables
- func NewGormDb(c *conf.Data, l log.Logger) *gorm.DB
- func NewRedisConn(c *conf.Data, l log.Logger) *redis.Client
- func NewRelationRepo(conn pb.RelationServiceClient) biz.RelationRepo
- func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo
- type Data
- type KfkReader
- type User
- type UserDetail
- type UserKeyInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FixedCacheExpire = 720 DelayRemoveCache = 500 * time.Millisecond )
View Source
var ProviderSet = wire.NewSet(NewData, NewKafkaReader, NewGormDb, NewRedisConn, NewUserRepo, NewRelationRepo)
ProviderSet is data providers.
Functions ¶
func NewRelationRepo ¶
func NewRelationRepo(conn pb.RelationServiceClient) biz.RelationRepo
Types ¶
type KfkReader ¶
type KfkReader struct {
// contains filtered or unexported fields
}
func NewKafkaReader ¶
type User ¶
type User struct { Id uint32 `gorm:"primary_key"` Username string `gorm:"column:username;not null;index:idx_uname_pwd"` Password string `gorm:"column:password;not null;index:idx_uname_pwd"` Name string `gorm:"column:name;not null"` FollowCount uint32 `gorm:"column:follow_count;not null;default:0"` FollowerCount uint32 `gorm:"column:follower_count;not null;default:0"` Avatar string `gorm:"column:avatar_url;type:longtext;not null"` BackgroundImage string `gorm:"column:background_image_url;type:longtext;not null"` Signature string `gorm:"column:signature;not null;type:longtext"` TotalFavorited uint32 `gorm:"column:total_favorited;not null;default:0"` WorkCount uint32 `gorm:"column:work_count;not null;default:0"` FavoriteCount uint32 `grom:"column:favorite_count;not null;default:0"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"` }
User 是用户的全量信息,包含敏感字段,是数据库的模型
type UserDetail ¶
type UserDetail struct { Id uint32 `gorm:"primary_key" json:"id"` Username string `gorm:"column:username" json:"username"` Name string `gorm:"column:name" json:"name"` FollowCount uint32 `gorm:"column:follow_count" json:"follow_count"` FollowerCount uint32 `gorm:"column:follower_count" json:"follower_count"` Avatar string `gorm:"column:avatar_url" json:"avatar"` BackgroundImage string `gorm:"column:background_image_url" json:"background_image"` Signature string `gorm:"column:signature" json:"signature"` TotalFavorited uint32 `gorm:"column:total_favorited" json:"total_favorited"` WorkCount uint32 `gorm:"column:work_count" json:"work_count"` FavoriteCount uint32 `grom:"column:favorite_count" json:"favorite_count"` }
UserDetail 是不包含敏感信息的用户信息
type UserKeyInfo ¶
type UserKeyInfo struct { Id uint32 `gorm:"primary_key"` Username string `gorm:"column:username"` Password string `gorm:"column:password"` }
UserKeyInfo 是用户信息中的关键信息 这些关键信息包含 用户id、用户名和密码
Click to show internal directories.
Click to hide internal directories.