cms

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MerakSign

func MerakSign(params map[string]string, secret string) (string, error)

MerakSign is used to sign for merak wechat msg

Types

type Dao

type Dao struct {
	DB *sql.DB
	// contains filtered or unexported fields
}

Dao dao.

func New

func New(c *conf.Config) (d *Dao)

New create a instance of Dao and return.

func (*Dao) ActOps

func (d *Dao) ActOps(ctx context.Context, ids []int64, on bool) (err error)

ActOps carries out the action on the season which need to be on/off shelves

func (*Dao) MerakNotify

func (d *Dao) MerakNotify(ctx context.Context, title, content string) (err error)

MerakNotify send notify

func (*Dao) OffArcs

func (d *Dao) OffArcs(ctx context.Context, aids []int64) (offAids []int64, err error)

OffArcs takes the archives that passed but cms invalid archives

func (*Dao) ReshelfArcs

func (d *Dao) ReshelfArcs(ctx context.Context, aids []int64) (err error)

ReshelfArcs re-put the arcs onshelf ( CMS valid )

func (*Dao) ShelveOp

func (d *Dao) ShelveOp(ctx context.Context, validSns map[int64]int) (onIDs, offIDs []int64, err error)

ShelveOp gets the status of all audited seasons on and off shelves, and compare the results with the "ValidSns" method above to determine which episodes need to be on or off shelves.

func (*Dao) ValidSns

func (d *Dao) ValidSns(ctx context.Context, onlyfree bool) (res map[int64]int, err error)

ValidSns gets all the seasons that should be on the shelves, which includes free and audited episodes.

Jump to

Keyboard shortcuts

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