Skip to content

Commit

Permalink
Merge pull request #60 from BETTER-iTER/feature/44
Browse files Browse the repository at this point in the history
[FEATURE-44] SEARCH entity 구현
  • Loading branch information
luke0408 authored Oct 24, 2023
2 parents f4aaf28 + 98d6dd5 commit 9feed7f
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
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 {
}
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;
}
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 {
}
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);
}
}
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> {

}

0 comments on commit 9feed7f

Please sign in to comment.