article_service

package
v0.0.0-...-452dc01 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPosterFlag

func GetPosterFlag() string

Types

type Article

type Article struct {
	ID            int
	TagID         int
	Title         string
	Desc          string
	Content       string
	CoverImageUrl string
	State         int
	CreatedBy     string
	ModifiedBy    string

	PageNum  int
	PageSize int
}

func (*Article) Add

func (a *Article) Add() error

func (*Article) Count

func (a *Article) Count() (int, error)

func (*Article) Delete

func (a *Article) Delete() error

func (*Article) Edit

func (a *Article) Edit() error

func (*Article) ExistByID

func (a *Article) ExistByID() (bool, error)

func (*Article) Get

func (a *Article) Get() (*models.Article, error)

func (*Article) GetAll

func (a *Article) GetAll() ([]*models.Article, error)

type ArticlePoster

type ArticlePoster struct {
	PosterName string
	*Article
	Qr *qrcode.QrCode
}

func NewArticlePoster

func NewArticlePoster(posterName string, article *Article, qr *qrcode.QrCode) *ArticlePoster

func (*ArticlePoster) CheckMergedImage

func (a *ArticlePoster) CheckMergedImage(path string) bool

func (*ArticlePoster) OpenMergedImage

func (a *ArticlePoster) OpenMergedImage(path string) (*os.File, error)

type ArticlePosterBg

type ArticlePosterBg struct {
	Name string
	*ArticlePoster
	*Rect
	*Pt
}

func NewArticlePosterBg

func NewArticlePosterBg(name string, ap *ArticlePoster, rect *Rect, pt *Pt) *ArticlePosterBg

func (*ArticlePosterBg) DrawPoster

func (a *ArticlePosterBg) DrawPoster(d *DrawText, fontName string) error

func (*ArticlePosterBg) Generate

func (a *ArticlePosterBg) Generate() (string, string, error)

type DrawText

type DrawText struct {
	JPG    draw.Image
	Merged *os.File

	Title string
	X0    int
	Y0    int
	Size0 float64

	SubTitle string
	X1       int
	Y1       int
	Size1    float64
}

type Pt

type Pt struct {
	X int
	Y int
}

type Rect

type Rect struct {
	Name string
	X0   int
	Y0   int
	X1   int
	Y1   int
}

Jump to

Keyboard shortcuts

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