feat(bookstack-api-5gi): implement Attachments CRUD
Add AttachmentsService with List, Get, Create, Update, Delete. Support link attachments via JSON. Add Attachment type and request types. Register service on Client. Add tests.
This commit is contained in:
parent
04cf1565fa
commit
256361e90b
6 changed files with 219 additions and 12 deletions
16
bookstack.go
16
bookstack.go
|
|
@ -31,11 +31,12 @@ type Client struct {
|
|||
httpClient *http.Client
|
||||
|
||||
// Service instances
|
||||
Books *BooksService
|
||||
Pages *PagesService
|
||||
Chapters *ChaptersService
|
||||
Shelves *ShelvesService
|
||||
Search *SearchService
|
||||
Attachments *AttachmentsService
|
||||
Books *BooksService
|
||||
Chapters *ChaptersService
|
||||
Pages *PagesService
|
||||
Search *SearchService
|
||||
Shelves *ShelvesService
|
||||
}
|
||||
|
||||
// NewClient creates a new Bookstack API client.
|
||||
|
|
@ -70,11 +71,12 @@ func NewClient(cfg Config) (*Client, error) {
|
|||
}
|
||||
|
||||
// Initialize services
|
||||
c.Attachments = &AttachmentsService{client: c}
|
||||
c.Books = &BooksService{client: c}
|
||||
c.Pages = &PagesService{client: c}
|
||||
c.Chapters = &ChaptersService{client: c}
|
||||
c.Shelves = &ShelvesService{client: c}
|
||||
c.Pages = &PagesService{client: c}
|
||||
c.Search = &SearchService{client: c}
|
||||
c.Shelves = &ShelvesService{client: c}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue