-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
c5584c6
commit ac10cd8
Showing
6 changed files
with
84 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
import { Controller, Post, Body } from '@nestjs/common'; | ||
import { AuthService } from './auth.service'; | ||
import { CreateUserDto } from './dto/create-user.dto'; | ||
import { LoginUserDto } from './dto/login-user.dto'; | ||
|
||
@Controller('auth') | ||
export class AuthController { | ||
constructor(private readonly authService: AuthService) {} | ||
|
||
@Post() | ||
login(@Body('email') email: string, @Body('password') password: string) { | ||
return { email, password }; | ||
@Post('/login') | ||
login(@Body() loginUserDto: LoginUserDto) { | ||
return loginUserDto; | ||
} | ||
|
||
@Post() | ||
signup( | ||
@Body('name') name: string, | ||
@Body('email') email: string, | ||
@Body('password') password: string, | ||
) { | ||
return { name, email, password }; | ||
@Post('/signup') | ||
signup(@Body() createUserDto: CreateUserDto) { | ||
return createUserDto; | ||
} | ||
} |
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 { IsString, IsEmail } from 'class-validator'; | ||
|
||
export class CreateUserDto { | ||
@IsString() | ||
name: string; | ||
|
||
@IsEmail() | ||
email: string; | ||
|
||
@IsString() | ||
password: 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,9 @@ | ||
import { IsString, IsEmail } from 'class-validator'; | ||
|
||
export class LoginUserDto { | ||
@IsEmail() | ||
email: string; | ||
|
||
@IsString() | ||
password: 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 |
---|---|---|
@@ -1,12 +1,39 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { Controller, Get, Post, Delete } from '@nestjs/common'; | ||
import { CommentService } from './comment.service'; | ||
|
||
@Controller('comment') | ||
export class CommentController { | ||
constructor(private readonly commentService: CommentService) {} | ||
|
||
@Get() | ||
getUser(): string { | ||
@Post() | ||
createComment() { | ||
return 'get user information'; | ||
} | ||
|
||
// 특정 웹툰의 댓글을 보는 기능 | ||
@Get('webtoon/:webtoonId') | ||
getWebtoonComments() { | ||
return 'geting comments'; | ||
} | ||
|
||
// 자신이 쓴 댓글 목록을 보는 기능 | ||
@Get('user/:userId') | ||
getUserComments() { | ||
return 'reading comments'; | ||
} | ||
|
||
@Post('like') | ||
clickLike() { | ||
return 'click like'; | ||
} | ||
|
||
@Post('dislike') | ||
clickDislike() { | ||
return 'click like'; | ||
} | ||
|
||
@Delete(':commentId') | ||
deleteComment() { | ||
return 'delete comment'; | ||
} | ||
} |
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 { IsString, IsEmail } from 'class-validator'; | ||
|
||
export class UpdateUserDto { | ||
@IsString() | ||
name: string; | ||
|
||
@IsEmail() | ||
email: string; | ||
|
||
@IsString() | ||
password: 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 |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
import { Controller, Get, Put, Delete, Body } from '@nestjs/common'; | ||
import { UserService } from './user.service'; | ||
import { UpdateUserDto } from './dto/update-user.dto'; | ||
|
||
@Controller('user') | ||
export class UserController { | ||
constructor(private readonly userService: UserService) {} | ||
|
||
@Get() | ||
getUser(): string { | ||
getUser() { | ||
return 'get user information'; | ||
} | ||
|
||
@Put() | ||
updateUser(@Body() updateUserDto: UpdateUserDto) { | ||
return updateUserDto; | ||
} | ||
|
||
@Delete() | ||
deleteUser() { | ||
return 'delete user'; | ||
} | ||
} |