浏览代码

完成基础功能开发

liyuntian 10 月之前
父节点
当前提交
c840837bf9

+ 0 - 8
mcp/src/main/java/com/chuanxia/mcp/sched/M3U8Utils.java

@@ -6,10 +6,8 @@ import com.chuanxia.mcp.bean.model.VideoM3u8;
 import com.chuanxia.mcp.bean.model.VideoTs;
 import com.chuanxia.mcp.bean.vo.TsArrIsOrderVo;
 import com.chuanxia.mcp.exception.ResultException;
-import com.chuanxia.mcp.service.VideoM3u8Service;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.web.client.RestTemplate;
@@ -26,13 +24,7 @@ import java.util.regex.Pattern;
 @Component
 @RequiredArgsConstructor
 public class M3U8Utils {
-
     private final RestTemplate restTemplate;
-
-    @Value("${m3u8.downLoadPath}")
-    private String downLoadPath;
-    @Value("${m3u8.tsDownLoadPath}")
-    private String tsDownLoadPath;
     private Pattern pattern = Pattern.compile("\\d+");
 
     /**

+ 4 - 1
mcp/src/main/java/com/chuanxia/mcp/service/impl/CdnDoaminServiceImpl.java

@@ -26,6 +26,7 @@ import eu.bitwalker.useragentutils.UserAgent;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -52,6 +53,8 @@ public class CdnDoaminServiceImpl extends ServiceImpl<CdnDomainMapper, CdnDomain
     private final CdnDomainTimeRuleMapper domainTimeRuleMapper;
     private final CdnCityMapper cityMapper;
     private final VideoM3u8Mapper m3u8Mapper;
+    @Value("${project.address}")
+    private String address;
 
     @Override
     public Result<IPage<CdnDomain>> listPage(DomainQueryDto queryDto) {
@@ -208,7 +211,7 @@ public class CdnDoaminServiceImpl extends ServiceImpl<CdnDomainMapper, CdnDomain
                     m3u8 = videoM3u8s.get(0);
                 }
                 if (!StringUtils.isBlank(type)) {
-                    String downLoadFileUrl = "http://127.0.0.1:8088/api/cdnDomain/downLoadM3u8File?cdn=" + cdnDomain.getDomain() + "&id=" + m3u8.getId();
+                    String downLoadFileUrl = address + "/api/cdnDomain/downLoadM3u8File?cdn=" + cdnDomain.getDomain() + "&id=" + m3u8.getId();
                     throw new ResultException(888, downLoadFileUrl);
                 }
                 String tsListStr = m3u8.getTsListStr();

+ 2 - 3
mcp/src/main/resources/application-local.yml

@@ -8,6 +8,5 @@ mybatis-plus:
   configuration:
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     map-underscore-to-camel-case: false
-m3u8:
-  downLoadPath: D:\\m3u8Download
-  tsDownLoadPath: D:\\m3u8TsDownLoad
+project:
+  address: http://127.0.0.1:8088