Documentation ¶
Index ¶
- Constants
- type Dao
- func (d *Dao) AddLike(c context.Context, mid, upMid, svid int64) (affectedNum int64, err error)
- func (d *Dao) AttentionRecList(ctx context.Context, size int64, mid int64, buvid string) (svIDs []int64, err error)
- func (d *Dao) BatchUserInfo(c context.Context, visitorMID int64, MIDs []int64, ...) (res map[int64]*v1.UserInfo, err error)
- func (d *Dao) BatchVideoInfo(c context.Context, svids []int64) (res map[int64]*video.VideoInfo, err error)
- func (d *Dao) BeginTran(c context.Context) (*xsql.Tx, error)
- func (d *Dao) CancelLike(c context.Context, mid, upMid, svid int64) (affectedNum int64, err error)
- func (d *Dao) CheckUserLike(c context.Context, mid int64, svids []int64) (res map[int64]bool, err error)
- func (d *Dao) Close()
- func (d *Dao) ConvID2SVID(c context.Context, ids []int64) (res map[int64]int64, err error)
- func (d *Dao) CreateNotice(ctx context.Context, notice *notice.NoticeBase) (err error)
- func (d *Dao) EditUserBase(c context.Context, userBase *user.UserBase) (err error)
- func (d *Dao) FetchAppPackage(c context.Context) (result []*v1.AppPackage, err error)
- func (d *Dao) FetchAppResource(c context.Context, plat int, ver int) (result []*model.AppResource, err error)
- func (d *Dao) FetchAvailableOutboxList(c context.Context, fetchStates string, mids []int64, cursorNext bool, ...) (svIDs []int64, err error)
- func (d *Dao) FetchFollowList(c context.Context, mid int64) (upMid []int64, err error)
- func (d *Dao) FetchNewAppVersion(c context.Context, platform int, vCode int) (result *model.AppVersion, err error)
- func (d *Dao) Filter(ctx context.Context, content string, area string) (level int32, err error)
- func (d *Dao) GetList(c context.Context, pageSize int64) (result []int64, err error)
- func (d *Dao) GetLocationAll(c context.Context) (*map[int32][]*model.Location, error)
- func (d *Dao) GetLocationChild(c context.Context, locID int32) (*map[int32][]*model.Location, error)
- func (d *Dao) GetMIDLastPubtime(c context.Context, mid int64) (pubtime int64, err error)
- func (d *Dao) GetNoticeUnread(ctx context.Context, mid int64) (list []*notice.UnreadItem, err error)
- func (d *Dao) GetRandSvList(limit int) []int64
- func (d *Dao) GetRandVideoList(mid int64, limit int) []*model.SvInfo
- func (d *Dao) GetUserBProfile(c context.Context, mid int64) (res *accountv1.ProfileReply, err error)
- func (d *Dao) GetUserShareToken(ctx context.Context, mid int64) string
- func (d *Dao) GetVideoDetail(ctx context.Context, svIDs []int64) (list []*model.SvInfo, retIDs []int64, err error)
- func (d *Dao) IncrVideoStatisticsShare(ctx context.Context, svid int64) (num int32, err error)
- func (d *Dao) JustGetUserBase(c context.Context, mids []int64) (res map[int64]*user.UserBase, err error)
- func (d *Dao) Login(c context.Context, userBase *user.UserBase) (res *user.UserBase, err error)
- func (d *Dao) MergeUploadReq(c context.Context, rurl string, uploadID string, profile string, svid int64, ...) (err error)
- func (d *Dao) ModifyRelation(c context.Context, mid, upMid int64, action int32) (res *user.ModifyRelationReply, err error)
- func (d *Dao) NoticeList(ctx context.Context, noticeType int32, mid, cursorID int64) (list []*notice.NoticeBase, err error)
- func (d *Dao) ParseRel2ID(relID []int32) (idList []int64)
- func (d *Dao) PhoneCheck(c context.Context, mid int64) (telStatus int32, err error)
- func (d *Dao) Ping(c context.Context) error
- func (d *Dao) PushCallback(c context.Context, tid string, nid string, mid int64, buvid string) (err error)
- func (d *Dao) PushLogin(c context.Context, req *notice.UserPushDev) (err error)
- func (d *Dao) PushLogout(c context.Context, req *notice.UserPushDev) (err error)
- func (d *Dao) RawBullet(ctx context.Context, danmu int64) (v *model.Danmu, err error)
- func (d *Dao) RawPlayURLs(c context.Context, cids []int64, qn int64, plat string) (res map[int64]*v1.CVideo, err error)
- func (d *Dao) RawRecList(ctx context.Context, size int64, mid int64, buvid string) (svIDs []int64, err error)
- func (d *Dao) RawSVBvcKey(c context.Context, svids []int64) (res map[int64][]*model.SVBvcKey, err error)
- func (d *Dao) RawVideoStatistic(c context.Context, svids []int64) (res map[int64]*model.SvStInfo, err error)
- func (d *Dao) RawVideoStatistics(c context.Context, svid int64) (res *model.VideoStatistics, err error)
- func (d *Dao) RawVideos(ctx context.Context, svIDs []int64) (res map[int64]*model.SvInfo, err error)
- func (d *Dao) RelPlayURLs(c context.Context, addrs []string) (res map[string]*grpc.VideoKeyItem, err error)
- func (d *Dao) RelRecList(ctx context.Context, req *rec.RecsysRequest) (svIDs []int64, err error)
- func (d *Dao) ReplyAdd(c context.Context, req map[string]interface{}) (res *model.AddRes, err error)
- func (d *Dao) ReplyCounts(c context.Context, ids []int64, t int64) (res map[int64]*model.ReplyCount, err error)
- func (d *Dao) ReplyCursor(c context.Context, req map[string]interface{}) (res *model.CursorRes, err error)
- func (d *Dao) ReplyHot(c context.Context, mid int64, oids []int64) (res map[int64][]*model.Reply, err error)
- func (d *Dao) ReplyLike(c context.Context, req map[string]interface{}) (err error)
- func (d *Dao) ReplyList(c context.Context, req map[string]interface{}) (res *model.ReplyList, err error)
- func (d *Dao) ReplyMinfo(c context.Context, svID int64, rpids []int64) (res map[int64]*model.Reply, err error)
- func (d *Dao) ReplyReport(c context.Context, req map[string]interface{}) (err error)
- func (d *Dao) ReplySubCursor(c context.Context, req map[string]interface{}) (res *model.SubCursorRes, err error)
- func (d *Dao) ReportDanmu(c context.Context, danmu int64, mid int64, rmid int64, reason string) (err error)
- func (d *Dao) ReportUser(c context.Context, rType int, mid int64, rmid int64, reason string) (err error)
- func (d *Dao) ReportVideo(c context.Context, svid int64, rmid int64, reason string) (err error)
- func (d *Dao) SearchBBQ(c context.Context, sreq *model.SearchBaseReq) (ret *model.RawSearchRes, err error)
- func (d *Dao) SetMIDLastPubtime(c context.Context, mid int64, pubtime int64) (err error)
- func (d *Dao) SetUserShareToken(ctx context.Context, mid int64, token string) (int64, error)
- func (d *Dao) SugBBQ(c context.Context, sreq *model.SugBaseReq) (ret json.RawMessage, err error)
- func (d *Dao) SvDel(c context.Context, in *video.VideoDeleteRequest) (interface{}, error)
- func (d *Dao) TxAddVideoStatistics(tx *sql.Tx, videoStatistics *model.VideoStatistics) (num int64, err error)
- func (d *Dao) TxDecrVideoStatisticsLike(tx *sql.Tx, svid int64) (num int64, err error)
- func (d *Dao) TxIncrVideoStatisticsLike(tx *sql.Tx, svid int64) (num int64, err error)
- func (d *Dao) Upload(c context.Context, fileName string, filePath string, file []byte) (location string, err error)
- func (d *Dao) UserLikeList(c context.Context, upMid int64, cursorPrev, cursorNext string) (res *user.ListUserLikeReply, err error)
- func (d *Dao) UserRelationList(c context.Context, userReq *user.ListRelationUserInfoReq, relationType int32) (res *v1.UserRelationListResponse, err error)
- func (d *Dao) VideoBase(c context.Context, mid, svid int64) (res *video.VideoBase, err error)
Constants ¶
const ( FilterAreaAccount = "BBQ_account" FilterAreaVideo = "BBQ_video" FilterAreaReply = "BBQ_reply" FilterAreaSearch = "BBQ_search" FilterAreaDanmu = "BBQ_danmu" FilterLevel = 20 )
用于filter
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) AttentionRecList ¶
func (d *Dao) AttentionRecList(ctx context.Context, size int64, mid int64, buvid string) (svIDs []int64, err error)
AttentionRecList 关注页为空时的推荐
func (*Dao) BatchUserInfo ¶
func (d *Dao) BatchUserInfo(c context.Context, visitorMID int64, MIDs []int64, needDesc, needStat, needFollowState bool) (res map[int64]*v1.UserInfo, err error)
BatchUserInfo 提供批量获取UserInfo的方法 由于user service返回的结构和video的回包不同,因此这里进行映射,返回video-c的结构,避免外部使用方多次映射
func (*Dao) BatchVideoInfo ¶
func (d *Dao) BatchVideoInfo(c context.Context, svids []int64) (res map[int64]*video.VideoInfo, err error)
BatchVideoInfo .
func (*Dao) CancelLike ¶
CancelLike .
func (*Dao) CheckUserLike ¶
func (d *Dao) CheckUserLike(c context.Context, mid int64, svids []int64) (res map[int64]bool, err error)
CheckUserLike 检测用户是否点赞
func (*Dao) ConvID2SVID ¶
ConvID2SVID 转换搜索相对id到svid
func (*Dao) CreateNotice ¶
CreateNotice 创建通知
func (*Dao) EditUserBase ¶
EditUserBase .
func (*Dao) FetchAppPackage ¶
FetchAppPackage .
func (*Dao) FetchAppResource ¶
func (d *Dao) FetchAppResource(c context.Context, plat int, ver int) (result []*model.AppResource, err error)
FetchAppResource .
func (*Dao) FetchAvailableOutboxList ¶
func (d *Dao) FetchAvailableOutboxList(c context.Context, fetchStates string, mids []int64, cursorNext bool, cursorSvID int64, cursorPubtime time.Time, size int) (svIDs []int64, err error)
FetchAvailableOutboxList 根据提供的up主mids去获取比lastSvID还小的svid @param CursorID 函数并不判断SvID正确性,由调用方保证 @param cursorNext 表明fetch的方向,同时会影响排序顺序
true: 则有如下条件sql"... and id < {{svid}} order by id desc..." false: 则有如下条件sql"... and id > {{svid}} order by id asc..."
@return svIDs 注意:svid的返回有顺序
func (*Dao) FetchFollowList ¶
FetchFollowList 获取mid的所有关注up主
func (*Dao) FetchNewAppVersion ¶
func (d *Dao) FetchNewAppVersion(c context.Context, platform int, vCode int) (result *model.AppVersion, err error)
FetchNewAppVersion .
func (*Dao) GetLocationAll ¶
GetLocationAll .
func (*Dao) GetLocationChild ¶
func (d *Dao) GetLocationChild(c context.Context, locID int32) (*map[int32][]*model.Location, error)
GetLocationChild .
func (*Dao) GetMIDLastPubtime ¶
GetMIDLastPubtime 获取该用户feed中的最新浏览svid
func (*Dao) GetNoticeUnread ¶
func (d *Dao) GetNoticeUnread(ctx context.Context, mid int64) (list []*notice.UnreadItem, err error)
GetNoticeUnread 获取未读情况
func (*Dao) GetRandVideoList ¶
GetRandVideoList .
func (*Dao) GetUserBProfile ¶
func (d *Dao) GetUserBProfile(c context.Context, mid int64) (res *accountv1.ProfileReply, err error)
GetUserBProfile 获取用户全量b站信息
func (*Dao) GetUserShareToken ¶
GetUserShareToken .
func (*Dao) GetVideoDetail ¶
func (d *Dao) GetVideoDetail(ctx context.Context, svIDs []int64) (list []*model.SvInfo, retIDs []int64, err error)
GetVideoDetail 从数据库video中获取svid相应的信息
func (*Dao) IncrVideoStatisticsShare ¶
IncrVideoStatisticsShare .
func (*Dao) JustGetUserBase ¶
func (d *Dao) JustGetUserBase(c context.Context, mids []int64) (res map[int64]*user.UserBase, err error)
JustGetUserBase 只取UserBase,不要其他
func (*Dao) MergeUploadReq ¶
func (d *Dao) MergeUploadReq(c context.Context, rurl string, uploadID string, profile string, svid int64, auth string) (err error)
MergeUploadReq ..
func (*Dao) ModifyRelation ¶
func (d *Dao) ModifyRelation(c context.Context, mid, upMid int64, action int32) (res *user.ModifyRelationReply, err error)
ModifyRelation .
func (*Dao) NoticeList ¶
func (d *Dao) NoticeList(ctx context.Context, noticeType int32, mid, cursorID int64) (list []*notice.NoticeBase, err error)
NoticeList 获取通知列表
func (*Dao) ParseRel2ID ¶
ParseRel2ID 转换搜索相对id到自增id
func (*Dao) PhoneCheck ¶
PhoneCheck .
func (*Dao) PushCallback ¶
func (d *Dao) PushCallback(c context.Context, tid string, nid string, mid int64, buvid string) (err error)
PushCallback .
func (*Dao) PushLogout ¶
PushLogout .
func (*Dao) RawPlayURLs ¶
func (d *Dao) RawPlayURLs(c context.Context, cids []int64, qn int64, plat string) (res map[int64]*v1.CVideo, err error)
RawPlayURLs 批量获取cid playurl
func (*Dao) RawRecList ¶
func (d *Dao) RawRecList(ctx context.Context, size int64, mid int64, buvid string) (svIDs []int64, err error)
RawRecList 获取推荐列表
func (*Dao) RawSVBvcKey ¶
func (d *Dao) RawSVBvcKey(c context.Context, svids []int64) (res map[int64][]*model.SVBvcKey, err error)
RawSVBvcKey 批量获取playurl相对地址
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) RawVideoStatistics ¶
func (d *Dao) RawVideoStatistics(c context.Context, svid int64) (res *model.VideoStatistics, err error)
RawVideoStatistics .
func (*Dao) RawVideos ¶
func (d *Dao) RawVideos(ctx context.Context, svIDs []int64) (res map[int64]*model.SvInfo, err error)
RawVideos 从数据库批量获取视频信息
func (*Dao) RelPlayURLs ¶
func (d *Dao) RelPlayURLs(c context.Context, addrs []string) (res map[string]*grpc.VideoKeyItem, err error)
RelPlayURLs 相对地址批量获取playurl
func (*Dao) RelRecList ¶
RelRecList 相关推荐列表
func (*Dao) ReplyAdd ¶
func (d *Dao) ReplyAdd(c context.Context, req map[string]interface{}) (res *model.AddRes, err error)
ReplyAdd http请求添加评论
func (*Dao) ReplyCounts ¶
func (d *Dao) ReplyCounts(c context.Context, ids []int64, t int64) (res map[int64]*model.ReplyCount, err error)
ReplyCounts 批量评论数
func (*Dao) ReplyCursor ¶
func (d *Dao) ReplyCursor(c context.Context, req map[string]interface{}) (res *model.CursorRes, err error)
ReplyCursor http请求游标获取评论
func (*Dao) ReplyHot ¶
func (d *Dao) ReplyHot(c context.Context, mid int64, oids []int64) (res map[int64][]*model.Reply, err error)
ReplyHot 获取批量热评
func (*Dao) ReplyList ¶
func (d *Dao) ReplyList(c context.Context, req map[string]interface{}) (res *model.ReplyList, err error)
ReplyList 评论列表
func (*Dao) ReplyMinfo ¶
func (d *Dao) ReplyMinfo(c context.Context, svID int64, rpids []int64) (res map[int64]*model.Reply, err error)
ReplyMinfo 批量请求评论
func (*Dao) ReplyReport ¶
ReplyReport 评论举报
func (*Dao) ReplySubCursor ¶
func (d *Dao) ReplySubCursor(c context.Context, req map[string]interface{}) (res *model.SubCursorRes, err error)
ReplySubCursor http请求子评论游标获取评论
func (*Dao) ReportDanmu ¶
func (d *Dao) ReportDanmu(c context.Context, danmu int64, mid int64, rmid int64, reason string) (err error)
ReportDanmu ..
func (*Dao) ReportUser ¶
func (d *Dao) ReportUser(c context.Context, rType int, mid int64, rmid int64, reason string) (err error)
ReportUser rType=0 face;rType=1 name;
func (*Dao) ReportVideo ¶
ReportVideo ..
func (*Dao) SearchBBQ ¶
func (d *Dao) SearchBBQ(c context.Context, sreq *model.SearchBaseReq) (ret *model.RawSearchRes, err error)
SearchBBQ 搜索视频
func (*Dao) SetMIDLastPubtime ¶
SetMIDLastPubtime redis设置
func (*Dao) SetUserShareToken ¶
SetUserShareToken .
func (*Dao) SugBBQ ¶
func (d *Dao) SugBBQ(c context.Context, sreq *model.SugBaseReq) (ret json.RawMessage, err error)
SugBBQ 搜索视频
func (*Dao) TxAddVideoStatistics ¶
func (d *Dao) TxAddVideoStatistics(tx *sql.Tx, videoStatistics *model.VideoStatistics) (num int64, err error)
TxAddVideoStatistics .
func (*Dao) TxDecrVideoStatisticsLike ¶
TxDecrVideoStatisticsLike .
func (*Dao) TxIncrVideoStatisticsLike ¶
TxIncrVideoStatisticsLike .
func (*Dao) Upload ¶
func (d *Dao) Upload(c context.Context, fileName string, filePath string, file []byte) (location string, err error)
Upload .
func (*Dao) UserLikeList ¶
func (d *Dao) UserLikeList(c context.Context, upMid int64, cursorPrev, cursorNext string) (res *user.ListUserLikeReply, err error)
UserLikeList .
func (*Dao) UserRelationList ¶
func (d *Dao) UserRelationList(c context.Context, userReq *user.ListRelationUserInfoReq, relationType int32) (res *v1.UserRelationListResponse, err error)
UserRelationList .