Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Database Configuration
DB_HOST=
DB_PORT=
DB_NAME=
DB_USERNAME=
DB_PASSWORD=

# Spring Profile
SPRING_PROFILES_ACTIVE=

# OAuth - Kakao
KAKAO_CLIENT_ID=
KAKAO_CLIENT_SECRET=
KAKAO_REDIRECT_URI=
KAKAO_NATIVE_CLIENT_ID=

# OAuth - Google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=
GOOGLE_AOD_CLIENT_ID=

# JWT
JWT_ISSUER=
JWT_SECRET=
JWT_ACCESS_EXPIRATION=
JWT_REFRESH_EXPIRATION=

# AWS S3 Configuration
AWS_S3_BUCKET_NAME=
AWS_S3_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_CLOUDFRONT_DOMAIN=
RESIZE_SECRET_KEY=

# Public Data Service Key
K_CULTURAL_INFO_CENTER_KEY=

# FCM
FIREBASE_CONFIG_PATH=
10 changes: 1 addition & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ out/
/db
!/resources/db/*.sql
mongodb
/src/main/resources/application.yml
/src/main/resources/application-dev.yml
/src/main/resources/application-stage.yml
/src/main/resources/application-prod.yml

.DS_Store
elasticsearch/
.cursorrules
application-stageing.yml
application-stage.yml
application-production.yml
application-prod.yml
application-local.yml
!/docker/elasticsearch
/src/main/resources/firebase/

Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies {
implementation 'io.github.resilience4j:resilience4j-spring-boot3:2.2.0'
implementation 'io.github.resilience4j:resilience4j-reactor:2.2.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
implementation 'io.github.cdimascio:java-dotenv:5.2.2'

implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'

Expand Down
80 changes: 0 additions & 80 deletions docker-compose.override.yml

This file was deleted.

50 changes: 0 additions & 50 deletions docker-compose.prod.yml

This file was deleted.

51 changes: 0 additions & 51 deletions docker-compose.stage.yml

This file was deleted.

51 changes: 47 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,50 @@
version: "3.8"

services:
app:
build:
context: .
dockerfile: docker/Dockerfile
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

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: elastic
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- ES_JAVA_OPTS=-Xms1g -Xmx1g
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./elasticsearch/data:/usr/share/elasticsearch/data
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9200/_cluster/health" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
Comment on lines +28 to +46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ElasticSearch를 사용하는 기능을 대체하면 이 부분은 지우면 될 것 같아요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 한번에 다 수정하기에는 양이 많아서 나눠서 진행 하겠습니다.



volumes:
redis-data:
9 changes: 0 additions & 9 deletions docker/elasticsearch/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
@Configuration
public class ElasticsearchConfig {

@Value("${spring.elasticsearch.uris}")
private String elasticsearchUris;

@Bean
public RestClient restClient() {
return RestClient.builder(HttpHost.create(elasticsearchUris)).build();
return RestClient.builder(new HttpHost("localhost", 9200)).build();
}

@Bean
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/atdev/artrip/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import lombok.RequiredArgsConstructor;
import org.atdev.artrip.service.CustomOAuth2UserService;
import org.atdev.artrip.security.OAuth2LoginSuccessHandler;
import org.atdev.artrip.jwt.jwt.JwtAuthenticationFilter;
import org.atdev.artrip.jwt.jwt.JwtProvider;
import org.atdev.artrip.jwt.jwt.exception.JwtExceptionFilter;
import org.atdev.artrip.jwt.JwtAuthenticationFilter;
import org.atdev.artrip.jwt.JwtProvider;
import org.atdev.artrip.jwt.exception.JwtExceptionFilter;
Comment on lines -7 to +9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import org.atdev.artrip.global.apipayload.exception.handler.JwtAccessDeniedHandler;
import org.atdev.artrip.global.apipayload.exception.handler.JwtAuthenticationEntryPoint;
import org.springframework.context.annotation.Bean;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/atdev/artrip/domain/curation/Curation.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public class Curation {
@Column(name = "curation_type", nullable = false)
private CurationType curationType;

@Builder.Default

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder 패턴과 정적 팩토리 메서드 패턴 둘 중 어느 것이 좋은지 객체 사용 패턴을 보고 고민해주세요.

Copy link
Collaborator Author

@08166 08166 Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

두 패턴을 같이 사용하는 경우도 있는지 궁굼합니다. 가능 하다면 댓글 달아주신 부분과 같은 현상이 있다면 정적메서드 패턴으로 사용하며, 두 패턴을 동시에 사용하지 못한다면 정적메서드 패턴으로 사용을 지향하고싶습니다.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Builder.Default는 빌더 패턴 사용 시에만 기본값으로 적용이 됨을 말해요.

클래스 단에 빌더를 명시하면 다른 개발자가 일관성없이 아무런 객체들을 만들게 될거구요.

네이밍을 주고 싶고 명확하게한다면 정적 팩토리 메서드가 권장됩니다. 다만 정적 팩토리 메서드도 단점이 있으니 이 부분은 확인해보시면 좋을 것 같아요.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

큐레이션 생성시 isActive가 동일한 초기 값을 가져야하고 생성에 필요한 파라미터가 많지 않다면 정적 팩토리 메서드도 적절해 보입니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Builder.Default 관련하여 큐레이션 뿐만 아닌 다른 코드들도 확인 후 수정은 새로운 이슈 생성해서 작업 하도록하겠습니다!

@Column(name = "is_active")
private boolean isActive = true;

@Builder.Default
@ManyToMany
@JoinTable(
name = "curation_exhibit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void createAndApplyIndex() {
)
.analyzer("ngram_nori_analyzer", an -> an
.custom(ca -> ca
.tokenizer("nori_tokenizer")
.tokenizer("standard")
.filter("lowercase", "ngram_filter")
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/atdev/artrip/jwt/JwtGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import org.atdev.artrip.domain.Enum.Role;
import org.atdev.artrip.domain.auth.data.User;
import org.atdev.artrip.constants.Role;
import org.atdev.artrip.domain.auth.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import org.atdev.artrip.constants.SortType;
import org.atdev.artrip.constants.Status;
import org.atdev.artrip.domain.exhibit.Exhibit;
import org.atdev.artrip.domain.exhibit.data.QExhibit;
import org.atdev.artrip.domain.exhibit.QExhibit;
import org.atdev.artrip.controller.dto.request.ExhibitFilterRequest;
import org.atdev.artrip.domain.exhibitHall.data.QExhibitHall;
import org.atdev.artrip.domain.exhibitHall.QExhibitHall;
import org.atdev.artrip.controller.dto.response.HomeListResponse;
import org.atdev.artrip.controller.dto.request.RandomExhibitRequest;
import org.atdev.artrip.domain.keyword.data.QKeyword;
import org.atdev.artrip.domain.keyword.QKeyword;
import org.springframework.data.domain.*;
import org.springframework.stereotype.Repository;

Expand Down
Loading