dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultCmType 默认评论类型
	DefaultCmType = 23
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveDetailFilter

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

ArchiveDetailFilter 稿件详情过滤

type ArchiveFilters

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

ArchiveFilters .

func NewArchiveFilters

func NewArchiveFilters(f ...Filter) *ArchiveFilters

NewArchiveFilters .

func (*ArchiveFilters) DoFilter

func (af *ArchiveFilters) DoFilter(a *model.Archive) (res bool)

DoFilter 过滤稿件

type ArchivePageFilter

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

ArchivePageFilter 稿件尺寸过滤

type ArchiveUpFilter

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

ArchiveUpFilter 稿件详情过滤

type Dao

type Dao struct {
	AccountClient account.AccountClient

	ArchiveClient archive.ArchiveClient
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

func (*Dao) AddBVCInfo

func (d *Dao) AddBVCInfo(c context.Context, arg *model.VideoBVC) (err error)

AddBVCInfo 添加BVC转码信息

func (*Dao) AddCacheVideoBase

func (d *Dao) AddCacheVideoBase(c context.Context, videoBases map[int64]*v1.VideoBase) (err error)

AddCacheVideoBase 添加缓存

func (*Dao) AddOrUpdateBVCInfo

func (d *Dao) AddOrUpdateBVCInfo(c context.Context, arg *model.VideoBVC) (err error)

AddOrUpdateBVCInfo 添加或更新BVC转码信息

func (*Dao) AddOrUpdateFlowRecord

func (d *Dao) AddOrUpdateFlowRecord(c context.Context, r *model.BVCRecord) error

AddOrUpdateFlowRecord 添加bvc flow记录

func (*Dao) AddOrUpdateTag

func (d *Dao) AddOrUpdateTag(c context.Context, tmap []*v1.TagInfo) (tids []int64, err error)

AddOrUpdateTag 更新或添加标签

func (*Dao) AddOrUpdateVideo

func (d *Dao) AddOrUpdateVideo(c context.Context, vh *v1.ImportVideoInfo) (err error)

AddOrUpdateVideo 添加或更新视频记录

func (*Dao) AddVideoViews

func (d *Dao) AddVideoViews(c context.Context, svid int64, views int) (affected int64, err error)

AddVideoViews .

func (*Dao) ArchiveKickOff

func (d *Dao) ArchiveKickOff(c context.Context, svid int64, a *model.Archive) (err error)

ArchiveKickOff .

func (*Dao) ArchiveSub

func (d *Dao) ArchiveSub() (*model.Archive, error)

ArchiveSub .

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (*xsql.Tx, error)

BeginTran begin mysql transaction

func (*Dao) CacheVideoBase

func (d *Dao) CacheVideoBase(c context.Context, svids []int64) (res map[int64]*v1.VideoBase, err error)

CacheVideoBase cache video base

func (*Dao) CheckSVResource

func (d *Dao) CheckSVResource(c context.Context, svid int64) (err error)

CheckSVResource ...

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) CmsPub

func (d *Dao) CmsPub(c context.Context, data *model.DataTopicCmsData) (err error)

CmsPub pub cms data into databus.

func (*Dao) CommitTrans

func (d *Dao) CommitTrans(c context.Context, arg *v1.BVideoTransRequset) error

CommitTrans 提交转码

func (*Dao) DelCacheVideoBase

func (d *Dao) DelCacheVideoBase(c context.Context, svid int64)

DelCacheVideoBase 删除缓存

func (*Dao) GetPrepareVUP

func (d *Dao) GetPrepareVUP(c context.Context, mid int64) (vups []*v1.UploadingVideo, err error)

GetPrepareVUP 获取数据

func (*Dao) HomeImgCreate

func (d *Dao) HomeImgCreate(c context.Context, vr *model.VideoRepository) (err error)

HomeImgCreate ..

func (*Dao) HostnameRegister

func (d *Dao) HostnameRegister(hostnameIndex int64) (succ bool)

HostnameRegister .

func (*Dao) InOrUpUserBase

func (d *Dao) InOrUpUserBase(c context.Context, mid int64) (response *v1.SyncUserBaseResponse, err error)

InOrUpUserBase 更新用户基本信息

func (*Dao) InOrUpUserBases

