[chore] Deinterface processor and subprocessors (#1501)

* [chore] Deinterface processor and subprocessors

* expose subprocessors via function calls

* missing license header
This commit is contained in:
tobi
2023-02-22 16:05:26 +01:00
committed by GitHub
parent adb596600b
commit b6fbdc66c1
246 changed files with 2545 additions and 4549 deletions

View File

@@ -102,7 +102,7 @@ func (m *Module) ReportPOSTHandler(c *gin.Context) {
return
}
apiReport, errWithCode := m.processor.ReportCreate(c.Request.Context(), authed, form)
apiReport, errWithCode := m.processor.Report().Create(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return

View File

@@ -85,7 +85,7 @@ func (m *Module) ReportGETHandler(c *gin.Context) {
return
}
report, errWithCode := m.processor.ReportGet(c.Request.Context(), authed, targetReportID)
report, errWithCode := m.processor.Report().Get(c.Request.Context(), authed.Account, targetReportID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return

View File

@@ -38,10 +38,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,
}

View File

@@ -39,7 +39,7 @@ type ReportsStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
processor processing.Processor
processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string

View File

@@ -160,7 +160,7 @@ func (m *Module) ReportsGETHandler(c *gin.Context) {
limit = i
}
resp, errWithCode := m.processor.ReportsGet(c.Request.Context(), authed, resolved, c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
resp, errWithCode := m.processor.Report().GetMultiple(c.Request.Context(), authed.Account, resolved, c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return