-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Prisma } from '@prisma/client'; | ||
|
||
export class LectureResDto | ||
implements | ||
Prisma.LectureGetPayload<{ | ||
include: { | ||
LectureProfessor: { | ||
include: { | ||
professor: true; | ||
}; | ||
}; | ||
}; | ||
}> | ||
{ | ||
@ApiProperty({ | ||
example: [ | ||
{ | ||
id: 1, | ||
name: '김교수', | ||
}, | ||
], | ||
description: '교수 정보', | ||
}) | ||
LectureProfessor: ({ professor: { id: number; name: string } } & { | ||
id: number; | ||
lectureId: number; | ||
professorId: number; | ||
})[]; | ||
|
||
@ApiProperty({ | ||
example: 1, | ||
description: '강의 Id', | ||
}) | ||
id: number; | ||
|
||
@ApiProperty({ | ||
example: 'A0001', | ||
description: '강의 코드', | ||
}) | ||
lectureCode: string[]; | ||
|
||
@ApiProperty({ | ||
example: '운영체제', | ||
description: '강의 이름', | ||
}) | ||
lectureName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { LectureResDto } from './dto/res/lectureRes.dto'; | ||
|
||
@Controller('lecture') | ||
export class LectureController { | ||
@Get() | ||
async getAll(): Promise<LectureResDto[]> { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { LectureController } from './lecture.controller'; | ||
import { LectureService } from './lecture.service'; | ||
import { PrismaModule } from 'src/prisma/prisma.module'; | ||
import { LectureRepository } from './lecture.repository'; | ||
|
||
@Module({ | ||
imports: [PrismaModule], | ||
controllers: [LectureController], | ||
providers: [LectureService, LectureRepository], | ||
}) | ||
export class LectureModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
import { Lecture } from '@prisma/client'; | ||
import { PrismaService } from 'src/prisma/prisma.service'; | ||
|
||
@Injectable() | ||
export class LectureRepository { | ||
constructor(private readonly prismaService: PrismaService) {} | ||
|
||
async getAll(): Promise<Lecture[]> { | ||
return this.prismaService.lecture.findMany({ | ||
include: { | ||
LectureProfessor: { | ||
include: { | ||
professor: true, | ||
}, | ||
}, | ||
}, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class LectureService {} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters