dao

package
v0.0.0-...-d296f3d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

func NewDao

func NewDao(dbConf *conf.DBConf) (*Dao, error)

func (*Dao) Checkin

func (dao *Dao) Checkin(ctx context.Context, t time.Time, gid, uid uint64) (todayFirstCheckin bool, err error)

Checkin 用户签到

func (*Dao) CreateGuildUser

func (dao *Dao) CreateGuildUser(ctx context.Context, gid, uid int64) (int64, error)

CreateGuildUser 创建频道用户信息

func (*Dao) GetGuildUserByGidAndUid

func (dao *Dao) GetGuildUserByGidAndUid(ctx context.Context, gid, uid int64) (*GuildUser, error)

GetGuildUserByGidAndUid 根据频道id和用户id获取用户信息 当获取不到数据时返回 nil, nil

func (*Dao) GetUserCheckinInfo

func (dao *Dao) GetUserCheckinInfo(ctx context.Context, t time.Time, gid, uid uint64) (*GuildUserCheckin, error)

GetUserCheckinInfo 获取用户签到信息 当获取不到数据时返回 nil, nil

func (*Dao) ListUserCheckinInfos

func (dao *Dao) ListUserCheckinInfos(ctx context.Context, gid, uid uint64) ([]GuildUserCheckin, error)

ListUserCheckinInfos 获取用户历史签到信息

type GuildUser

type GuildUser struct {
	ID             int64     `db:"id"`
	GuildID        uint64    `db:"guild_id"`
	UserID         uint64    `db:"user_id"`
	ContCheckinCnt int       `db:"cont_checkin_cnt"`
	Experience     int       `db:"experience"`
	CreateTime     time.Time `db:"create_time"`
	UpdateTime     time.Time `db:"update_time"`
}

GuildUser guild_users 表结构体

type GuildUserCheckin

type GuildUserCheckin struct {
	ID         int64     `db:"id"`
	GuildID    uint64    `db:"guild_id"`
	UserID     uint64    `db:"user_id"`
	Yearmonth  int       `db:"yearmonth"`
	Days       uint32    `db:"days"`
	CreateTime time.Time `db:"create_time"`
	UpdateTime time.Time `db:"update_time"`
}

GuildUserCheckin guild_users_checkin 表结构体

Jump to

Keyboard shortcuts

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