mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:52:26 -05:00
[chore] Deinterface processor and subprocessors (#1501)
* [chore] Deinterface processor and subprocessors * expose subprocessors via function calls * missing license header
This commit is contained in:
parent
adb596600b
commit
b6fbdc66c1
246 changed files with 2545 additions and 4549 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue