-
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
Showing
29 changed files
with
948 additions
and
35 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
20 changes: 20 additions & 0 deletions
20
src/main/java/org/example/tokpik_be/config/QueryDslConfig.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,20 @@ | ||
package org.example.tokpik_be.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import jakarta.persistence.EntityManager; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class QueryDslConfig { | ||
|
||
private final EntityManager entityManager; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
|
||
return new JPAQueryFactory(entityManager); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/example/tokpik_be/exception/ScrapException.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,15 @@ | ||
package org.example.tokpik_be.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum ScrapException implements BaseException { | ||
|
||
SCRAP_NOT_FOUND(HttpStatus.BAD_REQUEST, "존재하지 않는 스크랩"); | ||
|
||
private final HttpStatus status; | ||
private final String message; | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/org/example/tokpik_be/exception/TalkTopicException.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,15 @@ | ||
package org.example.tokpik_be.exception; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum TalkTopicException implements BaseException { | ||
|
||
TALK_TOPIC_NOT_FOUND(HttpStatus.BAD_REQUEST, "존재하지 않는 대화 주제"); | ||
|
||
private final HttpStatus status; | ||
private final String 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
12 changes: 12 additions & 0 deletions
12
src/main/java/org/example/tokpik_be/scrap/dto/request/ScrapCreateRequest.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,12 @@ | ||
package org.example.tokpik_be.scrap.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
|
||
public record ScrapCreateRequest( | ||
@Schema(type = "string", description = "스크랩 이름(제목)", example = "여친과 하기 좋은 대화 주제") | ||
@NotBlank(message = "스크랩 이름은 필수값") | ||
String scrapName | ||
) { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/org/example/tokpik_be/scrap/dto/response/ScrapCreateResponse.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 org.example.tokpik_be.scrap.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
public record ScrapCreateResponse( | ||
@Schema(type = "number", description = "생성된 스크랩 ID", example = "1") | ||
long scrapId | ||
) { | ||
|
||
} |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/org/example/tokpik_be/tag/dto/response/PlaceTagTotalResponse.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,25 @@ | ||
package org.example.tokpik_be.tag.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
import org.example.tokpik_be.tag.domain.PlaceTag; | ||
|
||
public record PlaceTagTotalResponse( | ||
@Schema(type = "array", description = "대화 장소들") | ||
List<PlaceTagResponse> placeTags | ||
) { | ||
|
||
public record PlaceTagResponse( | ||
@Schema(type = "number", description = "대화 장소 ID", example = "1") | ||
long placeTagId, | ||
|
||
@Schema(type = "string", description = "대화 장소 내용", example = "학교") | ||
String content | ||
) { | ||
|
||
public static PlaceTagResponse from(PlaceTag placeTag) { | ||
|
||
return new PlaceTagResponse(placeTag.getId(), placeTag.getContent()); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/org/example/tokpik_be/tag/dto/response/TopicTagTotalResponse.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,25 @@ | ||
package org.example.tokpik_be.tag.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
import org.example.tokpik_be.tag.domain.TopicTag; | ||
|
||
public record TopicTagTotalResponse( | ||
@Schema(type = "array", description = "대화 종류들") | ||
List<TopicTagResponse> topicTags | ||
) { | ||
|
||
public record TopicTagResponse( | ||
@Schema(type = "number", description = "대화 종류 ID", example = "1") | ||
long talkTypeId, | ||
|
||
@Schema(type = "string", description = "대화 종류 내용", example = "비즈니스와 업무") | ||
String content | ||
) { | ||
|
||
public static TopicTagResponse from(TopicTag topicTag) { | ||
|
||
return new TopicTagResponse(topicTag.getId(), topicTag.getContent()); | ||
} | ||
} | ||
} |
Oops, something went wrong.