liyuntian před 10 měsíci
rodič
revize
82a42fbd88

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

@@ -3,7 +3,6 @@ package com.chuanxia.mcp.service.impl;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -210,7 +209,7 @@ public class CdnDoaminServiceImpl extends ServiceImpl<CdnDomainMapper, CdnDomain
                     m3u8 = videoM3u8s.get(0);
                 }
                 if (!StringUtils.isBlank(type)) {
-                    String downLoadFileUrl = address + "/api/cdnDomain/downLoadM3u8File?cdn=" + cdnDomain.getDomain() + "&id=" + m3u8.getId()+"&type=.m3u8";
+                    String downLoadFileUrl = address + "/api/cdnDomain/downLoadM3u8File?cdn=" + cdnDomain.getDomain() + "&id=" + m3u8.getId() + "&type=.m3u8";
                     throw new ResultException(888, downLoadFileUrl);
                 }
                 String tsListStr = m3u8.getTsListStr();
@@ -218,13 +217,15 @@ public class CdnDoaminServiceImpl extends ServiceImpl<CdnDomainMapper, CdnDomain
 
                 if (!StringUtils.isBlank(tsListStr)) {
                     if (StringUtils.isBlank(tsName)) {
+                        //没有文件名,说明是不规则数组,这里直接设置tsList
                         List<VideoTs> tsList = JSON.parseArray(tsListStr, VideoTs.class);
-                        //说明是有序的视频,则不需要返回tsList
                         m3u8.setTS_LIST(tsList);
                     }
                     String prefixPath = m3u8.getPREFIX_PATH();
                     if (StringUtils.isNotBlank(prefixPath)) {
                         m3u8.setPREFIX_PATH(cdnDomain.getDomain() + m3u8.getPREFIX_PATH());
+                    } else {
+                        m3u8.setPREFIX_PATH("");
                     }
                     m3u8.setTsListStr("");
                 } else {

+ 2 - 2
mcp/src/main/resources/application-test.yml

@@ -6,7 +6,7 @@ spring:
     password: chuanxia112233
 mybatis-plus:
   configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
     map-underscore-to-camel-case: false
 project:
-  address: https://mcp-api.szchuanxia.cn/api
+  address: https://mcp-api.szchuanxia.cn

+ 1 - 1
mcp/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: local
+    active: test
 server:
   port: 8088
   servlet:

+ 15 - 37
mcp/src/main/resources/com/chuanxia/mcp/mapper/CdnDomainMapper.xml

@@ -5,53 +5,31 @@
 <mapper namespace="com.chuanxia.mcp.mapper.CdnDomainMapper">
 
     <select id="getDomainByCityName" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
-        SELECT
-  cd.id,
-  cd.domain,
-  cd.manufacturer,
-  cd.default_domain as defaultDomain,
-  cd.create_time as createTime,
-  cd.update_time as updateTime,
-  cd.create_by as createBy,
-  cd.update_by as updateBy
+   SELECT
+  domain_id AS domainId,
+  `domain`
 FROM
-  `cdn_city` cc
-  LEFT JOIN `cdn_domain_city` cdc
-    ON cc.`id` = cdc.`city_id`
-  LEFT JOIN `cdn_domain` cd
-    ON cdc.`domain_id` = cd.`id`
-    WHERE cc.`cname` = #{city}
+  cdn_domain_city
+WHERE cname = #{city}
     LIMIT 0,1
     </select>
     <select id="getDomainByOperator" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
 SELECT
-  cd.id,
-  cd.domain,
-  cd.manufacturer,
-  cd.default_domain as defaultDomain,
-  cd.create_time as createTime,
-  cd.update_time as updateTime,
-  cd.create_by as createBy,
-  cd.update_by as updateBy
+  domain_id AS domainId,
+  `domain`
 FROM
-  `cdn_operator` co
-  LEFT JOIN `cdn_domain_operator` cdo
-    ON co.`id` = cdo.`operator_id`
-  LEFT JOIN `cdn_domain` cd
-    ON cdo.`domain_id` = cd.`id`
-   WHERE co.`operator_name` = #{operator}
+  cdn_domain_operator
+   WHERE `operator_name` = #{operator}
    limit 0,1
     </select>
     <select id="getDomainByTimeRule" resultType="com.chuanxia.mcp.bean.model.CdnDomain">
         SELECT
-        *
+        domain_id AS domainId,
+        `domain`
         FROM
-        `cdn_time_rule` ctr
-        LEFT JOIN `cdn_domain_time_rule` cdtr
-        ON ctr.`id` = cdtr.`id`
-        LEFT JOIN `cdn_domain` cd
-        ON cdtr.`domain_id` = cd.`id`
-        WHERE ctr.`start_time` &lt;= #{hours} and ctr.`end_time` &gt;= #{hours}
-        order by end_time desc limit 0,1
+        `cdn_domain_time_rule`
+        WHERE start_time &lt;= #{hours}
+        AND end_time &gt;= #{hours}
+        limit 0,1
     </select>
 </mapper>