summaryrefslogtreecommitdiff
path: root/internal/api/model
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-08-02 13:41:46 +0200
committerLibravatar GitHub <noreply@github.com>2024-08-02 12:41:46 +0100
commit7b5917d6ae48f83c92f92d7277960cfa6ae8ec56 (patch)
tree93ee6999195060714f41f9b9476d4d76ad50520c /internal/api/model
parent[chore] Take account of rotation data when calculating full size image dimens... (diff)
downloadgotosocial-7b5917d6ae48f83c92f92d7277960cfa6ae8ec56.tar.xz
[feature] Allow import of following and blocks via CSV (#3150)
* [feature] Import follows + blocks via settings panel * test import follows
Diffstat (limited to 'internal/api/model')
-rw-r--r--internal/api/model/exportimport.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/api/model/exportimport.go b/internal/api/model/exportimport.go
index d87ed8cd3..88ea5489d 100644
--- a/internal/api/model/exportimport.go
+++ b/internal/api/model/exportimport.go
@@ -17,6 +17,8 @@
package model
+import "mime/multipart"
+
// AccountExportStats models an account's stats
// specifically for the purpose of informing about
// export sizes at the /api/v1/exports/stats endpoint.
@@ -58,3 +60,23 @@ type AccountExportStats struct {
// example: 11
MutesCount int `json:"mutes_count"`
}
+
+// AttachmentRequest models media attachment creation parameters.
+//
+// swagger: ignore
+type ImportRequest struct {
+ // The CSV data to upload.
+ Data *multipart.FileHeader `form:"data" binding:"required"`
+ // Type of entries contained in the data file.
+ //
+ // - `following` - accounts to follow.
+ // - `lists` - lists of accounts.
+ // - `blocks` - accounts to block.
+ // - `mutes` - accounts to mute.
+ // - `bookmarks` - statuses to bookmark.
+ Type string `form:"type" binding:"required"`
+ // Mode to use when creating entries from the data file:
+ // - `merge` to merge entries in file with existing entries.
+ // - `overwrite` to replace existing entries with entries in file.
+ Mode string `form:"mode"`
+}