Spaces:
Sleeping
Sleeping
Download backend/src/modules/social/social.controller.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/social/social.controller.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/social/social.controller.ts
-
curl -L -o social.controller.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/social/social.controller.ts
1.53 kB
| import { | |
| Controller, | |
| Get, | |
| Post, | |
| Delete, | |
| Param, | |
| UseGuards, | |
| Req, | |
| } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; | |
| import { SocialService } from './social.service'; | |
| import { JwtAuthGuard } from '../auth/jwt-auth.guard'; | |
| ('Social Graph') | |
| ('me/following') | |
| (JwtAuthGuard) | |
| () | |
| export class SocialController { | |
| constructor(private readonly socialService: SocialService) {} | |
| () | |
| ({ summary: 'List everything current user follows' }) | |
| getFollowing(() req: any) { | |
| return this.socialService.getFollowing(req.user.userId); | |
| } | |
| ('artists/:artistId') | |
| ({ summary: 'Follow an artist' }) | |
| followArtist(() req: any, ('artistId') artistId: string) { | |
| return this.socialService.followArtist(req.user.userId, artistId); | |
| } | |
| ('artists/:artistId') | |
| ({ summary: 'Unfollow an artist' }) | |
| unfollowArtist(() req: any, ('artistId') artistId: string) { | |
| return this.socialService.unfollowArtist(req.user.userId, artistId); | |
| } | |
| ('users/:userId') | |
| ({ summary: 'Follow a user' }) | |
| followUser(() req: any, ('userId') userId: string) { | |
| return this.socialService.followUser(req.user.userId, userId); | |
| } | |
| ('users/:userId') | |
| ({ summary: 'Unfollow a user' }) | |
| unfollowUser(() req: any, ('userId') userId: string) { | |
| return this.socialService.unfollowUser(req.user.userId, userId); | |
| } | |
| } | |