diff --git a/build.gradle b/build.gradle index 976019c..598ea7d 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,10 @@ subprojects { implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' - runtimeOnly 'com.mysql:mysql-connector-j' + + // PostgreSQL (운영용) + runtimeOnly 'org.postgresql:postgresql:42.7.1' + testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.security:spring-security-test' } diff --git a/member/src/main/java/com/won/smarketing/member/config/RedisConfig.java b/member/src/main/java/com/won/smarketing/member/config/RedisConfig.java deleted file mode 100644 index 045285b..0000000 --- a/member/src/main/java/com/won/smarketing/member/config/RedisConfig.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.won.smarketing.member.config; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -/** - * Redis 설정 클래스 - * Redis 연결 및 RedisTemplate 설정 - */ -@Configuration -public class RedisConfig { - - @Value("${spring.data.redis.host}") - private String redisHost; - - @Value("${spring.data.redis.port}") - private int redisPort; - - /** - * Redis 연결 팩토리 설정 - * - * @return RedisConnectionFactory - */ - @Bean - public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(redisHost, redisPort); - } - - /** - * RedisTemplate 설정 - * - * @return RedisTemplate - */ - @Bean - public RedisTemplate redisTemplate() { - RedisTemplate redisTemplate = new RedisTemplate<>(); - redisTemplate.setConnectionFactory(redisConnectionFactory()); - - // 직렬화 설정 - redisTemplate.setKeySerializer(new StringRedisSerializer()); - redisTemplate.setValueSerializer(new StringRedisSerializer()); - redisTemplate.setHashKeySerializer(new StringRedisSerializer()); - redisTemplate.setHashValueSerializer(new StringRedisSerializer()); - - return redisTemplate; - } -} - diff --git a/member/src/main/resources/application.yml b/member/src/main/resources/application.yml index 83ad594..c93fb60 100644 --- a/member/src/main/resources/application.yml +++ b/member/src/main/resources/application.yml @@ -5,17 +5,17 @@ spring: application: name: member-service datasource: - url: ${DB_URL:jdbc:mysql://localhost:3306/smarketing_member} - username: ${DB_USERNAME:root} - password: ${DB_PASSWORD:password} - driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:MemberDB} + username: ${POSTGRES_USER:postgres} + password: ${POSTGRES_PASSWORD:postgres} + driver-class-name: org.postgresql.Driver jpa: hibernate: ddl-auto: ${DDL_AUTO:update} show-sql: ${SHOW_SQL:true} properties: hibernate: - dialect: org.hibernate.dialect.MySQLDialect + dialect: org.hibernate.dialect.PostgreSQLDialect format_sql: true data: redis: