parent
c9e7268d87
commit
a801724b75
@ -0,0 +1,13 @@
|
||||
package cn.teammodel.config.ies;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Getter
|
||||
@Configuration
|
||||
public class IESConfig {
|
||||
@Value("${ies.server-url}")
|
||||
private String serverUrl;
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package cn.teammodel.config.redis;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
|
||||
|
||||
@Bean
|
||||
public LettuceConnectionFactory dbConnectionFactory() {
|
||||
RedisStandaloneConfiguration config = new RedisStandaloneConfiguration("52.130.252.100", 6379);
|
||||
config.setDatabase(8); // 设置数据库编号为8
|
||||
config.setPassword("habook");
|
||||
return new LettuceConnectionFactory(config);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public StringRedisTemplate db1Template(LettuceConnectionFactory dbConnectionFactory) {
|
||||
StringRedisTemplate template = new StringRedisTemplate();
|
||||
template.setConnectionFactory(dbConnectionFactory);
|
||||
template.setKeySerializer(new StringRedisSerializer());
|
||||
template.setValueSerializer(new GenericJackson2JsonRedisSerializer());
|
||||
return template;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.teammodel.controller.admin.controller;
|
||||
|
||||
import cn.teammodel.common.R;
|
||||
import cn.teammodel.test.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class RedisController {
|
||||
|
||||
private final RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
public RedisController(RedisService redisService) {
|
||||
this.redisService = redisService;
|
||||
}
|
||||
@PostMapping("/redis")
|
||||
public Map<Object, Object> getValueByKey(@RequestBody @Valid String key) {
|
||||
Map<Object,Object> juri = redisService.getValueByKey(key);
|
||||
return R.success(juri).getData();
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package cn.teammodel.model.dto.weekDuty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LessonRecordDto {
|
||||
private String code;
|
||||
private String name;
|
||||
private String periodId;
|
||||
private Long startTime;
|
||||
private Long endTime;
|
||||
private String Authorization;
|
||||
private String AuthToken;
|
||||
private String continuationToken;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.teammodel.test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/*@Component
|
||||
public class ConfigCheck implements CommandLineRunner {
|
||||
|
||||
@Value("${spring.redis.host}")
|
||||
private String redisHost;
|
||||
|
||||
@Value("${spring.redis.port}")
|
||||
private int redisPort;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
System.out.println("Redis Host: " + redisHost);
|
||||
System.out.println("Redis Port: " + redisPort);
|
||||
}
|
||||
}*/
|
@ -0,0 +1,30 @@
|
||||
package cn.teammodel.test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class RedisService {
|
||||
|
||||
private final StringRedisTemplate redisTemplate;
|
||||
|
||||
|
||||
@Autowired
|
||||
public RedisService(StringRedisTemplate redisTemplate) {
|
||||
this.redisTemplate = redisTemplate;
|
||||
}
|
||||
|
||||
public void setKeyValue(String key, String value) {
|
||||
//ruredisTemplate.slaveOf();
|
||||
redisTemplate.opsForValue().set(key, value);
|
||||
}
|
||||
|
||||
public Map<Object, Object> getValueByKey(String key) {
|
||||
System.out.println(redisTemplate.opsForHash().values("ArtArea:area:primary"));
|
||||
return redisTemplate.opsForHash().entries("ArtArea:area:junior");
|
||||
}
|
||||
}
|
@ -1,43 +1,57 @@
|
||||
spring:
|
||||
env: dev
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 大小限制
|
||||
max-file-size: 10MB
|
||||
|
||||
cloud:
|
||||
azure:
|
||||
cosmos:
|
||||
endpoint: https://cdhabookdep-free.documents.azure.cn:443
|
||||
database: TEAMModelOS
|
||||
key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==
|
||||
populate-query-metrics: true
|
||||
|
||||
security:
|
||||
oauth2:
|
||||
resourceserver:
|
||||
jwt:
|
||||
issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0
|
||||
audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5
|
||||
|
||||
spark:
|
||||
gpt:
|
||||
endpoint: https://spark-api.xf-yun.com/v3.1/chat
|
||||
appId: c49d1e24
|
||||
apiKey: 6c586e7dd1721ed1bb19bdb573b4ad34
|
||||
apiSecret: MDU1MTU1Nzg4MDg2ZTJjZWU3MmI4ZGU1
|
||||
cache_timeout: 1800000 # 30min
|
||||
cache_context: 3
|
||||
|
||||
|
||||
jwt:
|
||||
secret: fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA=
|
||||
|
||||
# 钉钉 webhook
|
||||
ding:
|
||||
server-url: https://oapi.dingtalk.com/robot/send?access_token=32d9b24f69c2c4fd7c2dab43268b6258a7214d2620e0805d7b6d1429003b64b6
|
||||
spring:
|
||||
# redis:
|
||||
# dabase: 9
|
||||
# host: 52.130.252.100
|
||||
# port: 6379
|
||||
# password: habook
|
||||
# ssl: false
|
||||
# abort_connection: false
|
||||
# write_timeout: 10240
|
||||
|
||||
|
||||
env: dev
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant_path_matcher
|
||||
|
||||
# 文件上传
|
||||
servlet:
|
||||
multipart:
|
||||
# 大小限制
|
||||
max-file-size: 10MB
|
||||
|
||||
cloud:
|
||||
azure:
|
||||
cosmos:
|
||||
endpoint: https://cdhabookdep-free.documents.azure.cn:443
|
||||
database: TEAMModelOS
|
||||
key: JTUVk92Gjsx17L0xqxn0X4wX2thDPMKiw4daeTyV1HzPb6JmBeHdtFY1MF1jdctW1ofgzqkDMFOtcqS46by31A==
|
||||
populate-query-metrics: true
|
||||
|
||||
security:
|
||||
oauth2:
|
||||
resourceserver:
|
||||
jwt:
|
||||
issuer-uri: https://login.partner.microsoftonline.cn/4807e9cf-87b8-4174-aa5b-e76497d7392b/v2.0
|
||||
audiences: 72643704-b2e7-4b26-b881-bd5865e7a7a5
|
||||
|
||||
spark:
|
||||
gpt:
|
||||
endpoint: https://spark-api.xf-yun.com/v3.1/chat
|
||||
appId: c49d1e24
|
||||
apiKey: 6c586e7dd1721ed1bb19bdb573b4ad34
|
||||
apiSecret: MDU1MTU1Nzg4MDg2ZTJjZWU3MmI4ZGU1
|
||||
cache_timeout: 1800000 # 30min
|
||||
cache_context: 3
|
||||
|
||||
|
||||
jwt:
|
||||
secret: fXO6ko/qyXeYrkecPeKdgXnuLXf9vMEtnBC9OB3s+aA=
|
||||
|
||||
|
||||
# 钉钉 webhook
|
||||
ding:
|
||||
server-url: https://oapi.dingtalk.com/robot/send?access_token=32d9b24f69c2c4fd7c2dab43268b6258a7214d2620e0805d7b6d1429003b64b6
|
||||
#IES 课堂记录
|
||||
ies:
|
||||
server-url: https://www.teammodel.cn/common/lesson-record/get-lesson-record
|
Loading…
Reference in new issue