Documentation ¶
Index ¶
- Constants
- type Dao
- func (d *Dao) AddSVTotal(mid int64) (err error)
- func (d *Dao) AddUpUserDmg(c context.Context, upUserDmg *model.UpUserDmg) (num int64, err error)
- func (d *Dao) BeginTran(c context.Context) (*xsql.Tx, error)
- func (d *Dao) CacheUserBbqDmg(c context.Context, userBbqDmg *model.UserBbqDmg) (mid string, err error)
- func (d *Dao) CacheUserBbqDmgBuvid(c context.Context, userBbqDmgBuvid *model.UserBbqBuvidDmg) (Buvid string, err error)
- func (d *Dao) CacheUserDmg(c context.Context, userDmg *model.UserDmg) (mid string, err error)
- func (d *Dao) Close()
- func (d *Dao) CmsRule(svid int64) (flag bool)
- func (d *Dao) CreateDir(path string) (err error)
- func (d *Dao) CreateNotice(ctx context.Context, notice *notice.NoticeBase) (err error)
- func (d *Dao) DelUpUserDmg(c context.Context) (num int64, err error)
- func (d *Dao) Download(url string, name string) (fpath string, err error)
- func (d *Dao) GetNewSysMsg(ctx context.Context, id int64) (list []*msg.SysMsg, err error)
- func (d *Dao) GetRecallOpVideo(c context.Context) (ids []int64, err error)
- func (d *Dao) GetSvidByCid(c context.Context, cid int64) (svid int64, err error)
- func (d *Dao) GetSyncOperVideoExportTime(c context.Context) (t string, err error)
- func (d *Dao) GetSyncOperVideoFlag(c context.Context) (tag int64, err error)
- func (d *Dao) GetVideoByLastID(c context.Context, last int64) (IDs []int64, lastRet int64, err error)
- func (d *Dao) HandlerMid(s string)
- func (d *Dao) HandlerMids(mids []int64)
- func (d *Dao) HandlerUserBbqDmg(user string)
- func (d *Dao) HandlerUserBbqDmgBuvid(user string)
- func (d *Dao) HandlerUserDmg(user string)
- func (d *Dao) HandlerViewedVideo(v string) (res map[int64]string)
- func (d *Dao) InsertOnDup(c context.Context, upUserDmg *model.UpUserDmg) (err error)
- func (d *Dao) MergeUpInfo(mid int64) (err error)
- func (d *Dao) Ping(c context.Context) error
- func (d *Dao) QueryJobStatus(c context.Context, jobURL string) (urls []string, err error)
- func (d *Dao) QueryOperaVideo(c context.Context, date string, ch chan<- *model.VideoHiveInfo) (err error)
- func (d *Dao) QueryPlayDaily(c context.Context, date string) (vlist []*model.VideoHiveInfo, err error)
- func (d *Dao) QueryUpMid(c context.Context, date string) (jobURL string, err error)
- func (d *Dao) QueryUpUserDmg(c context.Context, mid int64) (upUserDmg []*model.UpUserDmg, err error)
- func (d *Dao) QueryUserBasic(c context.Context) (jobURL string, err error)
- func (d *Dao) QueryUserDmg(c context.Context) (jobURL string, err error)
- func (d *Dao) RawBbqVideo(ctx context.Context, SVID []int64) (res *model.VideoRaw, err error)
- func (d *Dao) RawCheckTask(c context.Context, taskName string) (res *model.CheckTask, err error)
- func (d *Dao) RawGetIDByMtime(baseTableQuery string, mtime int64) (ids []int64, lastMtime int64, err error)
- func (d *Dao) RawTagByMtime(c context.Context, mtime int64) (ids string, res int64, err error)
- func (d *Dao) RawVideo(ctx context.Context, SVID int64) (res *model.VideoRepRaw, err error)
- func (d *Dao) RawVideoByID(ctx context.Context, ID int64) (res *model.VideoRepRaw, err error)
- func (d *Dao) RawVideoBySVIDS(c context.Context, svids []string) (res map[int64]string, err error)
- func (d *Dao) RawVideoTagByIDs(c context.Context, ids string, id int64) (svids string, res int64, err error)
- func (d *Dao) ReadLine(path string, handler func(string)) (err error)
- func (d *Dao) ReadLines(path string, handler func([]int64)) (err error)
- func (d *Dao) ReplyReg(c context.Context, req map[string]interface{}) (err error)
- func (d *Dao) SelMidFromUserBase(start int) (mids []int64, err error)
- func (d *Dao) SelMidFromVideo() (mids []int64, err error)
- func (d *Dao) SendMail(message *gomail.Message) (err error)
- func (d *Dao) SetRecallOpVideo(c context.Context, ids []int64) (err error)
- func (d *Dao) SetSyncOperVideoFlag(c context.Context, v int64) (err error)
- func (d *Dao) TransToCheckBack() (err error)
- func (d *Dao) TransToReview() (err error)
- func (d *Dao) UpUserBases(c context.Context, mids []int64) (err error)
- func (d *Dao) UpdateCms(c context.Context, v *model.VideoRaw) (err error)
- func (d *Dao) UpdateSvid(c context.Context, id int64, svid int64) (err error)
- func (d *Dao) UpdateSyncStatus(ctx context.Context, SVID int64, st int64) (err error)
- func (d *Dao) UpdateTaskLastCheck(c context.Context, taskName string, lastCheck int64) (num int64, err error)
- func (d *Dao) UpdateUVSt(mid int64, field string) (err error)
- func (d *Dao) UpdateUVStDel(mid int64, field string) (err error)
- func (d *Dao) UpdateUpUserDmg(c context.Context, upUserDmg *model.UpUserDmg) (num int64, err error)
- func (d *Dao) UpdateVideoUploadProcessStatus(ctx context.Context, SVID int64, st int64) (err error)
- func (d *Dao) UserProfileGet(c context.Context) (jobURL []string, err error)
- func (d *Dao) UsersByLast(c context.Context, lastid int64) (r []*model.UserBaseDB, err error)
- func (d *Dao) VideoList(c context.Context, id int64) (ids string, res []*v1.VideoESInfo, err error)
- func (d *Dao) VideoListByIDs(c context.Context, ids string) (res []*v1.VideoESInfo, err error)
- func (d *Dao) VideoStatisticsHiveList(c context.Context, ids string) (res map[int64]*v1.VideoESInfo, err error)
- func (d *Dao) VideoStatisticsList(c context.Context, ids string) (res map[int64]*v1.VideoESInfo, err error)
- func (d *Dao) VideoTagsList(c context.Context, ids string) (res map[int64][]*v1.VideoESTags, err error)
- func (d *Dao) VideosByLast(c context.Context, lastid int64) (svinfo []*model.VideoDB, err error)
Constants ¶
const ( NoticeBizTypeSv = 1 NoticeBizTypeComment = 2 NoticeBizTypeUser = 3 NoticeBizTypeSysMsg = 4 )
通知的业务类型
const ( NoticeTypeLike = 1 NoticeTypeComment = 2 NoticeTypeFan = 3 NoticeTypeSysMsg = 4 )
通知类型
const ( // MaxSyncESNum 限制每次更新到es的数量 MaxSyncESNum = 100 // QueryVideoByMtime 根据mtime获取视频基础信息 QueryVideoByMtime = "select `svid`,`mtime` from video where mtime >= ? order by mtime asc" // QueryVideoStatisticsByMtime 根据mtime获取视频相关播放信息 QueryVideoStatisticsByMtime = "select `svid`,`mtime` from video_statistics where mtime >= ? order by mtime asc" // QueryVideoStatisticsHiveByMtime 根据mtime获取视频主站信息 QueryVideoStatisticsHiveByMtime = "select `svid`,`mtime` from video_statistics_hive where mtime >= ? order by mtime asc" // QueryVideoTagByMtime 根据mtime获取视频tag信息 QueryVideoTagByMtime = "select `svid`,`mtime` from video_tag where mtime >= ? order by mtime asc" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct { HTTPClient *bm.Client SearchClient searchv1.SearchClient VideoClient videov1.VideoClient AccountClient account.AccountClient // contains filtered or unexported fields }
Dao dao
func (*Dao) AddUpUserDmg ¶
AddUpUserDmg .
func (*Dao) CacheUserBbqDmg ¶
func (d *Dao) CacheUserBbqDmg(c context.Context, userBbqDmg *model.UserBbqDmg) (mid string, err error)
CacheUserBbqDmg ...
func (*Dao) CacheUserBbqDmgBuvid ¶
func (d *Dao) CacheUserBbqDmgBuvid(c context.Context, userBbqDmgBuvid *model.UserBbqBuvidDmg) (Buvid string, err error)
CacheUserBbqDmgBuvid ...
func (*Dao) CacheUserDmg ¶
CacheUserDmg ...
func (*Dao) CreateNotice ¶
CreateNotice 创建通知
func (*Dao) DelUpUserDmg ¶
DelUpUserDmg .
func (*Dao) GetNewSysMsg ¶
GetNewSysMsg 获取未被推送的系统消息
func (*Dao) GetRecallOpVideo ¶
GetRecallOpVideo 获取精选视频
func (*Dao) GetSvidByCid ¶
GetSvidByCid 根据cid获取svid
func (*Dao) GetSyncOperVideoExportTime ¶
GetSyncOperVideoExportTime ...
func (*Dao) GetSyncOperVideoFlag ¶
GetSyncOperVideoFlag 获取同步信号灯
func (*Dao) GetVideoByLastID ¶
func (d *Dao) GetVideoByLastID(c context.Context, last int64) (IDs []int64, lastRet int64, err error)
GetVideoByLastID 获取所有SVID
func (*Dao) HandlerMids ¶
HandlerMids update userbase by mids
func (*Dao) HandlerUserBbqDmgBuvid ¶
HandlerUserBbqDmgBuvid ..
func (*Dao) HandlerUserDmg ¶
HandlerUserDmg mid, gender, age, geo, content_tag, viewed_video, content_zone, content_count, follow_ups
func (*Dao) HandlerViewedVideo ¶
HandlerViewedVideo 处理看过的视频,保存最近看过的100个
func (*Dao) InsertOnDup ¶
InsertOnDup ...
func (*Dao) MergeUpInfo ¶
MergeUpInfo merge up info
func (*Dao) QueryJobStatus ¶
QueryJobStatus 查询hive脚本执行结果
func (*Dao) QueryOperaVideo ¶
func (d *Dao) QueryOperaVideo(c context.Context, date string, ch chan<- *model.VideoHiveInfo) (err error)
QueryOperaVideo query operation video once
func (*Dao) QueryPlayDaily ¶
func (d *Dao) QueryPlayDaily(c context.Context, date string) (vlist []*model.VideoHiveInfo, err error)
QueryPlayDaily get video play rank list from berserker
func (*Dao) QueryUpMid ¶
QueryUpMid .发起hive查询,取粉丝数大于1万的up mid
func (*Dao) QueryUpUserDmg ¶
func (d *Dao) QueryUpUserDmg(c context.Context, mid int64) (upUserDmg []*model.UpUserDmg, err error)
QueryUpUserDmg .
func (*Dao) QueryUserBasic ¶
QueryUserBasic ...
func (*Dao) QueryUserDmg ¶
QueryUserDmg .
func (*Dao) RawBbqVideo ¶
RawBbqVideo ..
func (*Dao) RawCheckTask ¶
RawCheckTask 查询脚本任务
func (*Dao) RawGetIDByMtime ¶
func (d *Dao) RawGetIDByMtime(baseTableQuery string, mtime int64) (ids []int64, lastMtime int64, err error)
RawGetIDByMtime 获取最近更新的那些svid,该函数可以用于多个表的查询,只需传入不同表的查询语句即可
func (*Dao) RawTagByMtime ¶
RawTagByMtime 根据mtime获取tag信息
func (*Dao) RawVideoByID ¶
RawVideoByID ...get video info by id
func (*Dao) RawVideoBySVIDS ¶
RawVideoBySVIDS 根据svids获取视频
func (*Dao) RawVideoTagByIDs ¶
func (d *Dao) RawVideoTagByIDs(c context.Context, ids string, id int64) (svids string, res int64, err error)
RawVideoTagByIDs .
func (*Dao) SelMidFromUserBase ¶
SelMidFromUserBase get distinct mid list from table user_base
func (*Dao) SelMidFromVideo ¶
SelMidFromVideo get distinct mid list from table video
func (*Dao) SetRecallOpVideo ¶
SetRecallOpVideo 写入精选视频
func (*Dao) SetSyncOperVideoFlag ¶
SetSyncOperVideoFlag 设置同步信号灯
func (*Dao) UpUserBases ¶
UpUserBases 根据mids更新用户基本信息
func (*Dao) UpdateSvid ¶
UpdateSvid ...
func (*Dao) UpdateSyncStatus ¶
UpdateSyncStatus update video_repository sync_status
func (*Dao) UpdateTaskLastCheck ¶
func (d *Dao) UpdateTaskLastCheck(c context.Context, taskName string, lastCheck int64) (num int64, err error)
UpdateTaskLastCheck 更新上次执行时间
func (*Dao) UpdateUVSt ¶
UpdateUVSt 更新用户视频统计信息
func (*Dao) UpdateUVStDel ¶
UpdateUVStDel ...
func (*Dao) UpdateUpUserDmg ¶
UpdateUpUserDmg .
func (*Dao) UpdateVideoUploadProcessStatus ¶
UpdateVideoUploadProcessStatus ...
func (*Dao) UserProfileGet ¶
UserProfileGet ...
func (*Dao) UsersByLast ¶
UsersByLast 使用lastid批量获取用户
func (*Dao) VideoListByIDs ¶
VideoListByIDs 根据视频id获取视频基础信息
func (*Dao) VideoStatisticsHiveList ¶
func (d *Dao) VideoStatisticsHiveList(c context.Context, ids string) (res map[int64]*v1.VideoESInfo, err error)
VideoStatisticsHiveList 获取视频互动信息,hive表
func (*Dao) VideoStatisticsList ¶
func (d *Dao) VideoStatisticsList(c context.Context, ids string) (res map[int64]*v1.VideoESInfo, err error)
VideoStatisticsList 获取视频互动信息
func (*Dao) VideoTagsList ¶
func (d *Dao) VideoTagsList(c context.Context, ids string) (res map[int64][]*v1.VideoESTags, err error)
VideoTagsList 获取视频tags