service

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountService

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

AccountService is a service for managing user account.

func NewAccountService

func NewAccountService(context mycontext.Context) *AccountService

NewAccountService is constructor.

func (*AccountService) AuthenticateByUsernameAndPassword

func (a *AccountService) AuthenticateByUsernameAndPassword(username string, password string) (bool, *model.Account)

AuthenticateByUsernameAndPassword authenticates by using username and plain text password.

type BookService

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

BookService is a service for managing books.

func NewBookService

func NewBookService(context mycontext.Context) *BookService

NewBookService is constructor.

func (*BookService) DeleteBook

func (b *BookService) DeleteBook(dto *dto.ChgBookDto) (*model.Book, map[string]string)

DeleteBook deletes the given book data.

func (*BookService) EditBook

func (b *BookService) EditBook(dto *dto.ChgBookDto) (*model.Book, map[string]string)

EditBook updates the given book data.

func (*BookService) FindAllBooks

func (b *BookService) FindAllBooks() *[]model.Book

FindAllBooks returns the list of all books.

func (*BookService) FindAllBooksByPage

func (b *BookService) FindAllBooksByPage(page int, size int) *model.Page

FindAllBooksByPage returns the page object of all books.

func (*BookService) FindBooksByTitle

func (b *BookService) FindBooksByTitle(title string, page int, size int) *model.Page

FindBooksByTitle returns the page object of books matched given book title.

func (*BookService) FindByID

func (b *BookService) FindByID(id uint) *model.Book

FindByID returns one record matched book's id.

func (*BookService) RegisterBook

func (b *BookService) RegisterBook(dto *dto.RegBookDto) (*model.Book, map[string]string)

RegisterBook register the given book data.

type MasterService

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

MasterService is a service for managing master data such as format and category.

func NewMasterService

func NewMasterService(context mycontext.Context) *MasterService

NewMasterService is constructor.

func (*MasterService) FindAllCategories

func (m *MasterService) FindAllCategories() *[]model.Category

FindAllCategories returns the list of all categories.

func (*MasterService) FindAllFormats

func (m *MasterService) FindAllFormats() *[]model.Format

FindAllFormats returns the list of all formats.

Jump to

Keyboard shortcuts

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