-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor: Clean up Docker, remove Elasticsearch, and fix search functionality. #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4b01e3a
3aec6d5
df265bb
714c8cf
6312610
1a46c4f
0957bf9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| db/ | ||
| docker/db/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,7 @@ out/ | |
| .vscode/ | ||
| .idea | ||
| .env | ||
| /db | ||
| /docker/db | ||
| !/resources/db/*.sql | ||
| mongodb | ||
|
|
||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| version: "3.8" | ||
|
|
||
| services: | ||
| db: | ||
| image: mysql:8.4 | ||
| container_name: db | ||
| platform: linux/amd64 | ||
| environment: | ||
| MYSQL_USER: artrip | ||
| MYSQL_ROOT_PASSWORD: artrip1! | ||
| MYSQL_DATABASE: artrip | ||
| MYSQL_PASSWORD: artrip1! | ||
| ports: | ||
| - "33069:3306" | ||
| volumes: | ||
| - ./db/data:/var/lib/mysql | ||
| - ./db/conf:/etc/mysql/conf.d | ||
|
|
||
| redis: | ||
| image: redis:7.2 | ||
| container_name: redis | ||
| restart: always | ||
| ports: | ||
| - "63799:6379" | ||
| volumes: | ||
| - redis-data:/data | ||
|
|
||
|
|
||
| volumes: | ||
| redis-data: |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package org.atdev.artrip.config; | ||
|
|
||
| import org.modelmapper.ModelMapper; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| @Configuration | ||
| public class ModelMapperConfig { | ||
| @Bean | ||
| public ModelMapper modelMapper() { | ||
| ModelMapper modelMapper = new ModelMapper(); | ||
| modelMapper.getConfiguration() | ||
| .setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE) | ||
| .setFieldMatchingEnabled(true); | ||
|
|
||
| return modelMapper; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| import io.swagger.v3.oas.annotations.Operation; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.atdev.artrip.controller.dto.response.ExhibitDetailResponse; | ||
| import org.atdev.artrip.controller.dto.response.HomeListResponse; | ||
| import org.atdev.artrip.service.ExhibitService; | ||
| import org.atdev.artrip.controller.dto.request.ExhibitFilterRequest; | ||
| import org.atdev.artrip.controller.dto.response.FilterResponse; | ||
|
|
@@ -93,12 +94,12 @@ public ResponseEntity<CommonResponse<List<RegionResponse>>> getDomestic(){ | |
| home = {HomeError._HOME_INVALID_DATE_RANGE, HomeError._HOME_UNRECOGNIZED_REGION, HomeError._HOME_EXHIBIT_NOT_FOUND} | ||
| ) | ||
| @PostMapping("/filter") | ||
|
||
| public ResponseEntity<FilterResponse> getDomesticFilter(@RequestBody ExhibitFilterRequest dto, | ||
| @RequestParam(required = false) Long cursor, | ||
| @RequestParam(defaultValue = "20") Long size, | ||
| @AuthenticationPrincipal UserDetails userDetails) { | ||
| public ResponseEntity<FilterResponse<HomeListResponse>> getDomesticFilter(@RequestBody ExhibitFilterRequest dto, | ||
|
||
| @RequestParam(required = false) Long cursor, | ||
| @RequestParam(defaultValue = "20") Long size, | ||
| @AuthenticationPrincipal UserDetails userDetails) { | ||
| Long userId = getUserId(userDetails); | ||
|
||
| FilterResponse exhibits = homeService.getFilterExhibit(dto, size, cursor,userId); | ||
| FilterResponse<HomeListResponse> exhibits = homeService.getFilterExhibit(dto, size, cursor,userId); | ||
|
||
|
|
||
| return ResponseEntity.ok(exhibits); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ModelMapper의 필요성이 느껴진 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convter는 전에 말씀주신대로 컨버터를 작성하신분만 사용가능하기 떄문에 재사용이 어렵다고 생각되었습니다.
또한, 하나씩 모든 객체를 매핑하기 위해서 작성하는것 보다 DTO에서 entity로 변환할 수 있는 ModelMapper를 사용하는것이 생산성을 높일 수 있다고 생각했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entity->(service layer) dto->(presentation layer) dto과정에서 ModelMapper가 굳이 필요하진 않을 것 같다고는 생각합니다.그 이유는 저희 프로젝트에서 복잡한 매핑을 맺는 부분은 없어보이고 ModelMapper 라이브러리를 사용할만한 곳이 보이지 않았기 때문인데 매핑 관계가 복잡한 테이블 예시가 있으시다면 사용해도 될 것 같습니다만 그게 아니라면 DTO 간에 변환으로만으로도 충분히 커버가 가능할 것 같은데 좋은 고민이었습니다. 같이 고민을 좀 해보시죠.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우선 지금 사용하는곳이 없어서 제외했습니다.
추후 필요하게되면 다시 추가 하겠습니다!