v1

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: 35 Imported by: 0

Documentation

Overview

Package v1 为粉版App、直播App端提供卡片聚合接口,展示直播首页、关注二级页信息 关注模块文档 http://info.bilibili.co/display/live/APP+5.34 首页模块文档 http://info.bilibili.co/pages/viewpage.action?pageId=11546573

Index

Constants

View Source
const (
	// RoomStatusLive ...
	RoomStatusLive = 1
	// MobileIndexBadgeColorDefault ...
	MobileIndexBadgeColorDefault = "#FB9E60"
)

Variables

This section is empty.

Functions

func AdaptField

func AdaptField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	fansInfo map[int64]*relationV1.FeedGetUserFcBatchResp_RelationList,
	userResult map[int64]*accountM.Card,
	roomedInfo map[int64]*roomExV1.RoomNewsMultiGetResp_Data,
	relationInfo map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo,
	specialUID []int64, normalUID []int64,
	mapUfos2Rolaids map[int64]int64, liveDesc map[int64]string, newsDesc map[int64]string) (resp []*v1pb.UnLiveAnchorResp_Rooms)

AdaptField implementation 填充逻辑

func AdaptLivingField

func AdaptLivingField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	roomPendentInfo map[int64]*roomV1.RoomPendantGetPendantByIdsResp_Result,
	userResult map[int64]*accountM.Card,
	relationInfo map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo,
	pkIDInfo map[string]int64, playURLInfo map[int64]*playurlbvc.PlayUrlItem, specialUID []int64, normalUID []int64,
	mapUfos2Rolaids map[int64]int64) (resp []*v1pb.LiveAnchorResp_Rooms)

AdaptLivingField ... 填充逻辑

func CalcTimeLine

func CalcTimeLine(liberateInfo map[int64]int64,
	roomNewsInfo map[int64]*roomExV1.RoomNewsMultiGetResp_Data) (liveDesc map[int64]string, newsDesc map[int64]string)

CalcTimeLine ... 计算时间规则

func CheckLiveAnchorParams

func CheckLiveAnchorParams(ctx context.Context, req *v1pb.LiveAnchorReq) (sortRule int64, filterRule int64, uid int64, err error)

CheckLiveAnchorParams implementation 入参校验

func CheckUnLiveAnchorParams

func CheckUnLiveAnchorParams(ctx context.Context, req *v1pb.UnLiveAnchorReq) (pass bool, page int64, pageSize int64, uid int64, err error)

CheckUnLiveAnchorParams implementation 入参校验

func CountLiveRooms

func CountLiveRooms(input map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo) (count int)

CountLiveRooms 计算正在直播数目

func FilterEverLived

func FilterEverLived(lastLiveTime map[string]string) (rolaids []int64, lifetime map[int64]int64, sorted relationT.PairList)

FilterEverLived ... 过滤未开播

func FilterType

func FilterType(ctx context.Context, targetUIDs []int64, originResult *v1pb.LiveAnchorResp, filterType int64)

FilterType implementation [app端关注二级页]按照规则过滤结果集

func FireField

func FireField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	fansInfo map[int64]*relationV1.FeedGetUserFcBatchResp_RelationList,
	userResult map[int64]*accountM.Card,
	roomedInfo map[int64]*roomExV1.RoomNewsMultiGetResp_Data,
	relationInfo map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo,
	ufos []int64,
	mapUfos2Rolaids map[int64]int64, liveDesc map[int64]string, newsDesc map[int64]string) (resp []*v1pb.UnLiveAnchorResp_Rooms)

FireField ... 适配返回值

func GetAttentionListAndGroup

func GetAttentionListAndGroup(ctx context.Context) (relationInfo map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo, groupList map[string][]int64,
	mapUfos2Rolaids map[int64]int64, mapRolaids2Ufos map[int64]int64, setRolaids []int64, attentionErr error)

GetAttentionListAndGroup ... 关注分组

func GetLastAnchorLiveTime

func GetLastAnchorLiveTime(lastLiveTime map[string]string) (rolaids []int64, lifetime map[int64]int64, sorted relationT.PairList)

GetLastAnchorLiveTime ... 获取上一个主播信息

func GetUID

func GetUID(idsMap map[int64]int64, input []int64) (resp []int64)

GetUID ... 获取uid

func GetUserFc

func GetUserFc(ctx context.Context, UIDs []int64) (userResult map[int64]*relationV1.FeedGetUserFcBatchResp_RelationList, err error)

GetUserFc ... 获取用户粉丝

func GroupUfos

func GroupUfos(input map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo) (resp map[string][]int64, err error)

GroupUfos ... 按照关注类型分组

func LiveFireField

func LiveFireField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	roomPendentInfo map[int64]*roomV1.RoomPendantGetPendantByIdsResp_Result,
	userResult map[int64]*accountM.Card,
	pkIDInfo map[string]int64, playURLInfo map[int64]*playurlbvc.PlayUrlItem,
	relationInfo map[int64]*relationV1.BaseInfoGetFollowTypeResp_UidInfo,
	ufos []int64, mapUfos2Rolaids map[int64]int64) (resp []*v1pb.LiveAnchorResp_Rooms)

LiveFireField ... 适配返回值

func MakeLiveAnchorDefaultResult

func MakeLiveAnchorDefaultResult(resp *v1pb.LiveAnchorResp)

MakeLiveAnchorDefaultResult ... 正在直播默认返回

func MakeUnLiveDefaultResult

func MakeUnLiveDefaultResult(resp *v1pb.UnLiveAnchorResp)

MakeUnLiveDefaultResult implementation 缺省返回

func SortType

func SortType(ctx context.Context, originResult *v1pb.LiveAnchorResp, sortType int64) (resp *v1pb.LiveAnchorResp, err error)

SortType implementation [app端关注二级页]按照规则排序结果集 规则见https://www.tapd.cn/20082211/prong/stories/view/1120082211001067961

func TimeLineRule

func TimeLineRule(liberateInfo map[int64]int64, roomNewsInfo map[int64]*roomExV1.RoomNewsMultiGetResp_Data) (liveDesc map[int64]string, newsDesc map[int64]string)

TimeLineRule ... 计算时间规则

func TransRoomedUUID

func TransRoomedUUID(mapUfos2Rolaids map[int64]int64) (mapRolaids2Ufos map[int64]int64, setRolaids []int64)

TransRoomedUUID ... 转换ids

func UnLiveAnchorSlice

func UnLiveAnchorSlice(req []*v1pb.UnLiveAnchorResp_Rooms, page int64, pageSize int64) (resp []*v1pb.UnLiveAnchorResp_Rooms)

UnLiveAnchorSlice implementation 分页逻辑

Types

type ModuleResp

type ModuleResp struct {
	Interval   int                      `json:"interval"`
	ModuleList []map[string]interface{} `json:"module_list"`
}

type RelationService

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

RelationService struct

func NewRelationService

func NewRelationService(c *conf.Config) (s *RelationService)

NewRelationService init

func (*RelationService) GetUserInfoData

func (s *RelationService) GetUserInfoData(ctx context.Context, UIDs []int64) (userResult map[int64]*accountM.Card, err error)

GetUserInfoData ... 调用account grpc接口cards获取用户信息

func (*RelationService) GroupByRule

func (s *RelationService) GroupByRule(ctx context.Context, special map[int64]bool, normal map[int64]bool,
	liberate map[int64]int64, sorted relationT.PairList, mapRolaids2Ufos map[int64]int64) (specialRoomed []int64, normalRoomed []int64)

GroupByRule implementation 按照规则排序,组间按照特别关注优先,组内按照上次关播时间倒序

func (*RelationService) LiveAnchor

func (s *RelationService) LiveAnchor(ctx context.Context, req *v1pb.LiveAnchorReq) (resp *v1pb.LiveAnchorResp, err error)

LiveAnchor implementation [app端关注二级页][全量]正在直播接口

func (*RelationService) UnliveAnchor

func (s *RelationService) UnliveAnchor(ctx context.Context, req *v1pb.UnLiveAnchorReq) (resp *v1pb.UnLiveAnchorResp, err error)

UnliveAnchor ... implementation 直播二级页暂未开播接口

type Service

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

Service struct

func New

func New(c *conf.Config) (s *Service)

New init

func (*Service) Change

func (s *Service) Change(ctx context.Context, req *v1indexpb.ChangeReq) (resp *v1indexpb.ChangeResp, err error)

Change implementation 首页换一换接口 for 天马

func (*Service) GetAllList

func (s *Service) GetAllList(ctx context.Context, req *v1indexpb.GetAllListReq) (ret interface{}, err error)

GetAllList implementation 首页大接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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