Skip to content

Commit

Permalink
Video comment resourse
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrotomassini committed Oct 16, 2023
1 parent 2602805 commit 61b2d6e
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 13 deletions.
15 changes: 2 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
version: '3'

services:
db:
image: postgres:14.3
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
container_name: innovancedb
volumes:
- ./postgres:/var/lib/postgresql/data

pgadmin:
image: dpage/pgadmin4:7.3
restart: always
ports:
- "8080:80"
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_DEFAULT_EMAIL: soporte@test.com
PGADMIN_DEFAULT_PASSWORD: 123456
container_name: pgadmin
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { SectionCourseModule } from './section-course/section-course.module';
import { VideoCourseModule } from './video-course/video-course.module';
import { ResourceVideoCourseModule } from './resource-video-course/resource-video-course.module';
import { SectionCourseVideoModule } from './section-course-video/section-course-video.module';
import { VideoCommentModule } from './video-comment/video-comment.module';



Expand Down Expand Up @@ -76,6 +77,7 @@ import { SectionCourseVideoModule } from './section-course-video/section-course-
VideoCourseModule,
ResourceVideoCourseModule,
SectionCourseVideoModule,
VideoCommentModule,
],
controllers: [],
providers: [],
Expand Down
1 change: 1 addition & 0 deletions src/video-comment/dto/create-video-comment.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class CreateVideoCommentDto {}
4 changes: 4 additions & 0 deletions src/video-comment/dto/update-video-comment.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { PartialType } from '@nestjs/swagger';
import { CreateVideoCommentDto } from './create-video-comment.dto';

export class UpdateVideoCommentDto extends PartialType(CreateVideoCommentDto) {}
1 change: 1 addition & 0 deletions src/video-comment/entities/video-comment.entity.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export class VideoComment {}
35 changes: 35 additions & 0 deletions src/video-comment/video-comment.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';

import { VideoCommentService } from './video-comment.service';
import { CreateVideoCommentDto } from './dto/create-video-comment.dto';
import { UpdateVideoCommentDto } from './dto/update-video-comment.dto';

@Controller('video-comment')
export class VideoCommentController {
constructor(private readonly videoCommentService: VideoCommentService) {}

@Post()
create(@Body() createVideoCommentDto: CreateVideoCommentDto) {
return this.videoCommentService.create(createVideoCommentDto);
}

@Get()
findAll() {
return this.videoCommentService.findAll();
}

@Get(':id')
findOne(@Param('id') id: string) {
return this.videoCommentService.findOne(+id);
}

@Patch(':id')
update(@Param('id') id: string, @Body() updateVideoCommentDto: UpdateVideoCommentDto) {
return this.videoCommentService.update(+id, updateVideoCommentDto);
}

@Delete(':id')
remove(@Param('id') id: string) {
return this.videoCommentService.remove(+id);
}
}
9 changes: 9 additions & 0 deletions src/video-comment/video-comment.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { VideoCommentService } from './video-comment.service';
import { VideoCommentController } from './video-comment.controller';

@Module({
controllers: [VideoCommentController],
providers: [VideoCommentService]
})
export class VideoCommentModule {}
26 changes: 26 additions & 0 deletions src/video-comment/video-comment.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Injectable } from '@nestjs/common';
import { CreateVideoCommentDto } from './dto/create-video-comment.dto';
import { UpdateVideoCommentDto } from './dto/update-video-comment.dto';

@Injectable()
export class VideoCommentService {
create(createVideoCommentDto: CreateVideoCommentDto) {
return 'This action adds a new videoComment';
}

findAll() {
return `This action returns all videoComment`;
}

findOne(id: number) {
return `This action returns a #${id} videoComment`;
}

update(id: number, updateVideoCommentDto: UpdateVideoCommentDto) {
return `This action updates a #${id} videoComment`;
}

remove(id: number) {
return `This action removes a #${id} videoComment`;
}
}

0 comments on commit 61b2d6e

Please sign in to comment.