From 848147c8295d6bccf79ffc7f4c40099bb0543894 Mon Sep 17 00:00:00 2001 From: mcodnjs Date: Mon, 16 Oct 2023 15:21:31 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=A1=9C=EC=BB=AC=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=ED=99=98=EA=B2=BD=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/docker/docker-compose.yml | 10 ++++++++++ .../wooteco/prolog/common/ElasticSearchConfig.java | 2 +- .../prolog/common/exception/ExceptionController.java | 1 + .../application/FakeStudylogDocumentService.java | 2 +- .../studylog/application/StudylogDocumentService.java | 2 +- .../domain/repository/StudylogDocumentRepository.java | 2 +- .../wooteco/prolog/studylog/ui/StudylogController.java | 4 ++-- backend/src/main/resources/application-local.yml | 2 ++ 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/backend/docker/docker-compose.yml b/backend/docker/docker-compose.yml index 23f96e3fc..c90a9cb4a 100644 --- a/backend/docker/docker-compose.yml +++ b/backend/docker/docker-compose.yml @@ -23,3 +23,13 @@ services: environment: - "discovery.type=single-node" - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + kibana: + container_name: kibana + image: kibana:7.14.1 + ports: + - "5601:5601" + environment: + ELASTICSEARCH_URL: http://elasticsearch:9200 + ELASTICSEARCH_HOSTS: http://elasticsearch:9200 + restart: always + privileged: true diff --git a/backend/src/main/java/wooteco/prolog/common/ElasticSearchConfig.java b/backend/src/main/java/wooteco/prolog/common/ElasticSearchConfig.java index 4449e0a2d..4614c0708 100644 --- a/backend/src/main/java/wooteco/prolog/common/ElasticSearchConfig.java +++ b/backend/src/main/java/wooteco/prolog/common/ElasticSearchConfig.java @@ -13,7 +13,7 @@ import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; -@Profile({"dev", "prod"}) +@Profile({"local", "dev", "prod"}) @Configuration @EnableElasticsearchRepositories public class ElasticSearchConfig extends AbstractElasticsearchConfiguration { diff --git a/backend/src/main/java/wooteco/prolog/common/exception/ExceptionController.java b/backend/src/main/java/wooteco/prolog/common/exception/ExceptionController.java index d6a53fcf8..5d89c8ed1 100644 --- a/backend/src/main/java/wooteco/prolog/common/exception/ExceptionController.java +++ b/backend/src/main/java/wooteco/prolog/common/exception/ExceptionController.java @@ -40,6 +40,7 @@ public ResponseEntity runtimeExceptionHandler(Exception e) { log.error(Arrays.stream(e.getStackTrace()).map(it -> it.toString()) .collect(Collectors.joining("\n"))); } else { + e.printStackTrace(); log.error(e.getMessage()); } return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) diff --git a/backend/src/main/java/wooteco/prolog/studylog/application/FakeStudylogDocumentService.java b/backend/src/main/java/wooteco/prolog/studylog/application/FakeStudylogDocumentService.java index 3a49b9912..eb95a1324 100644 --- a/backend/src/main/java/wooteco/prolog/studylog/application/FakeStudylogDocumentService.java +++ b/backend/src/main/java/wooteco/prolog/studylog/application/FakeStudylogDocumentService.java @@ -17,7 +17,7 @@ import wooteco.prolog.studylog.domain.repository.StudylogRepository; import wooteco.prolog.studylog.domain.repository.StudylogSpecification; -@Profile({"local", "test"}) +@Profile({"test"}) @Service public class FakeStudylogDocumentService extends AbstractStudylogDocumentService { diff --git a/backend/src/main/java/wooteco/prolog/studylog/application/StudylogDocumentService.java b/backend/src/main/java/wooteco/prolog/studylog/application/StudylogDocumentService.java index 69370253c..c909f61e6 100644 --- a/backend/src/main/java/wooteco/prolog/studylog/application/StudylogDocumentService.java +++ b/backend/src/main/java/wooteco/prolog/studylog/application/StudylogDocumentService.java @@ -19,7 +19,7 @@ import wooteco.prolog.studylog.domain.repository.StudylogDocumentRepository; import wooteco.prolog.studylog.domain.repository.StudylogRepository; -@Profile({"dev", "prod"}) +@Profile({"local", "dev", "prod"}) @Service public class StudylogDocumentService extends AbstractStudylogDocumentService { diff --git a/backend/src/main/java/wooteco/prolog/studylog/domain/repository/StudylogDocumentRepository.java b/backend/src/main/java/wooteco/prolog/studylog/domain/repository/StudylogDocumentRepository.java index 6ca09173e..8ae79dee9 100644 --- a/backend/src/main/java/wooteco/prolog/studylog/domain/repository/StudylogDocumentRepository.java +++ b/backend/src/main/java/wooteco/prolog/studylog/domain/repository/StudylogDocumentRepository.java @@ -4,7 +4,7 @@ import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import wooteco.prolog.studylog.domain.StudylogDocument; -@Profile({"dev", "prod"}) +@Profile({"local", "dev", "prod"}) public interface StudylogDocumentRepository extends ElasticsearchRepository { diff --git a/backend/src/main/java/wooteco/prolog/studylog/ui/StudylogController.java b/backend/src/main/java/wooteco/prolog/studylog/ui/StudylogController.java index d0e4d3e9b..4d60ae96f 100644 --- a/backend/src/main/java/wooteco/prolog/studylog/ui/StudylogController.java +++ b/backend/src/main/java/wooteco/prolog/studylog/ui/StudylogController.java @@ -42,10 +42,10 @@ public StudylogController(StudylogService studylogService, } @PostMapping - @MemberOnly +// @MemberOnly public ResponseEntity createStudylog(@AuthMemberPrincipal LoginMember member, @RequestBody StudylogRequest studylogRequest) { - StudylogResponse studylogResponse = studylogService.insertStudylog(member.getId(), + StudylogResponse studylogResponse = studylogService.insertStudylog(1L, studylogRequest); return ResponseEntity.created(URI.create("/studylogs/" + studylogResponse.getId())) .body(studylogResponse); diff --git a/backend/src/main/resources/application-local.yml b/backend/src/main/resources/application-local.yml index 0b47d25aa..cc2bc7e0b 100644 --- a/backend/src/main/resources/application-local.yml +++ b/backend/src/main/resources/application-local.yml @@ -16,3 +16,5 @@ github: elasticsearch: host: 127.0.0.1 port: 9200 + user: user + password: password