Browse Source

腾讯云配置文件改造

wangliang 2 năm trước cách đây
mục cha
commit
5e3dc37c9e
19 tập tin đã thay đổi với 200 bổ sung284 xóa
  1. 1 1
      themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java
  2. 2 2
      themis-admin/src/main/java/com/qmth/themis/admin/api/TENotifyController.java
  3. 2 6
      themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateCallMobileController.java
  4. 0 11
      themis-admin/src/main/java/com/qmth/themis/admin/config/DictionaryConfig.java
  5. 1 2
      themis-admin/src/main/java/com/qmth/themis/admin/interceptor/AuthInterceptor.java
  6. 1 2
      themis-admin/src/main/java/com/qmth/themis/admin/interceptor/AuthThirdInterceptor.java
  7. 0 14
      themis-admin/src/main/resources/application.properties
  8. 13 0
      themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java
  9. 0 153
      themis-business/src/main/java/com/qmth/themis/business/domain/TencentYunDomain.java
  10. 5 5
      themis-business/src/main/java/com/qmth/themis/business/service/impl/CommonServiceImpl.java
  11. 9 9
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java
  12. 1 1
      themis-business/src/main/java/com/qmth/themis/business/service/impl/TEMobileServiceImpl.java
  13. 1 1
      themis-business/src/main/java/com/qmth/themis/business/util/MqUtil.java
  14. 162 25
      themis-business/src/main/java/com/qmth/themis/business/util/TencentYunUtil.java
  15. 0 11
      themis-exam/src/main/java/com/qmth/themis/exam/config/DictionaryConfig.java
  16. 1 1
      themis-exam/src/main/java/com/qmth/themis/exam/interceptor/AuthInterceptor.java
  17. 0 14
      themis-exam/src/main/resources/application.properties
  18. 0 11
      themis-task/src/main/java/com/qmth/themis/task/config/DictionaryConfig.java
  19. 1 15
      themis-task/src/main/resources/application.properties

+ 1 - 1
themis-admin/src/main/java/com/qmth/themis/admin/api/SysController.java

@@ -454,7 +454,7 @@ public class SysController {
     @RequestMapping(value = "/getPlayUrls", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "播放域接口", response = Result.class)})
     public Result getPlayUrls() {
-        return ResultUtil.ok(dictionaryConfig.tencentYunDomain().getUrls());
+        return ResultUtil.ok(tencentYunUtil.getUrls());
     }
 
     @ApiOperation(value = "查询已监考结束的考试批次接口")

+ 2 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/TENotifyController.java

@@ -84,7 +84,7 @@ public class TENotifyController {
     @Transactional
     public Result tencentCallback(@ApiParam(value = "腾讯云视频接口回调信息", required = true) @RequestBody JSONObject jsonObject) throws NoSuchAlgorithmException {
         log.info("腾讯云视频接口回调 jsonObject:{}", jsonObject.toJSONString());
-        String callbackPwd = tencentYunUtil.getTencentYunDomain().getCallbackPwd();
+        String callbackPwd = tencentYunUtil.getCallbackPwd();
         Optional.ofNullable(callbackPwd).orElseThrow(() -> new BusinessException("配置文件回调密码为空"));
 
         String sign = (String) jsonObject.get("sign");
@@ -126,7 +126,7 @@ public class TENotifyController {
     @ApiResponses({@ApiResponse(code = 200, message = "结果信息")})
     public Result tencentEventCallback(@ApiParam(value = "腾讯云事件接口回调信息", required = true) @RequestBody String string) throws Exception {
         log.info("腾讯云状态事件接口回调 string:{}", string);
-        String callbackPwd = tencentYunUtil.getTencentYunDomain().getCallbackPwd();
+        String callbackPwd = tencentYunUtil.getCallbackPwd();
         Optional.ofNullable(callbackPwd).orElseThrow(() -> new BusinessException("配置文件回调密码为空"));
 
         String sign = ServletUtil.getRequestSign();

+ 2 - 6
themis-admin/src/main/java/com/qmth/themis/admin/api/TIeInvigilateCallMobileController.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Sets;
-import com.qmth.themis.admin.config.DictionaryConfig;
 import com.qmth.themis.business.annotation.ApiJsonObject;
 import com.qmth.themis.business.annotation.ApiJsonProperty;
 import com.qmth.themis.business.bean.mobile.MobileAuthorizationMonitorBean;
@@ -68,9 +67,6 @@ public class TIeInvigilateCallMobileController {
     @Resource
     OssUtil ossUtil;
 
-    @Resource
-    DictionaryConfig dictionaryConfig;
-
     @Resource
     TOeExamRecordService tOeExamRecordService;
 
@@ -312,8 +308,8 @@ public class TIeInvigilateCallMobileController {
         map.put("monitorUserId", monitorUserId);
         map.put("sourceUserId", sourceUserId);
         map.put("monitorUserSig", monitorUserSig);
-        map.put("appId", dictionaryConfig.tencentYunDomain().getAppId());
-        map.put("key", dictionaryConfig.tencentYunDomain().getKey());
+        map.put("appId", tencentYunUtil.getAppId());
+        map.put("key", tencentYunUtil.getKey());
         return ResultUtil.ok(map);
     }
 

+ 0 - 11
themis-admin/src/main/java/com/qmth/themis/admin/config/DictionaryConfig.java

@@ -36,15 +36,4 @@ public class DictionaryConfig {
     public AliYunOssDomain aliYunOssDomain() {
         return new AliYunOssDomain();
     }
-
-    /**
-     * 腾讯云配置
-     *
-     * @return
-     */
-    @Bean
-    @ConfigurationProperties(prefix = "tencentyun.sdk", ignoreUnknownFields = false)
-    public TencentYunDomain tencentYunDomain() {
-        return new TencentYunDomain();
-    }
 }

+ 1 - 2
themis-admin/src/main/java/com/qmth/themis/admin/interceptor/AuthInterceptor.java

@@ -1,6 +1,5 @@
 package com.qmth.themis.admin.interceptor;
 
-import com.qmth.themis.admin.config.DictionaryConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.entity.SysConfig;
 import com.qmth.themis.business.service.CacheService;
@@ -48,7 +47,7 @@ public class AuthInterceptor implements HandlerInterceptor {
         Long time = ServletUtil.getRequestTime();
         log.info("Start authorization: url:{}, method:{}, platform:{}, deviceId:{}, authorization:{}, time:{}", url,
                 method, platform, deviceId, authorization, time);
-        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.ADMIN_NO_AUTH_URLS);
+        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.ADMIN_COMMON_SYSTEM_URLS);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("未配置admin无需鉴权的url"));
         return AuthUtil.adminAuthInterceptor(platform, deviceId, authorization, time, Arrays.asList(StringUtils.split(sysConfig.getConfigValue(), ",")), request, response);
     }

+ 1 - 2
themis-admin/src/main/java/com/qmth/themis/admin/interceptor/AuthThirdInterceptor.java

@@ -1,6 +1,5 @@
 package com.qmth.themis.admin.interceptor;
 
-import com.qmth.themis.admin.config.DictionaryConfig;
 import com.qmth.themis.business.constant.SystemConstant;
 import com.qmth.themis.business.entity.SysConfig;
 import com.qmth.themis.business.service.CacheService;
@@ -48,7 +47,7 @@ public class AuthThirdInterceptor implements HandlerInterceptor {
         Long time = ServletUtil.getRequestTime();
         log.info("Start authorization: url:{}, method:{}, platform:{}, deviceId:{}, authorization:{}, time:{}", url,
                 method, platform, deviceId, authorization, time);
-        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.ADMIN_NO_AUTH_URLS);
+        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.ADMIN_COMMON_SYSTEM_URLS);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("未配置admin无需鉴权的url"));
         return AuthUtil.adminAuthInterceptor(platform, deviceId, authorization, time, Arrays.asList(StringUtils.split(sysConfig.getConfigValue(), ",")), request, response);
     }

+ 0 - 14
themis-admin/src/main/resources/application.properties

@@ -132,20 +132,6 @@ aliyun.oss.privateAccessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
 aliyun.oss.privateBucket=qmth-test
 aliyun.oss.privateUrl=http://static-test.qmth.com.cn
 
-#\u817E\u8BAF\u4E91\u914D\u7F6E
-tencentyun.sdk.appId=1400411036
-tencentyun.sdk.key=d78004c94473cb1cf78af33d333e18b731132e527e829e44e2ab133945243b11
-tencentyun.sdk.urls=https://live1.qmth.com.cn,https://live2.qmth.com.cn,https://live3.qmth.com.cn,https://live4.qmth.com.cn,https://live5.qmth.com.cn,https://live6.qmth.com.cn
-tencentyun.sdk.service=vod
-tencentyun.sdk.queryUrl=${tencentyun.sdk.service}.tencentcloudapi.com
-tencentyun.sdk.secretId=AKIDKUO2PVLuCDxQcW9VaOuA8pFOGq9BwQdZ
-tencentyun.sdk.secretKey=g5D4dwxhByXrvjGWVDfqkPqzrSmqd9OM
-tencentyun.sdk.vodAppId=1500002365
-tencentyun.sdk.callbackPwd=123456
-tencentyun.sdk.callbackTime=2m
-tencentyun.sdk.trtcQueryUrl=trtc.tencentcloudapi.com
-tencentyun.sdk.trtcRegion=ap-guangzhou
-
 #\u7CFB\u7EDF\u914D\u7F6E
 sys.config.datacenterId=1
 sys.config.oss=true

+ 13 - 0
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -94,6 +94,19 @@ public class SystemConstant {
     public static final String EXAM_NO_AUTH_URLS = "exam.no.auth.urls";
     public static final String EXAM_COMMON_SYSTEM_URLS = "exam.common.system.urls";
 
+    public static final String TENCENT_CLOUD_SDK_APPID = "tencentcloud.sdk.appId";
+    public static final String TENCENT_CLOUD_SDK_KEY = "tencentcloud.sdk.key";
+    public static final String TENCENT_CLOUD_SDK_URLS = "tencentcloud.sdk.urls";
+    public static final String TENCENT_CLOUD_SDK_SERVICE = "tencentcloud.sdk.service";
+    public static final String TENCENT_CLOUD_SDK_QUERY_URL = "tencentcloud.sdk.queryUrl";
+    public static final String TENCENT_CLOUD_SDK_SECRET_ID = "tencentcloud.sdk.secretId";
+    public static final String TENCENT_CLOUD_SDK_SECRET_KEY = "tencentcloud.sdk.secretKey";
+    public static final String TENCENT_CLOUD_SDK_VOD_APP_ID = "tencentcloud.sdk.vodAppId";
+    public static final String TENCENT_CLOUD_SDK_CALLBACK_PWD = "tencentcloud.sdk.callbackPwd";
+    public static final String TENCENT_CLOUD_SDK_CALLBACK_TIME = "tencentcloud.sdk.callbackTime";
+    public static final String TENCENT_CLOUD_SDK_TRTC_QUERY_URL = "tencentcloud.sdk.trtcQueryUrl";
+    public static final String TENCENT_CLOUD_SDK_TRTC_REGION = "tencentcloud.sdk.trtcRegion";
+
     public static final String DATE_TIME_FORMAT = "%02d";
 
     public static final String TEMP = "temp";

+ 0 - 153
themis-business/src/main/java/com/qmth/themis/business/domain/TencentYunDomain.java

@@ -1,153 +0,0 @@
-package com.qmth.themis.business.domain;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @Description: 腾讯云 domain
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/8/21
- */
-public class TencentYunDomain implements Serializable {
-
-    private String appId;
-    private String key;
-    private List<String> urls;
-    private String queryUrl;
-    private String service;
-    private String secretId;
-    private String secretKey;
-    private Long vodAppId;
-    private String callbackPwd;
-    private String callbackTime;
-    private String trtcQueryUrl;
-    private String trtcRegion;
-
-    public TencentYunDomain() {
-
-    }
-
-    public TencentYunDomain(String appId,
-                            String key,
-                            List<String> urls,
-                            String queryUrl,
-                            String service,
-                            String secretId,
-                            String secretKey,
-                            Long vodAppId,
-                            String callbackPwd,
-                            String callbackTime,
-                            String trtcQueryUrl,
-                            String trtcRegion) {
-        this.appId = appId;
-        this.key = key;
-        this.urls = urls;
-        this.queryUrl = queryUrl;
-        this.service = service;
-        this.secretId = secretId;
-        this.secretKey = secretKey;
-        this.vodAppId = vodAppId;
-        this.callbackPwd = callbackPwd;
-        this.callbackTime = callbackTime;
-        this.trtcQueryUrl = trtcQueryUrl;
-        this.trtcRegion = trtcRegion;
-    }
-
-    public String getTrtcRegion() {
-        return trtcRegion;
-    }
-
-    public void setTrtcRegion(String trtcRegion) {
-        this.trtcRegion = trtcRegion;
-    }
-
-    public String getTrtcQueryUrl() {
-        return trtcQueryUrl;
-    }
-
-    public void setTrtcQueryUrl(String trtcQueryUrl) {
-        this.trtcQueryUrl = trtcQueryUrl;
-    }
-
-    public String getCallbackTime() {
-        return callbackTime;
-    }
-
-    public void setCallbackTime(String callbackTime) {
-        this.callbackTime = callbackTime;
-    }
-
-    public String getCallbackPwd() {
-        return callbackPwd;
-    }
-
-    public void setCallbackPwd(String callbackPwd) {
-        this.callbackPwd = callbackPwd;
-    }
-
-    public Long getVodAppId() {
-        return vodAppId;
-    }
-
-    public void setVodAppId(Long vodAppId) {
-        this.vodAppId = vodAppId;
-    }
-
-    public String getService() {
-        return service;
-    }
-
-    public void setService(String service) {
-        this.service = service;
-    }
-
-    public String getSecretId() {
-        return secretId;
-    }
-
-    public void setSecretId(String secretId) {
-        this.secretId = secretId;
-    }
-
-    public String getSecretKey() {
-        return secretKey;
-    }
-
-    public void setSecretKey(String secretKey) {
-        this.secretKey = secretKey;
-    }
-
-    public String getQueryUrl() {
-        return queryUrl;
-    }
-
-    public void setQueryUrl(String queryUrl) {
-        this.queryUrl = queryUrl;
-    }
-
-    public List<String> getUrls() {
-        return urls;
-    }
-
-    public void setUrls(List<String> urls) {
-        this.urls = urls;
-    }
-
-    public String getAppId() {
-        return appId;
-    }
-
-    public void setAppId(String appId) {
-        this.appId = appId;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-}

+ 5 - 5
themis-business/src/main/java/com/qmth/themis/business/service/impl/CommonServiceImpl.java

@@ -147,11 +147,11 @@ public class CommonServiceImpl implements CommonService {
     @Override
     public void DismissRoomByStrRoomId(Long recordId) {
         try {
-            tencentYunUtil.DismissRoomByStrRoomId(tencentYunUtil.getTencentYunDomain().getSecretId(),
-                    tencentYunUtil.getTencentYunDomain().getSecretKey(),
-                    tencentYunUtil.getTencentYunDomain().getTrtcQueryUrl(),
-                    tencentYunUtil.getTencentYunDomain().getTrtcRegion(),
-                    Long.parseLong(tencentYunUtil.getTencentYunDomain().getAppId()),
+            tencentYunUtil.DismissRoomByStrRoomId(tencentYunUtil.getSecretId(),
+                    tencentYunUtil.getSecretKey(),
+                    tencentYunUtil.getTrtcQueryUrl(),
+                    tencentYunUtil.getTrtcRegion(),
+                    Long.parseLong(tencentYunUtil.getAppId()),
                     String.valueOf(recordId));
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);

+ 9 - 9
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -273,7 +273,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                         (ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true),
                         ep.getAudioPlayCount(), ExamRecordCacheUtil.getMonitorKey(recordId), monitorUserId,
                         tencentYunUtil.getSign(monitorUserId, SystemConstant.TENCENT_EXPIRE_TIME),
-                        tencentYunUtil.getTencentYunDomain().getAppId());
+                        tencentYunUtil.getAppId());
                 ExamRecordStatusEnum statusEnum = ExamRecordCacheUtil.getStatus(recordId);
                 boolean cache = false;
                 if (Objects.nonNull(statusEnum) && !Objects.equals(statusEnum, ExamRecordStatusEnum.RESUME_PREPARE)) {
@@ -351,7 +351,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
                 (ep.getHasAudio() == null || ep.getHasAudio().intValue() == 0 ? false : true), ep.getAudioPlayCount(),
                 ExamRecordCacheUtil.getMonitorKey(recordId), monitorUserId,
                 tencentYunUtil.getSign(monitorUserId, SystemConstant.TENCENT_EXPIRE_TIME),
-                tencentYunUtil.getTencentYunDomain().getAppId());
+                tencentYunUtil.getAppId());
 
         SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.MONITOR_CONFIG_PREFIX);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("未配置监控前缀"));
@@ -942,7 +942,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         //        ret.setStructUrl(ossUtil.getPrivateUrl(ep.getStructPath()));
         ret.setHasAudio((ep.getHasAudio() != null && ep.getHasAudio().intValue() == 1 ? true : false));
         ret.setAudioPlayCount(ep.getAudioPlayCount());
-        ret.setMonitorAppId(tencentYunUtil.getTencentYunDomain().getAppId());
+        ret.setMonitorAppId(tencentYunUtil.getAppId());
         ret.setMonitorKey(ExamRecordCacheUtil.getMonitorKey(recordId));
         ret.setMonitorUserId("s_" + tbSession.getId());
         ret.setMonitorUserSig(tencentYunUtil.getSign(ret.getMonitorUserId(), SystemConstant.TENCENT_EXPIRE_TIME));
@@ -1239,7 +1239,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         if (Objects.nonNull(monitorRecord) && !Objects.equals(monitorRecord.trim().replaceAll(" ", ""), "")) {
             //发送腾讯云回调延时mq消息start
             Map<String, Object> tranMap = mqDtoService
-                    .buildMqDelayMsg(tencentYunUtil.getTencentYunDomain().getCallbackTime());
+                    .buildMqDelayMsg(tencentYunUtil.getCallbackTime());
             tranMap.put(SystemConstant.RECORD_ID, recordId);
             MqDto mqDtoTencentVideo = new MqDto(mqUtil.getTopic(), MqTagEnum.TENCENT_VIDEO.name(),
                     MqTagEnum.TENCENT_VIDEO.name(), MqTagEnum.TENCENT_VIDEO, String.valueOf(recordId), tranMap,
@@ -1249,11 +1249,11 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
         }
 
         //解散房间
-        tencentYunUtil.DismissRoomByStrRoomId(tencentYunUtil.getTencentYunDomain().getSecretId(),
-                tencentYunUtil.getTencentYunDomain().getSecretKey(),
-                tencentYunUtil.getTencentYunDomain().getTrtcQueryUrl(),
-                tencentYunUtil.getTencentYunDomain().getTrtcRegion(),
-                Long.parseLong(tencentYunUtil.getTencentYunDomain().getAppId()),
+        tencentYunUtil.DismissRoomByStrRoomId(tencentYunUtil.getSecretId(),
+                tencentYunUtil.getSecretKey(),
+                tencentYunUtil.getTrtcQueryUrl(),
+                tencentYunUtil.getTrtcRegion(),
+                Long.parseLong(tencentYunUtil.getAppId()),
                 String.valueOf(recordId));
         return ret;
     }

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEMobileServiceImpl.java

@@ -130,7 +130,7 @@ public class TEMobileServiceImpl implements TEMobileService {
             throw new BusinessException(ExceptionResultEnum.QR_CODE_EXPIRE);
         }
         ret.setRecordId(recordId);
-        ret.setMonitorAppId(tencentYunUtil.getTencentYunDomain().getAppId());
+        ret.setMonitorAppId(tencentYunUtil.getAppId());
         ret.setMonitorKey(ExamRecordCacheUtil.getMonitorKey(recordId));
         ret.setMonitorVideoSource(monitorVideoSource);
         ret.setMonitorAudioEnable(getMonitorAudioEnable(recordId, monitorVideoSource));

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/util/MqUtil.java

@@ -32,7 +32,7 @@ public class MqUtil {
     CacheService cacheService;
 
     @Bean
-    public void mqUtilInit() {
+    public void mqUtilEnv() {
         SysConfig sysConfigMqTopic = cacheService.addSysConfigCache(SystemConstant.MQ_CONFIG_TOPIC);
         Optional.ofNullable(sysConfigMqTopic).orElseThrow(() -> new BusinessException("未配置消息队列topic"));
 

+ 162 - 25
themis-business/src/main/java/com/qmth/themis/business/util/TencentYunUtil.java

@@ -1,7 +1,6 @@
 package com.qmth.themis.business.util;
 
 import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.domain.TencentYunDomain;
 import com.qmth.themis.business.entity.SysConfig;
 import com.qmth.themis.business.entity.TOeExamRecord;
 import com.qmth.themis.business.enums.MonitorVideoSourceEnum;
@@ -19,6 +18,7 @@ import com.tencentcloudapi.vod.v20180717.VodClient;
 import com.tencentcloudapi.vod.v20180717.models.SearchMediaRequest;
 import com.tencentcloudapi.vod.v20180717.models.SearchMediaResponse;
 import com.tencentyun.TLSSigAPIv2;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
@@ -47,23 +47,68 @@ public class TencentYunUtil {
     @Resource
     CacheService cacheService;
 
-    private TencentYunDomain tencentYunDomain;
+    private String appId;
+    private String key;
+    private List<String> urls;
+    private String queryUrl;
+    private String service;
+    private String secretId;
+    private String secretKey;
+    private Long vodAppId;
+    private String callbackPwd;
+    private String callbackTime;
+    private String trtcQueryUrl;
+    private String trtcRegion;
 
     @Bean
-    public TencentYunDomain tencentYunEnv(TencentYunDomain tencentYunDomain) {
-        this.tencentYunDomain = new TencentYunDomain(tencentYunDomain.getAppId(),
-                tencentYunDomain.getKey(),
-                tencentYunDomain.getUrls(),
-                tencentYunDomain.getQueryUrl(),
-                tencentYunDomain.getService(),
-                tencentYunDomain.getSecretId(),
-                tencentYunDomain.getSecretKey(),
-                tencentYunDomain.getVodAppId(),
-                tencentYunDomain.getCallbackPwd(),
-                tencentYunDomain.getCallbackTime(),
-                tencentYunDomain.getTrtcQueryUrl(),
-                tencentYunDomain.getTrtcRegion());
-        return this.tencentYunDomain;
+    public void tencentCloudEnv() {
+        SysConfig sysConfigTencentCloudSdkAppId = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_APPID);
+        Optional.ofNullable(sysConfigTencentCloudSdkAppId).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_app_id"));
+        this.appId = sysConfigTencentCloudSdkAppId.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkKey = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_KEY);
+        Optional.ofNullable(sysConfigTencentCloudSdkKey).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_key"));
+        this.key = sysConfigTencentCloudSdkKey.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkUrls = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_URLS);
+        Optional.ofNullable(sysConfigTencentCloudSdkUrls).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_url"));
+        this.urls = Arrays.asList(StringUtils.split(sysConfigTencentCloudSdkUrls.getConfigValue(), ","));
+
+        SysConfig sysConfigTencentCloudSdkService = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_SERVICE);
+        Optional.ofNullable(sysConfigTencentCloudSdkService).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_service"));
+        this.service = sysConfigTencentCloudSdkService.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkQueryUrl = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_QUERY_URL);
+        Optional.ofNullable(sysConfigTencentCloudSdkQueryUrl).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_query_url"));
+        this.queryUrl = sysConfigTencentCloudSdkQueryUrl.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkSecretId = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_SECRET_ID);
+        Optional.ofNullable(sysConfigTencentCloudSdkSecretId).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_secret_id"));
+        this.secretId = sysConfigTencentCloudSdkSecretId.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkSecretKey = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_SECRET_KEY);
+        Optional.ofNullable(sysConfigTencentCloudSdkSecretKey).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_secret_key"));
+        this.secretKey = sysConfigTencentCloudSdkSecretKey.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkVodAppId = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_VOD_APP_ID);
+        Optional.ofNullable(sysConfigTencentCloudSdkVodAppId).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_vod_app_id"));
+        this.vodAppId = Long.parseLong(sysConfigTencentCloudSdkVodAppId.getConfigValue());
+
+        SysConfig sysConfigTencentCloudSdkCallBackPwd = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_CALLBACK_PWD);
+        Optional.ofNullable(sysConfigTencentCloudSdkCallBackPwd).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_回调密码"));
+        this.callbackPwd = sysConfigTencentCloudSdkCallBackPwd.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkCallBackTime = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_CALLBACK_TIME);
+        Optional.ofNullable(sysConfigTencentCloudSdkCallBackTime).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_回调时间"));
+        this.callbackTime = sysConfigTencentCloudSdkCallBackTime.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkTrtcQueryUrl = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_TRTC_QUERY_URL);
+        Optional.ofNullable(sysConfigTencentCloudSdkTrtcQueryUrl).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_trtc_query_url"));
+        this.trtcQueryUrl = sysConfigTencentCloudSdkTrtcQueryUrl.getConfigValue();
+
+        SysConfig sysConfigTencentCloudSdkTrtcRegion = cacheService.addSysConfigCache(SystemConstant.TENCENT_CLOUD_SDK_TRTC_REGION);
+        Optional.ofNullable(sysConfigTencentCloudSdkTrtcRegion).orElseThrow(() -> new BusinessException("未配置腾讯云sdk_trtc_region"));
+        this.trtcRegion = sysConfigTencentCloudSdkTrtcRegion.getConfigValue();
     }
 
     /**
@@ -74,14 +119,10 @@ public class TencentYunUtil {
      * @return
      */
     public String getSign(String sessionId, Long expireTime) {
-        TLSSigAPIv2 api = new TLSSigAPIv2(Long.parseLong(this.tencentYunDomain.getAppId()), this.tencentYunDomain.getKey());
+        TLSSigAPIv2 api = new TLSSigAPIv2(Long.parseLong(this.getAppId()), this.getKey());
         return api.genSig(sessionId, expireTime);
     }
 
-    public TencentYunDomain getTencentYunDomain() {
-        return tencentYunDomain;
-    }
-
     /**
      * 请求腾讯云视频地址
      *
@@ -106,10 +147,10 @@ public class TencentYunUtil {
                     SystemConstant.REDIS_LOCK_TENCENT_VIDEO_STREAM_ID_TIME_OUT);
             if (lockStreamIds) {
                 try {
-                    resultMap = this.tencentVodSdk(this.getTencentYunDomain().getSecretId(),
-                            this.getTencentYunDomain().getSecretKey(),
-                            this.getTencentYunDomain().getQueryUrl(),
-                            this.getTencentYunDomain().getVodAppId(),
+                    resultMap = this.tencentVodSdk(this.getSecretId(),
+                            this.getSecretKey(),
+                            this.getQueryUrl(),
+                            this.getVodAppId(),
                             streamIds);
                     break;
                 } catch (Exception e) {
@@ -230,4 +271,100 @@ public class TencentYunUtil {
         }
         return resultMap;
     }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public List<String> getUrls() {
+        return urls;
+    }
+
+    public void setUrls(List<String> urls) {
+        this.urls = urls;
+    }
+
+    public String getQueryUrl() {
+        return queryUrl;
+    }
+
+    public void setQueryUrl(String queryUrl) {
+        this.queryUrl = queryUrl;
+    }
+
+    public String getService() {
+        return service;
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public String getSecretId() {
+        return secretId;
+    }
+
+    public void setSecretId(String secretId) {
+        this.secretId = secretId;
+    }
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public Long getVodAppId() {
+        return vodAppId;
+    }
+
+    public void setVodAppId(Long vodAppId) {
+        this.vodAppId = vodAppId;
+    }
+
+    public String getCallbackPwd() {
+        return callbackPwd;
+    }
+
+    public void setCallbackPwd(String callbackPwd) {
+        this.callbackPwd = callbackPwd;
+    }
+
+    public String getCallbackTime() {
+        return callbackTime;
+    }
+
+    public void setCallbackTime(String callbackTime) {
+        this.callbackTime = callbackTime;
+    }
+
+    public String getTrtcQueryUrl() {
+        return trtcQueryUrl;
+    }
+
+    public void setTrtcQueryUrl(String trtcQueryUrl) {
+        this.trtcQueryUrl = trtcQueryUrl;
+    }
+
+    public String getTrtcRegion() {
+        return trtcRegion;
+    }
+
+    public void setTrtcRegion(String trtcRegion) {
+        this.trtcRegion = trtcRegion;
+    }
 }

+ 0 - 11
themis-exam/src/main/java/com/qmth/themis/exam/config/DictionaryConfig.java

@@ -36,15 +36,4 @@ public class DictionaryConfig {
     public AliYunOssDomain aliYunOssDomain() {
         return new AliYunOssDomain();
     }
-
-    /**
-     * 腾讯云配置
-     *
-     * @return
-     */
-    @Bean
-    @ConfigurationProperties(prefix = "tencentyun.sdk", ignoreUnknownFields = false)
-    public TencentYunDomain tencentYunDomain() {
-        return new TencentYunDomain();
-    }
 }

+ 1 - 1
themis-exam/src/main/java/com/qmth/themis/exam/interceptor/AuthInterceptor.java

@@ -47,7 +47,7 @@ public class AuthInterceptor implements HandlerInterceptor {
         long time = ServletUtil.getRequestTime();
         log.info("Start authorization: url:{}, method:{}, platform:{}, deviceId:{}, authorization:{}, time:{}", url,
                 method, platform, deviceId, authorization, time);
-        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.EXAM_NO_AUTH_URLS);
+        SysConfig sysConfig = cacheService.addSysConfigCache(SystemConstant.EXAM_COMMON_SYSTEM_URLS);
         Optional.ofNullable(sysConfig).orElseThrow(() -> new BusinessException("未配置exam无需鉴权的url"));
         return AuthUtil.examAuthInterceptor(platform, deviceId, authorization, time, Arrays.asList(StringUtils.split(sysConfig.getConfigValue(), ",")), request, response);
     }

+ 0 - 14
themis-exam/src/main/resources/application.properties

@@ -136,20 +136,6 @@ aliyun.oss.privateAccessKeySecret=ktrMEVE7PfoxRPeJUPDFeygOIH4aU7
 aliyun.oss.privateBucket=qmth-test
 aliyun.oss.privateUrl=http://static-test.qmth.com.cn
 
