error fix

This commit is contained in:
seoeun 2025-06-11 13:46:58 +09:00
parent 38af15a3fd
commit 9182933fe6
3 changed files with 9 additions and 59 deletions

View File

@ -37,7 +37,10 @@ subprojects {
implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3' implementation 'io.jsonwebtoken:jjwt-jackson:0.12.3'
compileOnly 'org.projectlombok:lombok' compileOnly 'org.projectlombok:lombok'
annotationProcessor '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.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test' testImplementation 'org.springframework.security:spring-security-test'
} }

View File

@ -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<String, String>
*/
@Bean
public RedisTemplate<String, String> redisTemplate() {
RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory());
// 직렬화 설정
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new StringRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new StringRedisSerializer());
return redisTemplate;
}
}

View File

@ -5,17 +5,17 @@ spring:
application: application:
name: member-service name: member-service
datasource: datasource:
url: ${DB_URL:jdbc:mysql://localhost:3306/smarketing_member} url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:MemberDB}
username: ${DB_USERNAME:root} username: ${POSTGRES_USER:postgres}
password: ${DB_PASSWORD:password} password: ${POSTGRES_PASSWORD:postgres}
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: org.postgresql.Driver
jpa: jpa:
hibernate: hibernate:
ddl-auto: ${DDL_AUTO:update} ddl-auto: ${DDL_AUTO:update}
show-sql: ${SHOW_SQL:true} show-sql: ${SHOW_SQL:true}
properties: properties:
hibernate: hibernate:
dialect: org.hibernate.dialect.MySQLDialect dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true format_sql: true
data: data:
redis: redis: