diff --git a/src/main/java/com/mews/mews_backend/api/search/controller/SearchController.java b/src/main/java/com/mews/mews_backend/api/search/controller/SearchController.java new file mode 100644 index 0000000..56b5bcf --- /dev/null +++ b/src/main/java/com/mews/mews_backend/api/search/controller/SearchController.java @@ -0,0 +1,25 @@ +package com.mews.mews_backend.api.search.controller; + +import com.mews.mews_backend.api.search.dto.response.PostSearchRes; +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +@Api(tags = {"Mews Search API"}) +@RequestMapping("/search") +public class SearchController { + + @PostMapping(value = "/{keyword}") + public ResponseEntity Search(@PathVariable ("keyword") String string) { + PostSearchRes postSearchRes = new PostSearchRes(); + + + return ResponseEntity.ok(postSearchRes); + } +} diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/request/PostSearchReq.java b/src/main/java/com/mews/mews_backend/api/search/dto/request/PostSearchReq.java new file mode 100644 index 0000000..51177bc --- /dev/null +++ b/src/main/java/com/mews/mews_backend/api/search/dto/request/PostSearchReq.java @@ -0,0 +1,18 @@ +package com.mews.mews_backend.api.search.dto.request; + +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +@AllArgsConstructor +@NoArgsConstructor +@Getter +public class PostSearchReq { + + @NotBlank + @ApiModelProperty(notes = "검색 키워드", example = "작성자") + private String keyword; +} diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java new file mode 100644 index 0000000..b1cc746 --- /dev/null +++ b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostArticleRes.java @@ -0,0 +1,7 @@ +package com.mews.mews_backend.api.search.dto.response; + +import lombok.Getter; + +@Getter +public class PostArticleRes { +} diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java new file mode 100644 index 0000000..26c219c --- /dev/null +++ b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostEditorRes.java @@ -0,0 +1,7 @@ +package com.mews.mews_backend.api.search.dto.response; + +import lombok.Getter; + +@Getter +public class PostEditorRes { +} diff --git a/src/main/java/com/mews/mews_backend/api/search/dto/response/PostSearchRes.java b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostSearchRes.java new file mode 100644 index 0000000..8e971f0 --- /dev/null +++ b/src/main/java/com/mews/mews_backend/api/search/dto/response/PostSearchRes.java @@ -0,0 +1,13 @@ +package com.mews.mews_backend.api.search.dto.response; + +import lombok.Getter; + +import java.util.List; + +@Getter +public class PostSearchRes { + + private List postArticleRes; + + private List postSearchRes; +} diff --git a/src/main/java/com/mews/mews_backend/domain/search/repository/SearchRepository.java b/src/main/java/com/mews/mews_backend/domain/search/repository/SearchRepository.java new file mode 100644 index 0000000..6956d48 --- /dev/null +++ b/src/main/java/com/mews/mews_backend/domain/search/repository/SearchRepository.java @@ -0,0 +1,13 @@ +package com.mews.mews_backend.domain.search.repository; + +import com.mews.mews_backend.domain.calendar.entity.Calendar; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.stereotype.Repository; + + +@Repository +@EnableJpaRepositories +public interface SearchRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/src/main/java/com/mews/mews_backend/domain/search/service/SearchService.java b/src/main/java/com/mews/mews_backend/domain/search/service/SearchService.java new file mode 100644 index 0000000..6df295a --- /dev/null +++ b/src/main/java/com/mews/mews_backend/domain/search/service/SearchService.java @@ -0,0 +1,21 @@ +package com.mews.mews_backend.domain.search.service; + +import com.mews.mews_backend.domain.search.repository.SearchRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.transaction.Transactional; + +@Service +@Transactional +public class SearchService { + + private final SearchRepository searchRepository; + + @Autowired + public SearchService(SearchRepository searchRepository) { + this.searchRepository = searchRepository; + } + + +}