model

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat               = "2006-01-02T15:04:05Z07:00"
	DateFormat               = "2006-01-02"
	DefaultSafeTime          = time.Minute * 3
	RoleAnchor               = "1" // 主播
	RoleNormal               = "0" // 普通用户
	DateEnd         DateType = 0   // 截止时间类型
	DateBegin       DateType = 1   // 开始时间类型
)

Variables

View Source
var ErrNotFound = sqlx.ErrNotFound

Functions

func NewCacheProvider

func NewCacheProvider(c cache.CacheConf, opts ...cache.Option) cache.Cache

Types

type CacheBitmapResultUser

type CacheBitmapResultUser struct {
	UidBitMap []byte    `json:"uid_bit_map"`
	ExpiredAt time.Time `json:"expired_at"`
	Count     uint64    `json:"count"`
}

type CacheResultUser

type CacheResultUser struct {
	Uids      []uint64  `json:"uids"`
	ExpiredAt time.Time `json:"expired_at"`
}

type CachedConn

type CachedConn struct {
	sqlc.CachedConn
	// contains filtered or unexported fields
}

func (*CachedConn) GetCacheProvider

func (c *CachedConn) GetCacheProvider() cache.Cache

type DateType

type DateType int32

func ParserDateType

func ParserDateType(ty int32) DateType

type QueryMap

type QueryMap struct {
	Day     int      `json:"day"`
	Channel string   `json:"channel,omitempty"`
	Role    string   `json:"role,omitempty"`
	Date    string   `json:"data,omitempty"`
	Type    DateType `json:"type,omitempty"`
}

type UserDayLogin

type UserDayLogin struct {
	Id              int64     `db:"id"`                // ID
	Date            time.Time `db:"date"`              // 日期
	Uid             int64     `db:"uid"`               // Uid
	Count           int64     `db:"count"`             // 登陆次数
	IsAnchor        int64     `db:"is_anchor"`         // 是否认证主播(0:非主播,1:主播)
	IsNewer         int64     `db:"is_newer"`          //  是否新用户
	UserClass       int64     `db:"user_class"`        // 用户类型(0:非付费用户,1:付费用户)
	StartActivityAt time.Time `db:"start_activity_at"` // 当天首次活跃时间点
	LastActivityAt  time.Time `db:"last_activity_at"`  // 当天最后一次活跃时间点
	CreatedAt       time.Time `db:"created_at"`        // 创建时间
	UpdatedAt       time.Time `db:"updated_at"`        // 更新时间
}

type UserDayLoginModel

type UserDayLoginModel interface {
	Insert(data UserDayLogin) (sql.Result, error)
	FindOne(id int64) (*UserDayLogin, error)
	Update(data UserDayLogin) error
	Delete(id int64) error
	GetUserArr(queryMap QueryMap) ([][]uint64, error)
	GetUserBitMapArr(queryMap QueryMap) ([]*roaring64.Bitmap, error)
}

func NewUserDayLoginModel

func NewUserDayLoginModel(conn sqlx.SqlConn, table string, c cache.CacheConf, cnf config.Config) UserDayLoginModel

Jump to

Keyboard shortcuts

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