Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ func main() {
repositories.NewRoomRepository,
repositories.NewDirectChatRepository,
repositories.NewMessageRepository,
repositories.NewReportRepository,
services.NewAuthService,
services.NewUserService,
services.NewRoomService,
services.NewDirectChatService,
services.NewModerationService,
handlers.NewAuthHandler,
handlers.NewUserHandler,
handlers.NewChatHandler,
handlers.NewModerationHandler,
middleware.NewAuthMiddleware,

// Proveedores de WebSocket
Expand Down
264 changes: 264 additions & 0 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,143 @@ const docTemplate = `{
}
}
},
"/chat/rooms/{roomId}/banned-users": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieves a list of users who have been banned in a chat room",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Moderation"
],
"summary": "Get banned users in a room",
"parameters": [
{
"type": "string",
"description": "Room ID",
"name": "roomId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Banned users",
"schema": {
"$ref": "#/definitions/models.BannedUsersResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "string"
}
}
}
}
},
"/chat/rooms/{roomId}/clear-reports": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Clears all reports for a specific user in a chat room",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Moderation"
],
"summary": "Clear reports for a user",
"parameters": [
{
"type": "string",
"description": "Room ID",
"name": "roomId",
"in": "path",
"required": true
},
{
"description": "Clear Report Request",
"name": "clearRequest",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ClearReportRequest"
}
}
],
"responses": {
"200": {
"description": "Reports cleared successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "string"
}
}
}
}
},
"/chat/rooms/{roomId}/join": {
"post": {
"security": [
Expand Down Expand Up @@ -725,6 +862,82 @@ const docTemplate = `{
}
}
},
"/chat/rooms/{roomId}/report": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Reports a message as inappropriate in a chat room",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Moderation"
],
"summary": "Report an inappropriate message",
"parameters": [
{
"type": "string",
"description": "Room ID",
"name": "roomId",
"in": "path",
"required": true
},
{
"description": "Report Request",
"name": "report",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.ReportRequest"
}
}
],
"responses": {
"200": {
"description": "Message reported successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Invalid request",
"schema": {
"type": "string"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
},
"403": {
"description": "Forbidden",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not found",
"schema": {
"type": "string"
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "string"
}
}
}
}
},
"/chat/ws": {
"get": {
"description": "Establece una conexión WebSocket para mensajería en tiempo real",
Expand Down Expand Up @@ -813,6 +1026,39 @@ const docTemplate = `{
}
}
},
"models.BannedUserResponse": {
"type": "object",
"properties": {
"displayName": {
"type": "string"
},
"reportCount": {
"type": "integer"
},
"userId": {
"type": "string"
}
}
},
"models.BannedUsersResponse": {
"type": "object",
"properties": {
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/models.BannedUserResponse"
}
}
}
},
"models.ClearReportRequest": {
"type": "object",
"properties": {
"userId": {
"type": "string"
}
}
},
"models.CreateRoomRequest": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -942,6 +1188,17 @@ const docTemplate = `{
}
}
},
"models.ReportRequest": {
"type": "object",
"properties": {
"messageId": {
"type": "string"
},
"reason": {
"type": "string"
}
}
},
"models.Room": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -984,6 +1241,13 @@ const docTemplate = `{
"ownerId": {
"type": "string"
},
"reportedUsers": {
"description": "Map of userID to report count",
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"updatedAt": {
"type": "string"
}
Expand Down
Loading