v2

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

Documentation

Index

Constants

View Source
const (
	// GoRoutingErr ...
	// 协程wait错误
	GoRoutingErr = "协程等待数据错误"
)

Variables

View Source
var LastHourItemCache atomic.Value

Functions

func AdaptLivingField

func AdaptLivingField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	roomPendentInfo map[int64]*roomV1.RoomPendantGetPendantByIdsResp_Result,
	userResult map[int64]*accountM.Card,
	relationInfo map[int64]*relationRpcV1.BaseInfoGetFollowTypeResp_UidInfo,
	pkIDInfo map[string]int64, playURLInfo map[int64]*bvc.PlayUrlItem, specialUID []int64, normalUID []int64,
	mapUfos2Rolaids map[int64]int64) (resp []*v2pb.MyIdolItem)

AdaptLivingField ... implementation [app端关注首页]填充数据

func AppSortRuleOnline

func AppSortRuleOnline(originResult []*v2pb.MyIdolItem) (resp []*v2pb.MyIdolItem)

AppSortRuleOnline implementation [app端关注二级页]按照人气值排序

func CheckLiveAnchorParams

func CheckLiveAnchorParams(ctx context.Context, page int64) (uid int64, relationPage int64, err error)

CheckLiveAnchorParams ... implementation [app端关注首页]入参校验

func GetGiftInfo

func GetGiftInfo(ctx context.Context) (giftInfo map[int64]int64, err error)

GetGiftInfo ... 获取送礼信息

func GetLastLiveAnchorInfo

func GetLastLiveAnchorInfo(ctx context.Context, roomResult map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo,
	RoomIDs []int64, RoomID2UID map[int64]int64, ExtraInfo *v2pb.MyIdolExtra) (uid int64, relationPage int64, err error)

GetLastLiveAnchorInfo ... implementation [app端关注首页]获取最新一次直播信息

func GetLivingRooms

GetLivingRooms ... implementation [app端关注首页]获取正在直播房间

func GetUIDFromHeader

func GetUIDFromHeader(ctx context.Context) (uid int64)

GetUIDFromHeader ... 获取uid

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]*bvc.PlayUrlItem,
	relationInfo map[int64]*relationRpcV1.BaseInfoGetFollowTypeResp_UidInfo,
	ufos []int64, mapUfos2Rolaids map[int64]int64) (resp []*v2pb.MyIdolItem)

LiveFireField ... implementation [app端关注首页]填充数据

func RParseInt

func RParseInt(inputStr string, defaultValue int64) (output int64)

RParseInt ... 转int

func RoleMap

func RoleMap(role int8) (changeType int64)

RoleMap ... 兼容主站个人认证信息 见 http://info.bilibili.co/pages/viewpage.action?pageId=8742464 当前与客户端约定为, 0:个人 1:企业 -1:没有

Types

type ChunkCallInfo

type ChunkCallInfo struct {
	ParamsName string
	URLName    string
	ChunkSize  int64
	ChunkNum   int64
	RPCTimeout int64
}

ChunkCallInfo ... 日志结构体

type Gray

type Gray struct {
	Key   string
	Value int
}

Gray ... 自定义灰度策略结构

type GrayList

type GrayList []Gray

GrayList ... 自定义灰度策略

func SortMapByValue

func SortMapByValue(m map[string]int) GrayList

SortMapByValue ... 自定义排序

func (GrayList) Len

func (p GrayList) Len() int

Len 自定义排序

func (GrayList) Less

func (p GrayList) Less(i, j int) bool

Less 自定义排序

func (GrayList) Swap

func (p GrayList) Swap(i, j int)

Swap 自定义排序

type GrayRule

type GrayRule struct {
	Name  string `json:"name"`
	Mark  string `json:"mark"`
	Value string `json:"value"`
}

GrayRule ... 自定义灰度策略

type IndexService

type IndexService struct {

	// cache
	// all base module cache
	//AllMInfoMap     map[int64][]*v2pb.ModuleInfo
	AllMInfoMap atomic.Value
	// contains filtered or unexported fields
}

IndexService struct

func NewIndexService

func NewIndexService(c *conf.Config) (s *IndexService)

NewIndexService init

func (*IndexService) App531ABTest

func (s *IndexService) App531ABTest(ctx context.Context, content string) (grayType int64)

App531ABTest ... ABTest

func (*IndexService) App536ABTest

func (s *IndexService) App536ABTest(mid int64, platform string) (grayType int64)

App536ABTest ... hard code配置 ABTest

func (*IndexService) AppFilterGold

func (s *IndexService) AppFilterGold(ctx context.Context, originResult *v1pb.LiveAnchorResp) (resp []*v1pb.LiveAnchorResp_Rooms, err error)

AppFilterGold implementation [app端关注二级页]过滤送礼

func (*IndexService) AppFilterRuleFansMedal

func (s *IndexService) AppFilterRuleFansMedal(ctx context.Context, originResult *v1pb.LiveAnchorResp, targetUIDs []int64) (resp []*v1pb.LiveAnchorResp_Rooms, err error)

AppFilterRuleFansMedal implementation [app端关注二级页]过滤粉丝勋章

func (*IndexService) AppSortRuleGold

func (s *IndexService) AppSortRuleGold(ctx context.Context, originResult *v2pb.MMyIdol) (resp []*v2pb.MyIdolItem)

AppSortRuleGold implementation [app端关注二级页]按照送礼排序

func (*IndexService) AppSortRuleLiveTime

func (s *IndexService) AppSortRuleLiveTime(originResult []*v2pb.MyIdolItem) (resp []*v2pb.MyIdolItem)

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

func (*IndexService) Change

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

Change implementation 换一换接口 `midware:"guest,verify"`

func (*IndexService) CheckLiveAnchorParams

func (s *IndexService) CheckLiveAnchorParams(ctx context.Context, req *v2pb.GetAllListReq) (uid int64, relationPage int64, err error)

CheckLiveAnchorParams implementation 入参校验

func (*IndexService) GetAllList

func (s *IndexService) GetAllList(ctx context.Context, req *v2pb.GetAllListReq) (resp *v2pb.GetAllListResp, err error)

GetAllList implementation 首页大接口 `midware:"guest,verify"`

func (*IndexService) GetAllModuleInfoMapFromCache

func (s *IndexService) GetAllModuleInfoMapFromCache(ctx context.Context) (res map[int64][]*v2pb.ModuleInfo)

GetAllModuleInfoMapFromCache get all module info fromcache

func (*IndexService) GetFansMedal

func (s *IndexService) GetFansMedal(ctx context.Context, req *fansMedalV1.FansMedalTargetsWithMedalReq) (fansResult map[int64]bool, err error)

GetFansMedal ... 获取粉丝勋章佩戴信息

func (*IndexService) GetGrayRule

GetGrayRule ... 获取灰度规则信息

func (*IndexService) GetIndexV2SeaPatrol

func (s *IndexService) GetIndexV2SeaPatrol(ctx context.Context, req *liveUserV1.NoteGetReq) (ret []*v2pb.MSeaPatrol, err error)

GetIndexV2SeaPatrol ... 获取APP首页 - 我的大航海提示信息

func (*IndexService) GetIndexV2TagList

func (s *IndexService) GetIndexV2TagList(ctx context.Context, req *liveUserV1.UserSettingGetTagReq) (ret []*v2pb.MMyTag, err error)

GetIndexV2TagList ... 获取APP首页 - 我的个人标签列表

func (*IndexService) GetLastLiveTime

func (s *IndexService) GetLastLiveTime(ctx context.Context, rolaids []int64) (resp map[string]string, err error)

GetLastLiveTime ... 获取Record信息

func (*IndexService) GetLiveUserExp

func (s *IndexService) GetLiveUserExp(ctx context.Context, UIDs []int64) (userResult map[int64]*liveUserExpM.LevelInfo, err error)

GetLiveUserExp 获取用户经验信息

func (*IndexService) GetPkID

func (s *IndexService) GetPkID(ctx context.Context, req *avV1.PkGetPkIdsByRoomIdsReq) (avResult map[string]int64, err error)

GetPkID ... 获取PkId信息

func (*IndexService) GetRoomInfo

GetRoomInfo ... 获取room信息

func (*IndexService) GetRoomNewsInfo

func (s *IndexService) GetRoomNewsInfo(ctx context.Context, rolaids *roomExV1.RoomNewsMultiGetReq) (roomNewsResult map[int64]*roomExV1.RoomNewsMultiGetResp_Data, err error)

GetRoomNewsInfo ... 获取公告信息

func (*IndexService) GetRoomPendantInfo

func (s *IndexService) GetRoomPendantInfo(ctx context.Context, req *roomV1.RoomPendantGetPendantByIdsReq) (roomNewsResult map[int64]*roomV1.RoomPendantGetPendantByIdsResp_Result, err error)

GetRoomPendantInfo ... 获取角标信息

func (*IndexService) GetUserInfo

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

GetUserInfo 获取用户信息

func (*IndexService) LiveAnchorHomePage

func (s *IndexService) LiveAnchorHomePage(ctx context.Context, relationPage int64, build int64, platform string, quality int64) (Resp []*v2pb.MMyIdol)

LiveAnchorHomePage ... implementation [app端关注首页]正在直播接口

func (*IndexService) MakeLiveAnchorDefaultResult

func (s *IndexService) MakeLiveAnchorDefaultResult(Resp []*v2pb.MMyIdol, ExtraInfo *v2pb.MyIdolExtra)

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

func (*IndexService) SliceForHomePage

func (s *IndexService) SliceForHomePage(input []*v2pb.MyIdolItem, page int64, uid int64, platform string) (resp []*v2pb.MyIdolItem, relationPage int64)

SliceForHomePage ... implementation app534规则 [app端关注首页]首页slice逻辑,客户端只显示偶数个数,为兼容推荐去重,当个数为3时返回2

https://www.tapd.cn/20082211/prong/stories/view/1120082211001067961
https://www.tapd.cn/20082211/prong/stories/view/1120082211001085685

app536规则 https://www.tapd.cn/20082211/prong/stories/view/1120082211001104459

func (*IndexService) UIDs2roomIDs

func (s *IndexService) UIDs2roomIDs(ctx context.Context, UIDs []int64) (roomIDs map[int64]int64, err error)

UIDs2roomIDs ... uid转换roomID,每批最大400

type Pair

type Pair struct {
	Key   int64
	Value int64
}

Pair ... 自定义map排序结构

type PairList

type PairList []Pair

PairList ... 自定义灰度策略

func SortMap

func SortMap(input map[int64]int64) (sorted PairList)

SortMap ... 自定义排序

func (PairList) Len

func (p PairList) Len() int

Len 自定义排序

func (PairList) Less

func (p PairList) Less(i, j int) bool

Less 自定义排序

func (PairList) Swap

func (p PairList) Swap(i, j int)

Swap 自定义排序

type RelationService

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

RelationService struct

func (*RelationService) GetUserInfoData

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

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

type SendGift

type SendGift struct {
	Mid int64
	// contains filtered or unexported fields
}

SendGift ... [app端关注二级页]按照金瓜子排序结构

type SortLiveTime

type SortLiveTime []*v2pb.MyIdolItem

SortLiveTime ... implementation [app端关注二级页]按照开播时间排序

func (SortLiveTime) Len

func (p SortLiveTime) Len() int

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

func (SortLiveTime) Less

func (p SortLiveTime) Less(i, j int) bool

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

func (SortLiveTime) Swap

func (p SortLiveTime) Swap(i, j int)

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

type SortOnlineTime

type SortOnlineTime []*v2pb.MyIdolItem

SortOnlineTime ... implementation [app端关注二级页]按照房间人气值排序

func (SortOnlineTime) Len

func (p SortOnlineTime) Len() int

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

func (SortOnlineTime) Less

func (p SortOnlineTime) Less(i, j int) bool

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

func (SortOnlineTime) Swap

func (p SortOnlineTime) Swap(i, j int)

AppSortRuleLiveTime implementation [app端关注二级页]按照开播时间排序

type SortUIDGift

type SortUIDGift []SendGift

SortUIDGift ... implementation [app端关注二级页]按照送礼排序

func (SortUIDGift) Len

func (p SortUIDGift) Len() int

Len [app端关注二级页]自定义排序结构

func (SortUIDGift) Less

func (p SortUIDGift) Less(i, j int) bool

Less [app端关注二级页]自定义排序结构

func (SortUIDGift) Swap

func (p SortUIDGift) Swap(i, j int)

Swap [app端关注二级页]自定义排序结构

Jump to

Keyboard shortcuts

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