Documentation ¶
Index ¶
- type AccountService
- type BookService
- func (b *BookService) DeleteBook(dto *dto.ChgBookDto) (*model.Book, map[string]string)
- func (b *BookService) EditBook(dto *dto.ChgBookDto) (*model.Book, map[string]string)
- func (b *BookService) FindAllBooks() *[]model.Book
- func (b *BookService) FindAllBooksByPage(page int, size int) *model.Page
- func (b *BookService) FindBooksByTitle(title string, page int, size int) *model.Page
- func (b *BookService) FindByID(id uint) *model.Book
- func (b *BookService) RegisterBook(dto *dto.RegBookDto) (*model.Book, map[string]string)
- type MasterService
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 ¶
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.