-
Notifications
You must be signed in to change notification settings - Fork 3
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
5d084e7
commit ce99921
Showing
56 changed files
with
533 additions
and
418 deletions.
There are no files selected for viewing
Binary file modified
BIN
+91.6 KB
(190%)
윤정은/spring/.gradle/8.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
윤정은/spring/.gradle/8.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
윤정은/spring/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
윤정은/spring/build/classes/java/main/board/spring/Application.class
Binary file not shown.
Binary file modified
BIN
-1.15 KB
(79%)
윤정은/spring/build/classes/java/main/board/spring/controller/BoardController.class
Binary file not shown.
Binary file modified
BIN
-179 Bytes
(94%)
윤정은/spring/build/classes/java/main/board/spring/controller/CommentController.class
Binary file not shown.
Binary file modified
BIN
-115 Bytes
(95%)
윤정은/spring/build/classes/java/main/board/spring/controller/MemberController.class
Binary file not shown.
Binary file modified
BIN
-429 Bytes
(80%)
윤정은/spring/build/classes/java/main/board/spring/domain/Board.class
Binary file not shown.
Binary file modified
BIN
-566 Bytes
(75%)
윤정은/spring/build/classes/java/main/board/spring/domain/Comment.class
Binary file not shown.
Binary file modified
BIN
-436 Bytes
(73%)
윤정은/spring/build/classes/java/main/board/spring/domain/Member.class
Binary file not shown.
Binary file modified
BIN
-191 Bytes
(87%)
윤정은/spring/build/classes/java/main/board/spring/dto/request/BoardSaveRequest.class
Binary file not shown.
Binary file modified
BIN
-106 Bytes
(93%)
윤정은/spring/build/classes/java/main/board/spring/dto/request/CommentSaveRequest.class
Binary file not shown.
Binary file removed
BIN
-693 Bytes
윤정은/spring/build/classes/java/main/board/spring/dto/request/MemberLoginRequest.class
Binary file not shown.
Binary file removed
BIN
-752 Bytes
윤정은/spring/build/classes/java/main/board/spring/dto/request/MemberSaveRequest.class
Binary file not shown.
Binary file modified
BIN
-1.68 KB
(54%)
윤정은/spring/build/classes/java/main/board/spring/dto/response/BoardDetailResponse.class
Binary file not shown.
Binary file modified
BIN
-263 Bytes
(78%)
윤정은/spring/build/classes/java/main/board/spring/dto/response/BoardListResponse.class
Binary file not shown.
Binary file modified
BIN
-63 Bytes
(89%)
윤정은/spring/build/classes/java/main/board/spring/repository/CommentRepository.class
Binary file not shown.
Binary file modified
BIN
-267 Bytes
(66%)
윤정은/spring/build/classes/java/main/board/spring/repository/MemberRepository.class
Binary file not shown.
Binary file modified
BIN
-1.75 KB
(75%)
윤정은/spring/build/classes/java/main/board/spring/service/BoardService.class
Binary file not shown.
Binary file modified
BIN
+571 Bytes
(110%)
윤정은/spring/build/classes/java/main/board/spring/service/CommentService.class
Binary file not shown.
Binary file modified
BIN
+486 Bytes
(120%)
윤정은/spring/build/classes/java/main/board/spring/service/MemberService.class
Binary file not shown.
Binary file modified
BIN
+1.25 KB
(100%)
윤정은/spring/build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
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
27 changes: 10 additions & 17 deletions
27
윤정은/spring/src/main/java/board/spring/controller/MemberController.java
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,42 +1,35 @@ | ||
package board.spring.controller; | ||
|
||
import board.spring.dto.request.MemberLoginRequest; | ||
import board.spring.dto.request.MemberSaveRequest; | ||
import board.spring.dto.request.MemberSignInRequest; | ||
import board.spring.dto.request.MemberSignUpRequest; | ||
import board.spring.service.MemberService; | ||
import lombok.RequiredArgsConstructor; | ||
import jakarta.validation.Valid; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.server.ResponseStatusException; | ||
|
||
@RestController | ||
//@RequiredArgsConstructor | ||
@RequestMapping("api/members") | ||
public class MemberController { | ||
|
||
private final MemberService memberService; | ||
|
||
// @RequiredArgsConstructor를 대체하는 코드 | ||
public MemberController(MemberService memberService) { | ||
this.memberService = memberService; | ||
} | ||
|
||
// 회원가입 | ||
@PostMapping | ||
public ResponseEntity<Void> saveMember(@RequestBody MemberSaveRequest request) { | ||
memberService.saveMember(request); | ||
@PostMapping("/signup") | ||
public ResponseEntity<Void> signUp(@RequestBody @Valid MemberSignUpRequest request) { | ||
memberService.signUp(request); | ||
return ResponseEntity.status(HttpStatus.CREATED).build(); | ||
} | ||
|
||
// 로그인 | ||
@PostMapping("/login") | ||
public ResponseEntity<Void> loginMember(@RequestBody MemberLoginRequest request) { | ||
if (memberService.loginMember(request)) { | ||
return ResponseEntity.status(HttpStatus.OK).build(); | ||
} | ||
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Invalid email or password"); | ||
@PostMapping("/signin") | ||
public ResponseEntity<Void> signIn(@RequestBody @Valid MemberSignInRequest request) { | ||
memberService.signIn(request); | ||
return ResponseEntity.status(HttpStatus.OK).build(); | ||
} | ||
} |
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
Oops, something went wrong.