Social
Endpoints para posts, comentarios, likes, seguimientos y feeds sociales.
Modelos de Datos
Section titled “Modelos de Datos”Los siguientes modelos de Prisma pertenecen al schema social:
model Post { id String @id @default(cuid()) userProfileId String @map("user_profile_id") title String? content String imageUrl String? @map("image_url") videoUrl String? @map("video_url") isPublic Boolean @default(true) @map("is_public")
userProfile UserProfile @relation(fields: [userProfileId], references: [id], onDelete: Cascade) likes Like[] comments Comment[]
createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at")
@@map("posts") @@schema("social")}model Like { id String @id @default(cuid()) userProfileId String @map("user_profile_id") postId String @map("post_id")
userProfile UserProfile @relation(fields: [userProfileId], references: [id], onDelete: Cascade) post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@unique([userProfileId, postId]) @@map("likes") @@schema("social")}Comment
Section titled “Comment”model Comment { id String @id @default(cuid()) userProfileId String @map("user_profile_id") postId String @map("post_id") content String
userProfile UserProfile @relation(fields: [userProfileId], references: [id], onDelete: Cascade) post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at")
@@map("comments") @@schema("social")}Follow
Section titled “Follow”model Follow { id String @id @default(cuid()) followerId String @map("follower_id") followingId String @map("following_id")
follower UserProfile @relation("UserFollows", fields: [followerId], references: [id], onDelete: Cascade) following UserProfile @relation("UserFollowers", fields: [followingId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now()) @map("created_at")
@@unique([followerId, followingId]) @@map("follows") @@schema("social")}Visión General
Section titled “Visión General”El módulo Social proporciona un conjunto completo de endpoints para:
- Posts: Crear y compartir posts con la comunidad
- Seguimientos: Seguir a otros usuarios y construir conexiones
- Feed: Ver feed social personalizado
Endpoints Relacionados
Section titled “Endpoints Relacionados”Explora las siguientes secciones para documentación detallada de la API:
- Posts - Crear y gestionar posts, likes y comentarios
- Seguimientos - Relaciones de seguimiento y conexiones de usuarios
- Feed - Feed social y contenido de tendencias