mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user