service

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Description: Author: Michael Cheung Github: https://github.com/gzmichaelcheung Date: 2020-11-23 14:47:45 LastEditors: Michael Cheung LastEditTime: 2020-11-23 14:47:45

Description: Author: Michael Cheung Github: https://github.com/gzmichaelcheung Date: 2020-11-23 16:34:36 LastEditors: Michael Cheung LastEditTime: 2020-11-23 16:34:37

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleListRequest

type ArticleListRequest struct {
	Title string `form:"title" binding:"max=100"`
	State uint8  `form:"state,default=1" binding:"oneof=0 1"`
}

type CountArticleRequest

type CountArticleRequest struct {
	State uint8 `form:"state,default=1" binding:"oneof=0 1"`
}

type CountTagRequest

type CountTagRequest struct {
	Name  string `form:"name" binding:"max=100"`
	State uint8  `form:"state,default=1" binding:"oneof=0 1"`
}

type CreateArticleRequest

type CreateArticleRequest struct {
	Title    string `form:"name" binding:"required,min=3,max=100"`
	CreateBy string `form:"create_by" binding:"required,min=3,max=100"`
	State    uint8  `form:"state,default=1" binding:"oneof=0 1"`
}

type CreateTagRequest

type CreateTagRequest struct {
	Name     string `form:"name" binding:"required,min=3,max=100"`
	CreateBy string `form:"create_by" binding:"required,min=3,max=100"`
	State    uint8  `form:"state,default=1" binding:"oneof=0 1"`
}

type DeleteArticleRequest

type DeleteArticleRequest struct {
	ID uint32 `form:"id" binding:"required,gte=1"`
}

type DeleteTagRequest

type DeleteTagRequest struct {
	ID uint32 `form:"id" binding:"required,gte=1"`
}

type Service

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

func New

func New(ctx context.Context) Service

func (*Service) CountTag

func (svc *Service) CountTag(param *CountTagRequest) (int, error)

func (*Service) CreateTag

func (svc *Service) CreateTag(param *CreateTagRequest) error

func (*Service) DeleteTag

func (svc *Service) DeleteTag(param *DeleteTagRequest) error

func (*Service) GetTagList

func (svc *Service) GetTagList(param *TagListRequest, pager *app.Pager) ([]*model.Tag, error)

func (*Service) UpdateTag

func (svc *Service) UpdateTag(param *UpdateTagRequest) error

type TagListRequest

type TagListRequest struct {
	Name  string `form:"name" binding:"max=100"`
	State uint8  `form:"state,default=1" binding:"oneof=0 1"`
}

type UpdateArticleRequest

type UpdateArticleRequest struct {
	ID         uint32 `form:"id" binding:"required,gte=1"`
	Title      string `form:"name" binding:"min=3 max=100"`
	State      uint8  `form:"state,default=1" binding:"oneof=0 1"`
	ModifiedBy string `form:"modified_by" binding:"required,min=3,max=100"`
}

type UpdateTagRequest

type UpdateTagRequest struct {
	ID         uint32 `form:"id" binding:"required,gte=1"`
	Name       string `form:"name" binding:"min=3 max=100"`
	State      uint8  `form:"state,default=1" binding:"oneof=0 1"`
	ModifiedBy string `form:"modified_by" binding:"required,min=3,max=100"`
}

Jump to

Keyboard shortcuts

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