summaryrefslogtreecommitdiff
path: root/internal/processing/processor.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-23 13:14:21 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-23 13:14:21 +0100
commite9747247d58a0423d5e40fda5c5b37b4b4526495 (patch)
tree5574b05f1dec1ad88c49b9891f1e54719f1b9eb1 /internal/processing/processor.go
parent[chore] bump go version to 1.19.5 (#1377) (diff)
downloadgotosocial-e9747247d58a0423d5e40fda5c5b37b4b4526495.tar.xz
[feature] Implement `/api/v1/reports` endpoints on client API (#1330)
* start adding report client api * route + test reports get * start report create endpoint * you can create reports now babyy * stub account report processor * add single reportGet endpoint * fix test * add more filtering params to /api/v1/reports GET * update swagger * use marshalIndent in tests * add + test missing Link info
Diffstat (limited to 'internal/processing/processor.go')
-rw-r--r--internal/processing/processor.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/processing/processor.go b/internal/processing/processor.go
index 0967ab9d2..692523042 100644
--- a/internal/processing/processor.go
+++ b/internal/processing/processor.go
@@ -38,6 +38,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/processing/admin"
federationProcessor "github.com/superseriousbusiness/gotosocial/internal/processing/federation"
mediaProcessor "github.com/superseriousbusiness/gotosocial/internal/processing/media"
+ "github.com/superseriousbusiness/gotosocial/internal/processing/report"
"github.com/superseriousbusiness/gotosocial/internal/processing/status"
"github.com/superseriousbusiness/gotosocial/internal/processing/streaming"
"github.com/superseriousbusiness/gotosocial/internal/processing/user"
@@ -232,6 +233,13 @@ type Processor interface {
// The user belonging to the confirmed email is also returned.
UserConfirmEmail(ctx context.Context, token string) (*gtsmodel.User, gtserror.WithCode)
+ // ReportsGet returns reports created by the given user.
+ ReportsGet(ctx context.Context, authed *oauth.Auth, resolved *bool, targetAccountID string, maxID string, sinceID string, minID string, limit int) (*apimodel.PageableResponse, gtserror.WithCode)
+ // ReportGet returns one report created by the given user.
+ ReportGet(ctx context.Context, authed *oauth.Auth, id string) (*apimodel.Report, gtserror.WithCode)
+ // ReportCreate creates a new report using the given account and form.
+ ReportCreate(ctx context.Context, authed *oauth.Auth, form *apimodel.ReportCreateRequest) (*apimodel.Report, gtserror.WithCode)
+
/*
FEDERATION API-FACING PROCESSING FUNCTIONS
These functions are intended to be called when the federating client needs an immediate (ie., synchronous) reply
@@ -303,6 +311,7 @@ type processor struct {
mediaProcessor mediaProcessor.Processor
userProcessor user.Processor
federationProcessor federationProcessor.Processor
+ reportProcessor report.Processor
}
// NewProcessor returns a new Processor.
@@ -326,6 +335,7 @@ func NewProcessor(
mediaProcessor := mediaProcessor.New(db, tc, mediaManager, federator.TransportController(), storage)
userProcessor := user.New(db, emailSender)
federationProcessor := federationProcessor.New(db, tc, federator)
+ reportProcessor := report.New(db, tc, clientWorker)
filter := visibility.NewFilter(db)
return &processor{
@@ -348,6 +358,7 @@ func NewProcessor(
mediaProcessor: mediaProcessor,
userProcessor: userProcessor,
federationProcessor: federationProcessor,
+ reportProcessor: reportProcessor,
}
}