artwork

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FavoriteArtwork

func FavoriteArtwork(ctx *gin.Context)

func GetArtwork

func GetArtwork(ctx *gin.Context)

func GetArtworkCount

func GetArtworkCount(ctx *gin.Context)

func GetArtworkFavoriteStatus

func GetArtworkFavoriteStatus(ctx *gin.Context)

func GetArtworkList

func GetArtworkList(ctx *gin.Context)

func LikeArtwork

func LikeArtwork(ctx *gin.Context)

func RandomArtworkPreview

func RandomArtworkPreview(ctx *gin.Context)

func RandomArtworks

func RandomArtworks(ctx *gin.Context)

func RegisterRouter

func RegisterRouter(r *gin.RouterGroup)

func ResponseFromArtwork

func ResponseFromArtwork(artwork *types.Artwork, isAuthorized bool) *common.RestfulCommonResponse[any]

func ResponseFromArtworks

func ResponseFromArtworks(artworks []*types.Artwork, isAuthorized bool) *common.RestfulCommonResponse[any]

func UnfavoriteArtwork

func UnfavoriteArtwork(ctx *gin.Context)

Types

type ArtworkIDRequest

type ArtworkIDRequest struct {
	ArtworkID string `form:"artwork_id" binding:"required" json:"artwork_id"`
}

type ArtworkResponseData

type ArtworkResponseData struct {
	ID          string             `json:"id"`
	CreatedAt   string             `json:"created_at"`
	Title       string             `json:"title"`
	Description string             `json:"description"`
	SourceURL   string             `json:"source_url"`
	R18         bool               `json:"r18"`
	LikeCount   uint               `json:"like_count"`
	Tags        []string           `json:"tags"`
	Artist      *types.Artist      `json:"artist"`
	SourceType  types.SourceType   `json:"source_type"`
	Pictures    []*PictureResponse `json:"pictures"`
}

func ResponseDataFromArtwork

func ResponseDataFromArtwork(artwork *types.Artwork) *ArtworkResponseData

type GetArtworkListRequest

type GetArtworkListRequest struct {
	R18      int    `form:"r18,default=0" binding:"gte=0,lte=2" json:"r18"`
	ArtistID string `form:"artist_id" binding:"omitempty" json:"artist_id"`
	Tag      string `form:"tag" binding:"omitempty" json:"tag"`
	Keyword  string `form:"keyword" binding:"omitempty,max=100" json:"keyword"`
	Page     int64  `form:"page,default=1" binding:"omitempty,gte=1" json:"page"`
	PageSize int64  `form:"page_size,default=20" binding:"omitempty,gte=1,lte=200" json:"page_size"`
	Simple   bool   `form:"simple,default=false" json:"simple"`
}

type GetRandomArtworksRequest

type GetRandomArtworksRequest struct {
	R18    int  `form:"r18,default=0" binding:"gte=0,lte=2" json:"r18"`
	Limit  int  `form:"limit,default=1" binding:"gte=1,lte=200" json:"limit"`
	Simple bool `form:"simple,default=false" json:"simple"`
}

type PictureResponse

type PictureResponse struct {
	ID        string  `json:"id"`
	Width     uint    `json:"width"`
	Height    uint    `json:"height"`
	Index     uint    `json:"index"`
	Hash      string  `json:"hash"`
	BlurScore float64 `json:"blur_score"`
	FileName  string  `json:"file_name"`
	MessageID int     `json:"message_id"`
	Thumbnail string  `json:"thumbnail"`
	Regular   string  `json:"regular"`
}

type R18Request

type R18Request struct {
	R18 int `form:"r18,default=0" binding:"gte=0,lte=2" json:"r18"`
}

Jump to

Keyboard shortcuts

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