service

package
v0.0.0-...-6852176 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleItem

type ArticleItem interface {
	Create(userId int, art models.Article) (int, error)
	Delete(userId, articleId int) error
	Update(userId, articleId int, upArt models.UpdateArticle) error
	SelectAll(userId int) ([]models.Article, error)
	Get(userId, articleId int) (models.Article, error)
}

type ArticleService

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

func NewArticleService

func NewArticleService(repo repository.ArticleItem) *ArticleService

func (*ArticleService) Create

func (a *ArticleService) Create(userId int, art models.Article) (int, error)

func (*ArticleService) Delete

func (a *ArticleService) Delete(userId, articleId int) error

func (*ArticleService) Get

func (a *ArticleService) Get(userId, articleId int) (models.Article, error)

func (*ArticleService) SelectAll

func (a *ArticleService) SelectAll(userId int) ([]models.Article, error)

func (*ArticleService) Update

func (a *ArticleService) Update(userId, articleId int, upArt models.UpdateArticle) error

type AuthService

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

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) CreateUser

func (a *AuthService) CreateUser(user models.User) (int, error)

func (*AuthService) GenerateToken

func (a *AuthService) GenerateToken(email, password string) (string, error)

func (*AuthService) ParseToken

func (a *AuthService) ParseToken(accessToken string) (int, error)

type Authorization

type Authorization interface {
	CreateUser(models.User) (int, error)
	GenerateToken(email, password string) (string, error)
	ParseToken(token string) (int, error)
}

type Service

type Service struct {
	Authorization
	ArticleItem
}

func NewService

func NewService(repo *repository.Repository) *Service

Directories

Path Synopsis
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.

Jump to

Keyboard shortcuts

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