]> BookStack Code Mirror - api-scripts/blob - go-export-page-content/models.go
docs: add jaypyles/obsidian_to_bookstack
[api-scripts] / go-export-page-content / models.go
1 package main
2
3 import (
4         "encoding/json"
5         "time"
6 )
7
8 type ListResponse struct {
9         Data  json.RawMessage `json:"data"`
10         Total int             `json:"total"`
11 }
12
13 type Book struct {
14         Id          int       `json:"id"`
15         Name        string    `json:"name"`
16         Slug        string    `json:"slug"`
17         Description string    `json:"description"`
18         CreatedAt   time.Time `json:"created_at"`
19         UpdatedAt   time.Time `json:"updated_at"`
20         CreatedBy   int       `json:"created_by"`
21         UpdatedBy   int       `json:"updated_by"`
22         OwnedBy     int       `json:"owned_by"`
23         ImageId     int       `json:"image_id"`
24 }
25
26 type Chapter struct {
27         Id          int       `json:"id"`
28         BookId      int       `json:"book_id"`
29         Name        string    `json:"name"`
30         Slug        string    `json:"slug"`
31         Description string    `json:"description"`
32         Priority    int       `json:"priority"`
33         CreatedAt   string    `json:"created_at"`
34         UpdatedAt   time.Time `json:"updated_at"`
35         CreatedBy   int       `json:"created_by"`
36         UpdatedBy   int       `json:"updated_by"`
37         OwnedBy     int       `json:"owned_by"`
38 }
39
40 type Page struct {
41         Id            int       `json:"id"`
42         BookId        int       `json:"book_id"`
43         ChapterId     int       `json:"chapter_id"`
44         Name          string    `json:"name"`
45         Slug          string    `json:"slug"`
46         Html          string    `json:"html"`
47         Priority      int       `json:"priority"`
48         CreatedAt     time.Time `json:"created_at"`
49         UpdatedAt     time.Time `json:"updated_at"`
50         Draft         bool      `json:"draft"`
51         Markdown      string    `json:"markdown"`
52         RevisionCount int       `json:"revision_count"`
53         Template      bool      `json:"template"`
54 }