124 lines
2.3 KiB
Markdown
124 lines
2.3 KiB
Markdown
![]() |
# VoxPop Moderation Service
|
||
|
|
||
|
The Moderation Service handles content moderation for the VoxPop platform, providing functionality for flagging content, AI-based content filtering, and managing a moderation queue.
|
||
|
|
||
|
## Features
|
||
|
|
||
|
- **Content Flagging**: Users can flag content that violates platform guidelines
|
||
|
- **AI Moderation**: Automatic content moderation using AI to detect spam, harmful content, etc.
|
||
|
- **Moderation Queue**: A queue of flagged content for human moderators to review
|
||
|
- **Economic Barriers**: A small fee (0.01 POL) is required for unverified users to submit content
|
||
|
|
||
|
## API Endpoints
|
||
|
|
||
|
### POST /flag-content
|
||
|
|
||
|
Flags content for moderation.
|
||
|
|
||
|
**Request Body:**
|
||
|
```json
|
||
|
{
|
||
|
"contentID": "string",
|
||
|
"reason": "string",
|
||
|
"flaggerAddress": "string"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
**Response:**
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"message": "Content flagged successfully"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### GET /moderation-queue
|
||
|
|
||
|
Gets the list of content in the moderation queue.
|
||
|
|
||
|
**Response:**
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"queue": [
|
||
|
{
|
||
|
"ID": "uuid",
|
||
|
"ContentID": "string",
|
||
|
"FlagCount": 3,
|
||
|
"Reason": "string",
|
||
|
"Status": "pending",
|
||
|
"AIFlagged": true,
|
||
|
"CreatedAt": "timestamp",
|
||
|
"UpdatedAt": "timestamp"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### POST /moderate-content
|
||
|
|
||
|
Makes a moderation decision on content in the queue.
|
||
|
|
||
|
**Request Body:**
|
||
|
```json
|
||
|
{
|
||
|
"contentID": "string",
|
||
|
"decision": "approve|reject"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
**Response:**
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"message": "Content moderated successfully"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### POST /submit-for-moderation
|
||
|
|
||
|
Submits content for AI moderation before publishing.
|
||
|
|
||
|
**Request Body:**
|
||
|
```json
|
||
|
{
|
||
|
"contentID": "string",
|
||
|
"text": "string",
|
||
|
"userAddress": "string",
|
||
|
"isVerified": true,
|
||
|
"contentType": "perspective|comment"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
**Response for flagged content:**
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"flagged": true,
|
||
|
"reason": "Potential spam content detected"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
**Response for approved content:**
|
||
|
```json
|
||
|
{
|
||
|
"success": true,
|
||
|
"flagged": false
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## Implementation Details
|
||
|
|
||
|
- The service uses PostgreSQL for storing flag data and the moderation queue
|
||
|
- Economic barrier is enforced for unverified users
|
||
|
- AI moderation is currently mocked with basic keyword filtering
|
||
|
- Content flagged 3 or more times is automatically added to the moderation queue
|
||
|
|
||
|
## Development
|
||
|
|
||
|
### Running Tests
|
||
|
|
||
|
```bash
|
||
|
cd poc/backend
|
||
|
go test ./moderation/... -v
|
||
|
```
|