Skip to content

Commit

Permalink
Merge pull request #22 from jwpark1211/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jwpark1211 authored May 16, 2024
2 parents 7484097 + 46d3fb4 commit a90ea87
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public class BookStateController {

private final BookStateService bookStateService;

@Operation(summary = "책 상태 생성")
@Operation(summary = "책 상태 생성 / state=READING or WANT_TO_READ or READ_ALREADY")
@PostMapping(path = "/new")
public ResponseEntity<? extends BasicResponse> saveBookState(
@RequestBody @Valid SaveRequest request
@RequestBody @Valid StateSaveRequest request
){
return ResponseEntity.ok()
.body(new ResponseCounter<IdResponse>(
Expand All @@ -44,7 +44,7 @@ public ResponseEntity<? extends BasicResponse> getStateByISBN(
@PageableDefault(sort = "id", size=10) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<StateInfoResponse>>(
bookStateService.findStateByISBN(isbn, pageable)));
}

Expand All @@ -54,7 +54,7 @@ public ResponseEntity<? extends BasicResponse> getStateById(
@PathVariable("state-id") Long stateId
){
return ResponseEntity.ok()
.body(new ResponseCounter<InfoResponse>(
.body(new ResponseCounter<StateInfoResponse>(
bookStateService.findStateByStateId(stateId)));
}

Expand All @@ -66,15 +66,15 @@ public ResponseEntity<? extends BasicResponse> getStateByMemberId(
@PageableDefault(sort = "id", size=10) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<StateInfoResponse>>(
bookStateService.findStateByMemberId(memberId,pageable)));
}

@Operation(summary = "state 정보 수정")
@Operation(summary = "state 정보 수정 / state=READING or WANT_TO_READ or READ_ALREADY")
@PatchMapping(path = "/{state-id}")
public ResponseEntity<? extends BasicResponse> updateState(
@PathVariable("state-id") Long stateId,
@RequestBody @Valid UpdateRequest request
@RequestBody @Valid StateUpdateRequest request
){
bookStateService.updateState(stateId, request);
return ResponseEntity.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class CommentController {

private final CommentService commentService;

@Operation(summary = "코멘트 생성")
@Operation(summary = "코멘트 생성 / content는 최소 1자, 최대 100자")
@PostMapping(path = "/new")
public ResponseEntity<? extends BasicResponse> saveComment(
@RequestBody @Valid SaveRequest request
@RequestBody @Valid CommentSaveRequest request
){
return ResponseEntity.ok()
.body(new ResponseCounter<IdResponse>(
Expand All @@ -41,7 +41,7 @@ public ResponseEntity<? extends BasicResponse> getCommentById(
@PathVariable("comment-id") Long commentId
){
return ResponseEntity.ok()
.body(new ResponseCounter<InfoResponse>(
.body(new ResponseCounter<CommentInfoResponse>(
commentService.findCommentByCommentId(commentId)));
}

Expand All @@ -52,7 +52,7 @@ public ResponseEntity<? extends BasicResponse> getAll(
@PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<CommentInfoResponse>>(
commentService.findAllComment(pageable)));
}

Expand All @@ -64,7 +64,7 @@ public ResponseEntity<? extends BasicResponse> getCommentByISBN(
@PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<CommentInfoResponse>>(
commentService.findCommentByIsbn(isbn, pageable)));
}

Expand All @@ -76,15 +76,15 @@ public ResponseEntity<? extends BasicResponse> getCommentByMemberId(
@PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<CommentInfoResponse>>(
commentService.findCommentByMemberId(memberId, pageable)));
}

@Operation(summary = "코멘트 수정")
@Operation(summary = "코멘트 수정 / content는 최소 1자, 최대 100자")
@PatchMapping(path = "/{comment-id}")
public ResponseEntity<? extends BasicResponse> updateComment(
@PathVariable("comment-id") Long commentId,
@RequestBody @Valid UpdateRequest request
@RequestBody @Valid CommentUpdateRequest request
){
commentService.updateComment(commentId, request);
return ResponseEntity.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ public class MemberController {

private final MemberService memberService;

@Operation(summary = "deloy test")
@Operation(summary = "deploy test")
@GetMapping("/test")
public String test(){
return "DEPLOY 0515";
return "DEPLOY 0517";
}

@Operation(summary = "회원가입")
@Operation(summary = "회원가입/"+"비밀번호=영문 대,소문자와 숫자, 특수기호가 적어도 1개 이상씩 포함된 8자 ~ 20자/"
+"gender=MALE or FEMALE/"+"birthdate=yyyy-mm-dd/"+"email=이메일 format 준수")
@PostMapping(path = "/new")
public ResponseEntity<? extends BasicResponse> save(
@RequestBody @Valid SaveRequest request){
@RequestBody @Valid MemberSaveRequest request){
return ResponseEntity.ok()
.body(new ResponseCounter<IdResponse>(
memberService.saveMember(request)));
Expand All @@ -52,7 +53,7 @@ public ResponseEntity<? extends BasicResponse> isEmailUnique(
@Operation(summary = "로그인")
@PostMapping(path = "/login")
public ResponseEntity<? extends BasicResponse> login(
@RequestBody @Valid LoginRequest request
@RequestBody @Valid MemberLoginRequest request
){
memberService.login(request);
return ResponseEntity.ok()
Expand All @@ -65,7 +66,7 @@ public ResponseEntity<? extends BasicResponse> findOneMember(
@PathVariable("id") Long memberId
){
return ResponseEntity.ok(
new ResponseCounter<InfoResponse>(
new ResponseCounter<MemberInfoResponse>(
memberService.getMemberInfoWithId(memberId)));
}

Expand All @@ -76,7 +77,7 @@ public ResponseEntity<? extends BasicResponse> findAllMembers(
@PageableDefault(sort="id",size = 10) Pageable pageable
){
return ResponseEntity.ok(
new ResponseCounter<Page<InfoResponse>>(
new ResponseCounter<Page<MemberInfoResponse>>(
memberService.getAllMemberInfo(pageable)));
}

Expand All @@ -90,7 +91,7 @@ public ResponseEntity<? extends BasicResponse> updateMemberProfile(
return ResponseEntity.ok().build();
}*/

@Operation(summary = "회원 탈퇴/추가 구현 필요(미완성)")
@Operation(summary = "회원 탈퇴")
@DeleteMapping(path = "/{id}")
public ResponseEntity<? extends BasicResponse> deleteMember(
@PathVariable("id") Long memberId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public class StarController {

private final StarService starService;

@Operation(summary = "평점 생성[평점은 0.5부터 5까지 0.5단위로 증가합니다.")
@Operation(summary = "평점 생성[평점은 0.5부터 5까지 0.5단위로 증가합니다.]")
@PostMapping(path = "/new")
public ResponseEntity<? extends BasicResponse> saveStar(
@RequestBody @Valid SaveRequest request
@RequestBody @Valid StarSaveRequest request
){
return ResponseEntity.ok()
.body(new ResponseCounter<IdResponse>(
Expand All @@ -41,7 +41,7 @@ public ResponseEntity<? extends BasicResponse> getStarById(
@PathVariable("star-id") Long starId
){
return ResponseEntity.ok()
.body(new ResponseCounter<InfoResponse>(
.body(new ResponseCounter<StarInfoResponse>(
starService.findStarByStarId(starId)));
}

Expand All @@ -53,7 +53,7 @@ public ResponseEntity<? extends BasicResponse> getAllStar(
@PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<StarInfoResponse>>(
starService.findAllStar(pageable)));
}

Expand All @@ -65,7 +65,7 @@ public ResponseEntity<? extends BasicResponse> getStarByISBN(
@PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<StarInfoResponse>>(
starService.findStarByISBN(isbn,pageable)));
}

Expand All @@ -77,15 +77,15 @@ public ResponseEntity<? extends BasicResponse> getStarByMemberId(
@PageableDefault(sort = "createdAt", direction = Sort.Direction.DESC) Pageable pageable
){
return ResponseEntity.ok()
.body(new ResponseCounter<Page<InfoResponse>>(
.body(new ResponseCounter<Page<StarInfoResponse>>(
starService.findStarByMemberId(memberId,pageable)));
}

@Operation(summary = "평점 수정")
@PatchMapping(path="/{star-id}")
public ResponseEntity<? extends BasicResponse> updateStar(
@PathVariable("star-id") Long starId,
@RequestBody @Valid UpdateRequest request
@RequestBody @Valid StarUpdateRequest request
){
starService.updateStar(starId, request);
return ResponseEntity.ok()
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/capstone/bookitty/domain/dto/BookStateDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class BookStateDTO {

@Data
public static class SaveRequest {
public static class StateSaveRequest {
@NotBlank(message = "ISBN is a requred entry value.")
private String isbn;
@NotNull(message = "memberId is a required entry value.")
Expand All @@ -30,7 +30,7 @@ public static class SaveRequest {
}

@Data
public static class UpdateRequest{
public static class StateUpdateRequest{
@ValidEnum(enumClass = State.class, message = "State is not valid.")
private State state;
}
Expand All @@ -48,7 +48,7 @@ public static IdResponse of (BookState bookState){
@Getter
@AllArgsConstructor
@NoArgsConstructor
public static class InfoResponse{
public static class StateInfoResponse{
private Long id;
private Long memberId;
private String isbn;
Expand All @@ -60,8 +60,8 @@ public static class InfoResponse{
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
private LocalDateTime readAt;

public static InfoResponse of(BookState state){
return new InfoResponse(state.getId(), state.getMember().getId(), state.getIsbn(),
public static StateInfoResponse of(BookState state){
return new StateInfoResponse(state.getId(), state.getMember().getId(), state.getIsbn(),
state.getState(),state.getCategoryName(),state.getBookTitle(),state.getBookAuthor(),
state.getBookImgUrl(),state.getReadAt());
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/capstone/bookitty/domain/dto/CommentDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class CommentDTO {

@Data
public static class SaveRequest{
public static class CommentSaveRequest{
@NotBlank(message = "Isbn is a required entry value.")
private String isbn;
@NotNull(message = "memberId is a required entry value.")
Expand All @@ -27,7 +27,7 @@ public static class SaveRequest{
}

@Data
public static class UpdateRequest{
public static class CommentUpdateRequest{
@NotEmpty(message = "content is a required entry value.")
@Size(min = 1, max = 100, message = "Name must be between 1 and 100 characters")
private String content;
Expand All @@ -46,7 +46,7 @@ public static IdResponse of(Comment comment){
@Getter
@AllArgsConstructor
@NoArgsConstructor
public static class InfoResponse{
public static class CommentInfoResponse{
private Long id;
private Long memberId;
private String isbn;
Expand All @@ -57,8 +57,8 @@ public static class InfoResponse{
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

public static InfoResponse of(Comment comment, int like_count){
return new InfoResponse(comment.getId(), comment.getMember().getId(),comment.getIsbn(),
public static CommentInfoResponse of(Comment comment, int like_count){
return new CommentInfoResponse(comment.getId(), comment.getMember().getId(),comment.getIsbn(),
comment.getContent(), like_count ,comment.getCreatedAt(),
comment.getModifiedAt());
}
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/capstone/bookitty/domain/dto/MemberDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class MemberDTO {
@Data
public static class SaveRequest {
public static class MemberSaveRequest {
@NotBlank(message = "Email is a required entry value.")
@Email(message = "Email format is not valid.")
private String email;
Expand All @@ -26,15 +26,15 @@ public static class SaveRequest {
message = "비밀번호는 영문 대,소문자와 숫자, 특수기호가 적어도 1개 이상씩 포함된 8자 ~ 20자의 비밀번호여야 합니다.")
private String password;
@ValidEnum(enumClass = Gender.class, message = "Invalid gender")
private Gender gender;
private Gender gender; //FEMALE 혹은 MALE
@DateTimeFormat(pattern = "yyyy-mm-dd")
private LocalDate birthdate;
@NotBlank(message = "name is a required entry value.")
private String name;
}

@Data
public static class LoginRequest {
public static class MemberLoginRequest {
@NotBlank(message = "Email is a required entry value.")
@Email(message = "Email format is not valid.")
private String email;
Expand All @@ -56,13 +56,13 @@ public static IdResponse of (Member member){
@AllArgsConstructor
@NoArgsConstructor
public static class BoolResponse{
private boolean isUnique;
private boolean unique;
}

@Getter
@AllArgsConstructor
@NoArgsConstructor
public static class InfoResponse{
public static class MemberInfoResponse{
private Long id;
private String email;
private String profileImg;
Expand All @@ -71,8 +71,8 @@ public static class InfoResponse{
@DateTimeFormat(pattern="yyyy-mm-dd")
private LocalDate birthDate;

public static InfoResponse of(Member member){
return new InfoResponse(member.getId(), member.getEmail(), member.getProfileImg(),
public static MemberInfoResponse of(Member member){
return new MemberInfoResponse(member.getId(), member.getEmail(), member.getProfileImg(),
member.getName(), member.getGender(), member.getBirthDate());
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/capstone/bookitty/domain/dto/StarDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class StarDTO {
@Data
public static class SaveRequest{
public static class StarSaveRequest{
@NotBlank(message = "Isbn is a required entry value.")
private String isbn;
@NotNull(message = "memberId is a required entry value.")
Expand All @@ -24,7 +24,7 @@ public static class SaveRequest{
}

@Data
public static class UpdateRequest{
public static class StarUpdateRequest{
@NotNull(message = "score is a required entry value.")
@ValidScore
private double score;
Expand All @@ -43,7 +43,7 @@ public static IdResponse of(Star star){
@Getter
@AllArgsConstructor
@NoArgsConstructor
public static class InfoResponse{
public static class StarInfoResponse{
private Long id;
private Long memberId;
private String isbn;
Expand All @@ -53,8 +53,8 @@ public static class InfoResponse{
@DateTimeFormat(pattern = "yyyy-mm-dd'T'HH:mm:ss")
private LocalDateTime modifiedAt;

public static InfoResponse of(Star star){
return new InfoResponse(star.getId(), star.getMember().getId(),star.getIsbn(),
public static StarInfoResponse of(Star star){
return new StarInfoResponse(star.getId(), star.getMember().getId(),star.getIsbn(),
star.getScore(),star.getCreatedAt(),star.getModifiedAt());
}
}
Expand Down
Loading

0 comments on commit a90ea87

Please sign in to comment.