func (d *Dao) InOrUpUserBases(c context.Context, mids []int64) (response *v1.SyncUserBaseResponse, err error)

InOrUpUserBases 批量更新用户基本信息

func (*Dao) InOrUpUserSta

func (d *Dao) InOrUpUserSta(c context.Context, mid int64) (response *v1.SyncUserBaseResponse, err error)

InOrUpUserSta 更新用户up主主站画像

func (*Dao) InOrUpUserStas

func (d *Dao) InOrUpUserStas(c context.Context, mids []int64) (response *v1.SyncUserBaseResponse, err error)

InOrUpUserStas 批量更新用户状态

func (*Dao) InsertOrUpdateVUP

func (d *Dao) InsertOrUpdateVUP(c context.Context, vup *model.VideoUploadProcess) (err error)

InsertOrUpdateVUP ..

func (*Dao) InsertVR

func (d *Dao) InsertVR(c context.Context, vr *model.VideoRepository) (err error)

InsertVR ..

func (*Dao) ModifyLimits

func (d *Dao) ModifyLimits(c context.Context, svid int64, limitType uint64, limitOp uint64) (num int64, err error)

ModifyLimits .

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) error

Ping dao ping

func (*Dao) QueryVR

func (d *Dao) QueryVR(c context.Context, vr *model.VideoRepository) (res *model.VideoRepository, err error)

QueryVR ..

func (*Dao) RawSVBvcKey

func (d *Dao) RawSVBvcKey(c context.Context, svids []int64) (res map[int64][]*bbq.VideoBvc, err error)

RawSVBvcKey 批量获取playurl相对地址

func (*Dao) RawVideoBase

func (d *Dao) RawVideoBase(c context.Context, svids []int64) (res map[int64]*v1.VideoBase, err error)

RawVideoBase mysql获取video_base

func (*Dao) RawVideoStatistic

func (d *Dao) RawVideoStatistic(c context.Context, svids []int64) (res map[int64]*model.SvStInfo, err error)

RawVideoStatistic get video statistics

func (*Dao) RelPlayURLs

func (d *Dao) RelPlayURLs(c context.Context, addrs []string) (res map[string]*grpc.VideoKeyItem, err error)

RelPlayURLs 相对地址批量获取playurl

func (*Dao) ReplyCounts

func (d *Dao) ReplyCounts(c context.Context, ids []int64, t int64) (res map[int64]*model.ReplyCount, err error)

ReplyCounts 批量评论数

func (*Dao) TxAddBVCInfo

func (d *Dao) TxAddBVCInfo(tx *xsql.Tx, arg *model.VideoBVC) (err error)

TxAddBVCInfo 事务添加BVC转码信息

func (*Dao) TxAddOrUpdateBVCInfo

func (d *Dao) TxAddOrUpdateBVCInfo(c context.Context, tx *xsql.Tx, arg *model.VideoBVC) (err error)

TxAddOrUpdateBVCInfo 事务添加或更新BVC转码信息

func (*Dao) TxUpdataBVCInfo

func (d *Dao) TxUpdataBVCInfo(tx *xsql.Tx, arg *model.VideoBVC) (err error)

TxUpdataBVCInfo 事务更新BVC转码信息

func (*Dao) UpdataBVCInfo

func (d *Dao) UpdataBVCInfo(c context.Context, arg *model.VideoBVC) (err error)

UpdataBVCInfo 更新BVC转码信息

func (*Dao) UpdateCmsSvPIC

func (d *Dao) UpdateCmsSvPIC(c context.Context, svid int64, pic *v1.SvPic, st int64) error

UpdateCmsSvPIC 更新封面图

func (*Dao) UpdateVR

func (d *Dao) UpdateVR(c context.Context, vr *model.VideoRepository) (err error)

UpdateVR ..

func (*Dao) VideoBase

func (d *Dao) VideoBase(c context.Context, keys []int64) (res map[int64]*v1.VideoBase, err error)

VideoBase get data from cache if miss will call source method, then add to cache.

func (*Dao) VideoStateUpdate

func (d *Dao) VideoStateUpdate(c context.Context, svid int64, newState int) (aff int64, err error)

VideoStateUpdate .

type Filter

type Filter interface {
	// contains filtered or unexported methods
}

Filter .

Jump to

Keyboard shortcuts

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