-
Notifications
You must be signed in to change notification settings - Fork 0
Comunicaciones internas
| Nombre | Descripcion | Topico | Key | Message | Emisor | Receptor(es) |
|---|---|---|---|---|---|---|
| topics | Topicos detectados por el sistema de topic modeling | topics | <id_post> | ["topic_a", "topic_b"] | topicmodelingservice | PostsService |
| offensive | Respuesta del sistema de detección de texto ofensivo | offensive_text | <id_post> | true|false | offensivetextdetectionservice | PostsService |
| lang_detection | Respuesta del sistema de detección de idioma | lang_detection | <id_post> | "idioma (ISO Code)" | langdetectionservice | PostsService |
| new_post | Notificacion de que se ha creado un nuevo post | post | <id_post> | "texto del post" | PostsService | lang/topics/offensive services |
| logging | Envio de logs | service_logs | <nombre_servicio_emisor> | "el log a enviar" | Todos los Servicios | logstash |
/soap/addPost
idioma: "es"
/soap/addRegisteredUser
TODO: ver después
/soap/addCreatedChat
/soap/addFollow
/soap/addTranslation
Meter id usuario
/soap/addTextToSpeech
Meter id usuario
follower: <id_usuario_follower>, // el que sigue
followee: <id_usuario_followee> // al que le siguen
GET: /api/posts
- Limit (int): Numero de resultados por consulta (default=10)
- Offset (int): A partir de qué post se devuelve resultado (default=0)
- User (long): ID del usuario del que queremos obtener los posts
- Language (string): String del lenguaje de los posts a obtener
{
"links": {
"self": "url_actual",
"first": "url_primeros_elementos",
"prev": "url_pagina_anterior",
"next": "url_pagina_siguiente",
"last": "url_ultima_pagina"
},
"count": 10,
"total": 500,
"posts": [
{
id: 1,
content: "",
language: "en",
topics: [
"topic_a", "other topic", "sample"
],
is_offensive: false,
likes: 150,
user: <id_usuario_autor>
},
...
{
id: 10,
...
}
]
}
GET: /api/posts/
{
id: 1,
content: "",
language: "en",
topics: [
"topic_a", "other topic", "sample"
],
is_offensive: false,
likes: 150,
user: <id_usuario_autor>
}
POST: /api/posts
Los campos de idioma, id, topics, is_offensive y likes los crea automáticamente el servicio, por lo que no hace falta introducir mucha info aquí.
{
content: "",
user: <id_usuario_autor>
}
201 - Created
DELETE: /api/posts/
Código deleted
GET: /api/statistics
[{
"registeredUsers": {
"total": 11,
"learning": {
"en": 6,
"es": 7
},
"native": {
"es": 10,
"ru": 1
}
},
"createdPosts": {
"total": 100,
"en": 5,
"es": 6,
...
},
"createdChats": 7
}]
GET: /api/users/<id>/statistics
[
{
"createdPosts": {
"total": 100,
"en": 5,
"es": 6,
...
},
"numFollowing": 10,
"numFollowers": 5
"translationsMade": 20,
"textToSpeechMade": 10
}
]
GET: /api/users
- Limit (int): Numero de resultados por consulta (default=10)
- Offset (int): A partir de qué post se devuelve resultado (default=0)
- MinAge (int): Edad mínima de los usuarios a buscar
- MaxAge (int): Edad máxima de los usuarios a buscar
- WantsToLearn (string[]): Lista de idiomas (ISO) que está aprendiendo los usuarios (or)
- Speaks (string[]): Lista de idiomas (ISO) que hablan los usuario (or)
{
"links": {
"self": "url_actual",
"first": "url_primeros_elementos",
"prev": "url_pagina_anterior",
"next": "url_pagina_siguiente",
"last": "url_ultima_pagina"
},
"count": 10,
"total": 500,
"users": [
{
"id": 1,
"name": "Pepito",
"surname": "Sanchez Perez"
"learning": ["en", "ru"],
"speaks": "es",
"age": 32,
"avatar": "<url_del_avatar>",
"followers": ["<url_get_carmen>", "<url_get_paco>"],
"following": ["<url_get_fulanito>", "<url_get_menganita>"]
},
...
{
"id": 10,
...
}
]
}
200 OK
N/A
GET: /api/users/<id>
{
"id": 1,
"name": "Pepito",
"surname": "Sanchez Perez"
"learning": ["en", "ru"],
"speaks": "es",
"age": 32,
"avatar": "<url_del_avatar>",
"followers": ["<url_get_carmen>", "<url_get_paco>"],
"following": ["<url_get_fulanito>", "<url_get_menganita>"]
}
#### Resultados inválidos 404: Not found
POST: /api/users/
{
"username": "pepiiii",
"password": "admin123",
"email": "pepi@gmail.com",
"name": "Pepito",
"surname": "Sanchez Perez"
"learning": ["en", "ru"],
"speaks": "es",
"age": 32,
"avatar": b"imagenCodificadaEnBase64"
}
201 - Created En la cabecera -> link al recurso { "name": "Pepito", "surname": "Sanchez Perez" "learning": ["en", "ru"], "speaks": "es", "age": 32, "avatar": b"imagenCodificadaEnBase64", "followers": [], "following": [] }
409 - Conflict: Si el email o el username ya existen.
POST: /api/translations
{
"from": "<codigo-idioma>",
"to": "<codigo-idioma>",
"text": "texto a traducir"
}
{
"translation": "texto traducido"
}
429 - Too Many Requests: Se nos acabó la plata
POST: /api/textsToSpeeches
{
"language": "<codigo-idioma>",
"text": "texto a ttsear"
}
{
"result": "<audio codificado de alguna manera. Depende de la api...>"
}
429 - Too Many Requests Se nos acabó la plata