postservice

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostService

type PostService struct {
	// contains filtered or unexported fields
}

func New

func New(templateRepo repoiface.TemplateRepository, thirdMsgSendService repoiface.ThirdMessageSendService) *PostService

func (*PostService) CreateTemplate

func (p *PostService) CreateTemplate(ctx context.Context, template *template.Template) (int64, error)

func (*PostService) GetTemplateById

func (p *PostService) GetTemplateById(ctx context.Context, id int64) (*template.Template, error)

func (*PostService) ListTemplate

func (p *PostService) ListTemplate(ctx context.Context, pageRequest *api.PaginationRequest, searchFields ...*api.SearchField) ([]*template.Template, error)

func (*PostService) RemoveTemplate

func (p *PostService) RemoveTemplate(ctx context.Context, id int64) error

func (*PostService) Send

func (p *PostService) Send(ctx context.Context, sendType api.PostType, to, title, content string) error

func (*PostService) SendWithTemplate

func (p *PostService) SendWithTemplate(ctx context.Context, sendType api.PostType, template *template.Template, to, title string, data map[string]string) error

func (*PostService) UpdateTemplate

func (p *PostService) UpdateTemplate(ctx context.Context, template *template.Template) error

type StringField

type StringField interface {
	Eq(value string) field.Expr
	Neq(value string) field.Expr
	Gt(value string) field.Expr
	Gte(value string) field.Expr
	Lt(value string) field.Expr
	Lte(value string) field.Expr
	In(values ...string) field.Expr
	NotIn(values ...string) field.Expr
	Between(min, max string) field.Expr
	NotBetween(min, max string) field.Expr
	Like(value string) field.Expr
	NotLike(value string) field.Expr
}

type TemplateSearchField

type TemplateSearchField struct {
	Field     StringField
	FieldName string
	Operator  api.SearchOperator
}

func NewTemplateSearchFiled

func NewTemplateSearchFiled(field StringField, fieldName string, operator api.SearchOperator) *TemplateSearchField

func (*TemplateSearchField) ToGormCondition

func (t *TemplateSearchField) ToGormCondition(value string) (gen.Condition, error)

Jump to

Keyboard shortcuts

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