service

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetUserMangaRequest

type GetUserMangaRequest struct {
	Username string `validate:"required" mod:"trim,lcase"`
	Page     int    `validate:"required,gte=1" mod:"default=1"`
	Limit    int    `validate:"required,gte=-1" mod:"default=20"`
}

GetUserMangaRequest is get user manga request model.

type Manga

type Manga struct {
	ID                int64             `json:"id"`
	Title             string            `json:"title"`
	AlternativeTitles alternativeTitles `json:"alternative_titles"`
	Picture           string            `json:"picture"`
	StartDate         date              `json:"start_date"`
	EndDate           date              `json:"end_date"`
	Synopsis          string            `json:"synopsis"`
	Background        string            `json:"background"`
	NSFW              bool              `json:"nsfw"`
	Type              entity.Type       `json:"type" swaggertype:"string"`
	Status            entity.Status     `json:"status" swaggertype:"string"`
	Chapter           int               `json:"chapter"`
	Volume            int               `json:"volume"`
	Mean              float64           `json:"mean"`
	Rank              int               `json:"rank"`
	Popularity        int               `json:"popularity"`
	Member            int               `json:"member"`
	Voter             int               `json:"voter"`
	Genres            []genre           `json:"genres"`
	Pictures          []string          `json:"pictures"`
	Related           []related         `json:"related"`
	Authors           []author          `json:"authors"`
	Serialization     []magazine        `json:"serialization"`
	UpdatedAt         time.Time         `json:"updated_at"`
}

Manga is manga model.

type Pagination

type Pagination struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
	Total int `json:"total"`
}

Pagination is pagination model.

type Service

type Service interface {
	GetMangaByID(ctx context.Context, id int64) (*Manga, int, error)

	GetUserManga(ctx context.Context, data GetUserMangaRequest) ([]UserManga, *Pagination, int, error)

	ConsumeMessage(ctx context.Context, msg entity.Message) error

	QueueOldReleasingManga(ctx context.Context, limit int) (int, int, error)
	QueueOldFinishedManga(ctx context.Context, limit int) (int, int, error)
	QueueOldNotYetManga(ctx context.Context, limit int) (int, int, error)
	QueueMissingManga(ctx context.Context, limit int) (int, int, error)
	QueueOldUserManga(ctx context.Context, limit int) (int, int, error)
}

Service contains functions for service.

type UserManga

type UserManga struct {
	MangaID   int64         `json:"manga_id"`
	Title     string        `json:"title"`
	Status    entity.Status `json:"status" swaggertype:"string"`
	Score     int           `json:"score"`
	Chapter   int           `json:"chapter"`
	Volume    int           `json:"volume"`
	Tags      []string      `json:"tags"`
	Comment   string        `json:"comment"`
	UpdatedAt time.Time     `json:"updated_at"`
}

UserManga is user manga model.

Jump to

Keyboard shortcuts

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