Documentation ¶
Index ¶
- Constants
- Variables
- func AdaptLivingField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo, ...) (resp []*v2pb.MyIdolItem)
- func AppSortRuleOnline(originResult []*v2pb.MyIdolItem) (resp []*v2pb.MyIdolItem)
- func CheckLiveAnchorParams(ctx context.Context, page int64) (uid int64, relationPage int64, err error)
- func GetGiftInfo(ctx context.Context) (giftInfo map[int64]int64, err error)
- func GetLastLiveAnchorInfo(ctx context.Context, ...) (uid int64, relationPage int64, err error)
- func GetLivingRooms(roomResult map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo) (liveRoom map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo)
- func GetUIDFromHeader(ctx context.Context) (uid int64)
- func LiveFireField(roomInfo map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo, ...) (resp []*v2pb.MyIdolItem)
- func RParseInt(inputStr string, defaultValue int64) (output int64)
- func RoleMap(role int8) (changeType int64)
- type ChunkCallInfo
- type Gray
- type GrayList
- type GrayRule
- type IndexService
- func (s *IndexService) App531ABTest(ctx context.Context, content string) (grayType int64)
- func (s *IndexService) App536ABTest(mid int64, platform string) (grayType int64)
- func (s *IndexService) AppFilterGold(ctx context.Context, originResult *v1pb.LiveAnchorResp) (resp []*v1pb.LiveAnchorResp_Rooms, err error)
- func (s *IndexService) AppFilterRuleFansMedal(ctx context.Context, originResult *v1pb.LiveAnchorResp, targetUIDs []int64) (resp []*v1pb.LiveAnchorResp_Rooms, err error)
- func (s *IndexService) AppSortRuleGold(ctx context.Context, originResult *v2pb.MMyIdol) (resp []*v2pb.MyIdolItem)
- func (s *IndexService) AppSortRuleLiveTime(originResult []*v2pb.MyIdolItem) (resp []*v2pb.MyIdolItem)
- func (s *IndexService) Change(ctx context.Context, req *v2pb.ChangeReq) (resp *v2pb.ChangeResp, err error)
- func (s *IndexService) CheckLiveAnchorParams(ctx context.Context, req *v2pb.GetAllListReq) (uid int64, relationPage int64, err error)
- func (s *IndexService) GetAllList(ctx context.Context, req *v2pb.GetAllListReq) (resp *v2pb.GetAllListResp, err error)
- func (s *IndexService) GetAllModuleInfoMapFromCache(ctx context.Context) (res map[int64][]*v2pb.ModuleInfo)
- func (s *IndexService) GetFansMedal(ctx context.Context, req *fansMedalV1.FansMedalTargetsWithMedalReq) (fansResult map[int64]bool, err error)
- func (s *IndexService) GetGrayRule(ctx context.Context, req *userExV1.GrayRuleGetByMarkReq) (extResult *userExV1.GrayRuleGetByMarkResp_Data, err error)
- func (s *IndexService) GetIndexV2SeaPatrol(ctx context.Context, req *liveUserV1.NoteGetReq) (ret []*v2pb.MSeaPatrol, err error)
- func (s *IndexService) GetIndexV2TagList(ctx context.Context, req *liveUserV1.UserSettingGetTagReq) (ret []*v2pb.MMyTag, err error)
- func (s *IndexService) GetLastLiveTime(ctx context.Context, rolaids []int64) (resp map[string]string, err error)
- func (s *IndexService) GetLiveUserExp(ctx context.Context, UIDs []int64) (userResult map[int64]*liveUserExpM.LevelInfo, err error)
- func (s *IndexService) GetPkID(ctx context.Context, req *avV1.PkGetPkIdsByRoomIdsReq) (avResult map[string]int64, err error)
- func (s *IndexService) GetRoomInfo(ctx context.Context, input *roomV1.RoomGetStatusInfoByUidsReq) (roomResult map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo, err error)
- func (s *IndexService) GetRoomNewsInfo(ctx context.Context, rolaids *roomExV1.RoomNewsMultiGetReq) (roomNewsResult map[int64]*roomExV1.RoomNewsMultiGetResp_Data, err error)
- func (s *IndexService) GetRoomPendantInfo(ctx context.Context, req *roomV1.RoomPendantGetPendantByIdsReq) (roomNewsResult map[int64]*roomV1.RoomPendantGetPendantByIdsResp_Result, ...)
- func (s *IndexService) GetUserInfo(ctx context.Context, UIDs []int64) (userResult map[int64]*accountM.Card, err error)
- func (s *IndexService) LiveAnchorHomePage(ctx context.Context, relationPage int64, build int64, platform string, ...) (Resp []*v2pb.MMyIdol)
- func (s *IndexService) MakeLiveAnchorDefaultResult(Resp []*v2pb.MMyIdol, ExtraInfo *v2pb.MyIdolExtra)
- func (s *IndexService) SliceForHomePage(input []*v2pb.MyIdolItem, page int64, uid int64, platform string) (resp []*v2pb.MyIdolItem, relationPage int64)
- func (s *IndexService) UIDs2roomIDs(ctx context.Context, UIDs []int64) (roomIDs map[int64]int64, err error)
- type Pair
- type PairList
- type RelationService
- type SendGift
- type SortLiveTime
- type SortOnlineTime
- type SortUIDGift
Constants ¶
const ( // GoRoutingErr ... // 协程wait错误 GoRoutingErr = "协程等待数据错误" )
Variables ¶
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 ¶
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 ¶
func GetLivingRooms(roomResult map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo) (liveRoom map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo)
GetLivingRooms ... implementation [app端关注首页]获取正在直播房间
func GetUIDFromHeader ¶
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 RoleMap ¶
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 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 (*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 ¶
func (s *IndexService) GetGrayRule(ctx context.Context, req *userExV1.GrayRuleGetByMarkReq) (extResult *userExV1.GrayRuleGetByMarkResp_Data, err error)
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 ¶
func (s *IndexService) GetRoomInfo(ctx context.Context, input *roomV1.RoomGetStatusInfoByUidsReq) (roomResult map[int64]*roomV1.RoomGetStatusInfoByUidsResp_RoomInfo, err error)
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 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端关注二级页]按照开播时间排序