11111
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package com.example.caseData.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
@Component
|
||||
@Getter
|
||||
public class RedisConfig {
|
||||
@Value("${spring.redis.dev.host}")
|
||||
private String devHost;
|
||||
|
||||
@Value("${spring.redis.dev.port}")
|
||||
private int devPort;
|
||||
|
||||
@Value("${spring.redis.dev.password}")
|
||||
private String devPassword;
|
||||
|
||||
@Value("${spring.redis.dev.database}")
|
||||
private String devDatabase;
|
||||
|
||||
@Value("${spring.redis.prod.host}")
|
||||
private String prodHost;
|
||||
|
||||
@Value("${spring.redis.prod.port}")
|
||||
private int prodPort;
|
||||
|
||||
@Value("${spring.redis.prod.password}")
|
||||
private String prodPassword;
|
||||
|
||||
@Value("${spring.redis.prod.database}")
|
||||
private String prodDatabase;
|
||||
}
|
||||
+12
-1
@@ -1,14 +1,25 @@
|
||||
package com.example.caseData.core;
|
||||
|
||||
import com.example.caseData.config.RedisConfig;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
public class RedisConfiguration {
|
||||
// private final RedisConfig redisConfig; // 自动注入你的配置类
|
||||
//
|
||||
// public RedisConfiguration(RedisConfig redisConfig) {
|
||||
// this.redisConfig = redisConfig;
|
||||
// }
|
||||
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>();
|
||||
@@ -10,6 +10,6 @@ import lombok.Data;
|
||||
public class GetOssSignRequest {
|
||||
@NotNull(message = "错误请求")
|
||||
@Min(value = 1, message = "错误请求")
|
||||
@Max(value = 1, message = "错误请求")
|
||||
private String scene;
|
||||
@Max(value = 2, message = "错误请求")
|
||||
private int scene;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user