diff options
author | 2023-02-22 16:05:26 +0100 | |
---|---|---|
committer | 2023-02-22 16:05:26 +0100 | |
commit | b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288 (patch) | |
tree | c79d1107375597ab8a79045c80dd62dc95a204e7 /internal/api/client/media | |
parent | [bugfix] Remove initial storage cleanup (#1545) (diff) | |
download | gotosocial-b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288.tar.xz |
[chore] Deinterface processor and subprocessors (#1501)
* [chore] Deinterface processor and subprocessors
* expose subprocessors via function calls
* missing license header
Diffstat (limited to 'internal/api/client/media')
-rw-r--r-- | internal/api/client/media/media.go | 4 | ||||
-rw-r--r-- | internal/api/client/media/mediacreate.go | 2 | ||||
-rw-r--r-- | internal/api/client/media/mediacreate_test.go | 2 | ||||
-rw-r--r-- | internal/api/client/media/mediaget.go | 2 | ||||
-rw-r--r-- | internal/api/client/media/mediaupdate.go | 2 | ||||
-rw-r--r-- | internal/api/client/media/mediaupdate_test.go | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/internal/api/client/media/media.go b/internal/api/client/media/media.go index e6d0c212c..65c12a329 100644 --- a/internal/api/client/media/media.go +++ b/internal/api/client/media/media.go @@ -35,10 +35,10 @@ const ( ) type Module struct { - processor processing.Processor + processor *processing.Processor } -func New(processor processing.Processor) *Module { +func New(processor *processing.Processor) *Module { return &Module{ processor: processor, } diff --git a/internal/api/client/media/mediacreate.go b/internal/api/client/media/mediacreate.go index cfd547c19..71a43eafd 100644 --- a/internal/api/client/media/mediacreate.go +++ b/internal/api/client/media/mediacreate.go @@ -123,7 +123,7 @@ func (m *Module) MediaCreatePOSTHandler(c *gin.Context) { return } - apiAttachment, errWithCode := m.processor.MediaCreate(c.Request.Context(), authed, form) + apiAttachment, errWithCode := m.processor.Media().Create(c.Request.Context(), authed.Account, form) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return diff --git a/internal/api/client/media/mediacreate_test.go b/internal/api/client/media/mediacreate_test.go index 8a94646ac..aaace7a61 100644 --- a/internal/api/client/media/mediacreate_test.go +++ b/internal/api/client/media/mediacreate_test.go @@ -59,7 +59,7 @@ type MediaCreateTestSuite struct { tc typeutils.TypeConverter oauthServer oauth.Server emailSender email.Sender - processor processing.Processor + processor *processing.Processor // standard suite models testTokens map[string]*gtsmodel.Token diff --git a/internal/api/client/media/mediaget.go b/internal/api/client/media/mediaget.go index 2c07024c2..f7656b574 100644 --- a/internal/api/client/media/mediaget.go +++ b/internal/api/client/media/mediaget.go @@ -91,7 +91,7 @@ func (m *Module) MediaGETHandler(c *gin.Context) { return } - attachment, errWithCode := m.processor.MediaGet(c.Request.Context(), authed, attachmentID) + attachment, errWithCode := m.processor.Media().Get(c.Request.Context(), authed.Account, attachmentID) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return diff --git a/internal/api/client/media/mediaupdate.go b/internal/api/client/media/mediaupdate.go index a0c44caf3..fa0b10ab5 100644 --- a/internal/api/client/media/mediaupdate.go +++ b/internal/api/client/media/mediaupdate.go @@ -134,7 +134,7 @@ func (m *Module) MediaPUTHandler(c *gin.Context) { return } - attachment, errWithCode := m.processor.MediaUpdate(c.Request.Context(), authed, attachmentID, form) + attachment, errWithCode := m.processor.Media().Update(c.Request.Context(), authed.Account, attachmentID, form) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return diff --git a/internal/api/client/media/mediaupdate_test.go b/internal/api/client/media/mediaupdate_test.go index 8f4470132..cb96e8aa1 100644 --- a/internal/api/client/media/mediaupdate_test.go +++ b/internal/api/client/media/mediaupdate_test.go @@ -57,7 +57,7 @@ type MediaUpdateTestSuite struct { mediaManager media.Manager oauthServer oauth.Server emailSender email.Sender - processor processing.Processor + processor *processing.Processor // standard suite models testTokens map[string]*gtsmodel.Token |