Add Instagram-style social features and Postman collections

هذا الالتزام موجود في:
boutmoun123
2026-05-24 15:21:03 +03:00
الأصل fdc40192f7
التزام 367fce6557
56 ملفات معدلة مع 20266 إضافات و5965 حذوفات

عرض الملف

@@ -25,8 +25,10 @@ import { SuperAdminPermissions } from '../../common/decorators/superadmin-permis
import { AdminPostQueryDto } from './dto/admin-post-query.dto';
import { CreateReelDto } from './dto/create-reel.dto';
import { CreatePostDto } from './dto/create-post.dto';
import { CreateRepostDto } from './dto/create-repost.dto';
import { PostQueryDto } from './dto/post-query.dto';
import { ReelQueryDto } from './dto/reel-query.dto';
import { UpdateCommentSettingsDto } from './dto/update-comment-settings.dto';
import { UpdatePostDto } from './dto/update-post.dto';
import { PostsService } from './posts.service';
import { SUPERADMIN_PERMISSIONS } from '../superadmin/superadmin-permissions';
@@ -53,7 +55,10 @@ export class PostsController {
content: { type: 'string', example: 'First post #music' },
visibility: { type: 'string', enum: ['public', 'followers', 'private'] },
imageUrls: { type: 'array', items: { type: 'string' } },
imageCaptions: { type: 'array', items: { type: 'string' } },
imageAltTexts: { type: 'array', items: { type: 'string' } },
taggedUserIds: { type: 'array', items: { type: 'string' } },
collaboratorIds: { type: 'array', items: { type: 'string' } },
mentionUsernames: { type: 'array', items: { type: 'string' } },
location: { type: 'string', example: 'Riyadh, Saudi Arabia' },
latitude: { type: 'number', example: 24.7136 },
@@ -66,6 +71,8 @@ export class PostsController {
maqam: { type: 'string', example: 'Hijaz' },
rhythmSignature: { type: 'string', example: '6/8' },
waveformPeaks: { type: 'array', items: { type: 'number' } },
commentsDisabled: { type: 'boolean' },
commentsFollowersOnly: { type: 'boolean' },
imageFiles: { type: 'array', items: { type: 'string', format: 'binary' } },
videoFile: { type: 'string', format: 'binary' },
audioFile: { type: 'string', format: 'binary' },
@@ -175,7 +182,10 @@ export class PostsController {
content: { type: 'string', example: 'Updated content' },
visibility: { type: 'string', enum: ['public', 'followers', 'private'] },
imageUrls: { type: 'array', items: { type: 'string' } },
imageCaptions: { type: 'array', items: { type: 'string' } },
imageAltTexts: { type: 'array', items: { type: 'string' } },
taggedUserIds: { type: 'array', items: { type: 'string' } },
collaboratorIds: { type: 'array', items: { type: 'string' } },
mentionUsernames: { type: 'array', items: { type: 'string' } },
location: { type: 'string', example: 'Jeddah, Saudi Arabia' },
latitude: { type: 'number', example: 21.5433 },
@@ -188,6 +198,8 @@ export class PostsController {
maqam: { type: 'string', example: 'Hijaz' },
rhythmSignature: { type: 'string', example: '6/8' },
waveformPeaks: { type: 'array', items: { type: 'number' } },
commentsDisabled: { type: 'boolean' },
commentsFollowersOnly: { type: 'boolean' },
imageFiles: { type: 'array', items: { type: 'string', format: 'binary' } },
videoFile: { type: 'string', format: 'binary' },
audioFile: { type: 'string', format: 'binary' },
@@ -216,6 +228,56 @@ export class PostsController {
);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Post(':postId/repost')
async repost(
@CurrentUser() user: JwtPayload,
@Param('postId') postId: string,
@Body() dto: CreateRepostDto,
) {
return this.postsService.createRepost(user.sub, postId, dto);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Patch(':postId/comment-settings')
async updateCommentSettings(
@CurrentUser() user: JwtPayload,
@Param('postId') postId: string,
@Body() dto: UpdateCommentSettingsDto,
) {
return this.postsService.updateCommentSettings(user.sub, postId, dto);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Patch(':postId/pin-profile')
async pinToProfile(@CurrentUser() user: JwtPayload, @Param('postId') postId: string) {
return this.postsService.pinToProfile(user.sub, postId);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Patch(':postId/unpin-profile')
async unpinFromProfile(@CurrentUser() user: JwtPayload, @Param('postId') postId: string) {
return this.postsService.unpinFromProfile(user.sub, postId);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Patch(':postId/archive')
async archive(@CurrentUser() user: JwtPayload, @Param('postId') postId: string) {
return this.postsService.archive(user.sub, postId);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Patch(':postId/restore-archive')
async restoreArchive(@CurrentUser() user: JwtPayload, @Param('postId') postId: string) {
return this.postsService.restoreArchived(user.sub, postId);
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Delete(':postId')