aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tews <michael@tews.dev>2026-04-01 16:11:24 +0200
committerMichael Tews <michael@tews.dev>2026-04-01 16:11:24 +0200
commit2de63efebdfbb07261f16817ea79df398d23cc7e (patch)
tree5cbb6c7fa754d53c8b28b69d57643f0ab7e1bf3c
parentbb099ac767df6c8097135f6533d6d52197a59bc5 (diff)
refactor: remove unnecessary code
-rw-r--r--backend/studip/responses.go125
1 files changed, 51 insertions, 74 deletions
diff --git a/backend/studip/responses.go b/backend/studip/responses.go
index 93fef28..244b4a3 100644
--- a/backend/studip/responses.go
+++ b/backend/studip/responses.go
@@ -2,66 +2,64 @@ package studip
import "time"
+type Meta struct {
+ Page Page
+}
+
+type Page struct {
+ Offset int `json:"offset"`
+ Limit int `json:"limit"`
+ Total int `json:"total"`
+}
+
+type Links struct {
+ First string `json:"first"`
+ Last string `json:"last"`
+}
+
type StudIPFolders struct {
- Meta struct {
- Page struct {
- Offset int `json:"offset"`
- Limit int `json:"limit"`
- Total int `json:"total"`
- } `json:"page"`
- } `json:"meta"`
+ Meta Meta
Data []StudIPFoldersData `json:"data"`
}
+type Attributes struct {
+ FolderType string `json:"folder-type"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+ Mkdate time.Time `json:"mkdate"`
+ Chdate time.Time `json:"chdate"`
+ IsVisible bool `json:"is-visible"`
+ IsReadable bool `json:"is-readable"`
+ IsWritable bool `json:"is-writable"`
+ IsEditable bool `json:"is-editable"`
+ IsEmpty bool `json:"is-empty"`
+ IsSubfolderAllowed bool `json:"is-subfolder-allowed"`
+ Downloads int `json:"downloads"`
+ Filesize int64 `json:"filesize"`
+ MimeType string `json:"mime-type"`
+ CourseNumber string `json:"course-number"`
+ Title string `json:"title"`
+ CourseType int `json:"course-type"`
+ CourseTypeText string `json:"course-type-text"`
+ Dates string `json:"dates"`
+ IsDownloadable bool `json:"is-downloadable"`
+}
+
type StudIPFoldersData struct {
- Type string `json:"type"`
- ID string `json:"id"`
- Attributes struct {
- FolderType string `json:"folder-type"`
- Name string `json:"name"`
- Description string `json:"description"`
- Mkdate time.Time `json:"mkdate"`
- Chdate time.Time `json:"chdate"`
- IsVisible bool `json:"is-visible"`
- IsReadable bool `json:"is-readable"`
- IsWritable bool `json:"is-writable"`
- IsEditable bool `json:"is-editable"`
- IsEmpty bool `json:"is-empty"`
- IsSubfolderAllowed bool `json:"is-subfolder-allowed"`
- } `json:"attributes"`
+ Type string `json:"type"`
+ ID string `json:"id"`
+ Attributes Attributes
Relationships struct {
Parent StudIPRelationship `json:"parent"`
} `json:"relationships"`
}
type StudIPFiles struct {
- Meta struct {
- Page struct {
- Offset int `json:"offset"`
- Limit int `json:"limit"`
- Total int `json:"total"`
- } `json:"page"`
- } `json:"meta"`
- Links struct {
- First string `json:"first"`
- Last string `json:"last"`
- } `json:"links"`
- Data []struct {
- Type string `json:"type"`
- ID string `json:"id"`
- Attributes struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Mkdate time.Time `json:"mkdate"`
- Chdate time.Time `json:"chdate"`
- Downloads int `json:"downloads"`
- Filesize int64 `json:"filesize"`
- MimeType string `json:"mime-type"`
- IsReadable bool `json:"is-readable"`
- IsDownloadable bool `json:"is-downloadable"`
- IsEditable bool `json:"is-editable"`
- IsWritable bool `json:"is-writable"`
- } `json:"attributes"`
+ Meta Meta
+ Links Links
+ Data []struct {
+ StudIPResourceIdentifier
+ Attributes Attributes
} `json:"data"`
}
@@ -79,21 +77,8 @@ type StudIPNullableRelationship struct {
}
type StudIPFileRefData struct {
- Type string `json:"type"`
- ID string `json:"id"`
- Attributes struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Mkdate time.Time `json:"mkdate"`
- Chdate time.Time `json:"chdate"`
- Downloads int `json:"downloads"`
- Filesize int64 `json:"filesize"`
- MimeType string `json:"mime-type"`
- IsReadable bool `json:"is-readable"`
- IsDownloadable bool `json:"is-downloadable"`
- IsEditable bool `json:"is-editable"`
- IsWritable bool `json:"is-writable"`
- } `json:"attributes"`
+ StudIPResourceIdentifier
+ Attributes Attributes
Relationships struct {
File StudIPRelationship `json:"file"`
Parent StudIPRelationship `json:"parent"`
@@ -107,15 +92,7 @@ type StudIPFileRef struct {
type StudIPCourses struct {
Data struct {
- Type string `json:"type"`
- ID string `json:"id"`
- Attributes struct {
- CourseNumber string `json:"course-number"`
- Title string `json:"title"`
- CourseType int `json:"course-type"`
- CourseTypeText string `json:"course-type-text"`
- Description string `json:"description"`
- Dates string `json:"dates"`
- } `json:"attributes"`
+ StudIPResourceIdentifier
+ Attributes Attributes
} `json:"data"`
}