service

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) Close

func (s *Service) Close()

Close Service

func (*Service) CreatePushTask

func (s *Service) CreatePushTask(task *model.ApPushTask, total int) (affected int64, err error)

CreatePushTask create push task

func (*Service) GetFansBySwitch

func (s *Service) GetFansBySwitch(c context.Context, targetID int64) (fans map[int64]bool, fansSP map[int64]bool, err error)

GetFansBySwitch 开播提醒,获取开关mids

func (*Service) GetFansBySwitchAndSpecial

func (s *Service) GetFansBySwitchAndSpecial(c context.Context, targetID int64) (fans map[int64]bool, fansSP map[int64]bool, err error)

GetFansBySwitchAndSpecial 开播提醒,获取开关用户与特别关注用户的交集

func (*Service) GetMids

func (s *Service) GetMids(c context.Context, task *model.ApPushTask) map[int][]int64

GetMids 开播提醒,根据配置的策略从不同来源获取需要推送的用户id

func (*Service) GetPushGroup

func (s *Service) GetPushGroup(t int, g string) string

GetPushGroup 获取不同类型的group 兼容逻辑: 开播提醒topic有指定的group(并且单次开播需要区分关注与特别关注两个group),其余common message topic会传group

func (*Service) InitCommonTask

func (s *Service) InitCommonTask(m *model.LiveCommonMessage) (task *model.ApPushTask)

InitCommonTask Init push task by common message model

func (*Service) InitPushTask

func (s *Service) InitPushTask(m *model.StartLiveMessage) (task *model.ApPushTask)

InitPushTask 初始化开播提醒推送task

func (*Service) LimitDecrease

func (s *Service) LimitDecrease(ctx context.Context, business, targetID, uuid, midStr string) (err error)

LimitDecrease do mid string limit decrease

func (*Service) LiveCommonMessage

func (s *Service) LiveCommonMessage(ctx context.Context, msg *databus.Message) (err error)

LiveCommonMessage 直播通用消息

func (*Service) LiveStartMessage

func (s *Service) LiveStartMessage(ctx context.Context, msg *databus.Message) (err error)

LiveStartMessage 直播开播提醒推送消息

func (*Service) Ping

func (s *Service) Ping(c context.Context) (err error)

Ping Service

func (*Service) Push

func (s *Service) Push(task *model.ApPushTask, midMap map[int][]int64) (total int)

Push 组装业务参数,调用推送平台接口

Jump to

Keyboard shortcuts

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