-#\u817E\u8BAF\u4E91\u914D\u7F6E
-tencentyun.sdk.appId=1400411036
-tencentyun.sdk.key=d78004c94473cb1cf78af33d333e18b731132e527e829e44e2ab133945243b11
-tencentyun.sdk.urls=https://live1.qmth.com.cn,https://live2.qmth.com.cn,https://live3.qmth.com.cn,https://live4.qmth.com.cn,https://live5.qmth.com.cn,https://live6.qmth.com.cn
-tencentyun.sdk.service=vod
-tencentyun.sdk.queryUrl=${tencentyun.sdk.service}.tencentcloudapi.com
-tencentyun.sdk.secretId=AKIDKUO2PVLuCDxQcW9VaOuA8pFOGq9BwQdZ
-tencentyun.sdk.secretKey=g5D4dwxhByXrvjGWVDfqkPqzrSmqd9OM
-tencentyun.sdk.vodAppId=1500002365
-tencentyun.sdk.callbackPwd=123456
-tencentyun.sdk.callbackTime=2m
-tencentyun.sdk.trtcQueryUrl=trtc.tencentcloudapi.com
-tencentyun.sdk.trtcRegion=ap-guangzhou
-
 #\u7CFB\u7EDF\u914D\u7F6E
 sys.config.datacenterId=2
 sys.config.oss=true

+ 0 - 11
themis-task/src/main/java/com/qmth/themis/task/config/DictionaryConfig.java

@@ -36,15 +36,4 @@ public class DictionaryConfig {
     public AliYunOssDomain aliYunOssDomain() {
         return new AliYunOssDomain();
     }
-
-    /**
-     * 腾讯云配置
-     *
-     * @return
-     */
-    @Bean
-    @ConfigurationProperties(prefix = "tencentyun.sdk", ignoreUnknownFields = false)
-    public TencentYunDomain tencentYunDomain() {
-        return new TencentYunDomain();
-    }
 }

+ 1 - 15
themis-task/src/main/resources/application.properties

@@ -176,18 +176,4 @@ rocketmq.producer.secret-key=SK
 #\u542F\u7528\u6D88\u606F\u8F68\u8FF9\uFF0C\u9ED8\u8BA4\u503Ctrue
 rocketmq.producer.enable-msg-trace=true
 #\u81EA\u5B9A\u4E49\u7684\u6D88\u606F\u8F68\u8FF9\u4E3B\u9898
-#rocketmq.producer.customized-trace-topic=my-trace-topic
-
-#\u817E\u8BAF\u4E91\u914D\u7F6E
-tencentyun.sdk.appId=1400411036
-tencentyun.sdk.key=d78004c94473cb1cf78af33d333e18b731132e527e829e44e2ab133945243b11
-tencentyun.sdk.urls=https://live1.qmth.com.cn,https://live2.qmth.com.cn,https://live3.qmth.com.cn,https://live4.qmth.com.cn,https://live5.qmth.com.cn,https://live6.qmth.com.cn
-tencentyun.sdk.service=vod
-tencentyun.sdk.queryUrl=${tencentyun.sdk.service}.tencentcloudapi.com
-tencentyun.sdk.secretId=AKIDKUO2PVLuCDxQcW9VaOuA8pFOGq9BwQdZ
-tencentyun.sdk.secretKey=g5D4dwxhByXrvjGWVDfqkPqzrSmqd9OM
-tencentyun.sdk.vodAppId=1500002365
-tencentyun.sdk.callbackPwd=123456
-tencentyun.sdk.callbackTime=2m
-tencentyun.sdk.trtcQueryUrl=trtc.tencentcloudapi.com
-tencentyun.sdk.trtcRegion=ap-guangzhou
+#rocketmq.producer.customized-trace-topic=my-trace-topic