-
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.
[FEAT] get all plans api 및 불필요한 dto 요소 제거
- Loading branch information
Showing
21 changed files
with
137 additions
and
104 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
15 changes: 0 additions & 15 deletions
15
backend/src/main/java/com/twtw/backend/domain/place/entity/Address.java
This file was deleted.
Oops, something went wrong.
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: 27 additions & 0 deletions
27
...nd/src/main/java/com/twtw/backend/domain/plan/controller/advice/PlanControllerAdvice.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.twtw.backend.domain.plan.controller.advice; | ||
|
||
import com.twtw.backend.domain.plan.exception.InvalidPlanMemberException; | ||
import com.twtw.backend.domain.plan.exception.PlanMakerNotExistsException; | ||
import com.twtw.backend.global.advice.ErrorResponse; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice | ||
public class PlanControllerAdvice { | ||
|
||
@ExceptionHandler(InvalidPlanMemberException.class) | ||
public ResponseEntity<ErrorResponse> refreshTokenInfoMismatch( | ||
final InvalidPlanMemberException e) { | ||
return ResponseEntity.status(HttpStatus.BAD_REQUEST) | ||
.body(new ErrorResponse(e.getMessage())); | ||
} | ||
|
||
@ExceptionHandler(PlanMakerNotExistsException.class) | ||
public ResponseEntity<ErrorResponse> refreshTokenInfoMismatch( | ||
final PlanMakerNotExistsException e) { | ||
return ResponseEntity.status(HttpStatus.BAD_REQUEST) | ||
.body(new ErrorResponse(e.getMessage())); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...end/src/main/java/com/twtw/backend/domain/plan/exception/PlanMakerNotExistsException.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.twtw.backend.domain.plan.exception; | ||
|
||
public class PlanMakerNotExistsException extends IllegalStateException { | ||
|
||
private static final String MESSAGE = "계획을 생성한 멤버가 존재하지 않습니다."; | ||
|
||
public PlanMakerNotExistsException() { | ||
super(MESSAGE); | ||
} | ||
} |
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
11 changes: 8 additions & 3 deletions
11
backend/src/main/java/com/twtw/backend/domain/plan/repository/PlanRepository.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,9 +1,14 @@ | ||
package com.twtw.backend.domain.plan.repository; | ||
|
||
import com.twtw.backend.domain.member.entity.Member; | ||
import com.twtw.backend.domain.plan.entity.Plan; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
import java.util.UUID; | ||
public interface PlanRepository extends JpaRepository<Plan, UUID> { | ||
|
||
public interface PlanRepository extends JpaRepository<Plan, UUID> {} | ||
@Query("select p from Plan p join fetch p.planMembers pm join fetch pm.member m where m.id = :member") | ||
List<Plan> findAllByMember(Member member); | ||
} |
Oops, something went wrong.