-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from BETTER-iTER/feature/44
[FEATURE-44] SEARCH entity 구현
- Loading branch information
Showing
5 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/com/example/betteriter/fo_domain/search/controller/SearchController.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,13 @@ | ||
package com.example.betteriter.fo_domain.search.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Slf4j | ||
@RequestMapping("/category") | ||
@RequiredArgsConstructor | ||
@RestController | ||
public class SearchController { | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/example/betteriter/fo_domain/search/domain/SearchWord.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,34 @@ | ||
package com.example.betteriter.fo_domain.search.domain; | ||
|
||
|
||
import com.example.betteriter.fo_domain.user.domain.User; | ||
import lombok.*; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.data.annotation.CreatedDate; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Slf4j | ||
@Getter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity(name = "SEARCH_WORD") | ||
public class SearchWord { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@JoinColumn(name = "user_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private User user; | ||
|
||
@Column(name = "search_word", nullable = false) | ||
private String searchWord; | ||
|
||
@CreatedDate | ||
@Column(name = "created_at", updatable = false) | ||
private LocalDateTime createdAt; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/example/betteriter/fo_domain/search/dto/SearchWordResponse.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,4 @@ | ||
package com.example.betteriter.fo_domain.search.dto; | ||
|
||
public class SearchWordResponse { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/example/betteriter/fo_domain/search/exception/SearchHandler.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,11 @@ | ||
package com.example.betteriter.fo_domain.search.exception; | ||
|
||
import com.example.betteriter.global.error.exception.ErrorCode; | ||
import com.example.betteriter.global.error.exception.GeneralException; | ||
|
||
public class SearchHandler extends GeneralException { | ||
|
||
public SearchHandler(ErrorCode errorCode) { | ||
super(errorCode); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/example/betteriter/fo_domain/search/repository/SearchRepository.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,8 @@ | ||
package com.example.betteriter.fo_domain.search.repository; | ||
|
||
import com.example.betteriter.fo_domain.search.domain.SearchWord; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface SearchRepository extends JpaRepository<SearchWord, Long> { | ||
|
||
} |