Documentation ¶
Index ¶
- type BookSvc
- type BookSvcImpl
- func (b *BookSvcImpl) Create(ctx context.Context, book *entity.Book) (*entity.Book, error)
- func (b *BookSvcImpl) Delete(ctx context.Context, paramID string) error
- func (b *BookSvcImpl) Find(ctx context.Context, req *FindBookReq) (*FindBookResp, error)
- func (b *BookSvcImpl) FindOne(ctx context.Context, paramID string) (*entity.Book, error)
- func (b *BookSvcImpl) Patch(ctx context.Context, paramID string, book *entity.Book) (*entity.Book, error)
- func (b *BookSvcImpl) Update(ctx context.Context, paramID string, book *entity.Book) (*entity.Book, error)
- type FindBookReq
- type FindBookResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookSvc ¶
type BookSvc interface { FindOne(context.Context, string) (*entity.Book, error) Find(context.Context, *FindBookReq) (*FindBookResp, error) Create(context.Context, *entity.Book) (*entity.Book, error) Delete(context.Context, string) error Update(context.Context, string, *entity.Book) (*entity.Book, error) Patch(context.Context, string, *entity.Book) (*entity.Book, error) }
BookSvc contain logic for Book Controller @mock
func NewBookSvc ¶
func NewBookSvc(impl BookSvcImpl) BookSvc
NewBookSvc return new instance of BookSvc @ctor
type BookSvcImpl ¶
BookSvcImpl is implementation of BookSvc
func (*BookSvcImpl) Delete ¶
func (b *BookSvcImpl) Delete(ctx context.Context, paramID string) error
Delete book
func (*BookSvcImpl) Find ¶
func (b *BookSvcImpl) Find(ctx context.Context, req *FindBookReq) (*FindBookResp, error)
Find books
type FindBookReq ¶
type FindBookReq struct { Limit uint64 `query:"limit"` Offset uint64 `query:"offset"` Sort string `query:"sort"` }
FindBookReq find request
type FindBookResp ¶
FindBookResp find book resp
Click to show internal directories.
Click to hide internal directories.