修复后台批量增加直播链接

This commit is contained in:
2026-05-16 12:21:13 +08:00
parent ddb78e29a3
commit a7e57e63a9
4 changed files with 6 additions and 2 deletions

View File

@@ -16,5 +16,6 @@ public class LiveUrl {
private Integer id;
private String type;
private String url;
private String m3u8_url;
}

View File

@@ -4,6 +4,7 @@ import com.ping.study.mapper.UrlsMapper;
import com.ping.study.model.dto.addUrls;
import com.ping.study.model.vo.live.LiveUrl;
import com.ping.study.service.UrlsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -15,6 +16,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
@Service
@Slf4j
public class UrlsServiceImpl implements UrlsService {
@Autowired
@@ -73,6 +75,7 @@ public class UrlsServiceImpl implements UrlsService {
@Override
public void addUrls(addUrls addUrls) {
log.info("addUrls:{}",addUrls);
urlsMapper.insertUrlsWithGameId(addUrls.getGameId(), addUrls.getUrls());
//删除redis缓存
redisTemplate.delete("live:urls:all");

View File

@@ -4,7 +4,7 @@ server:
cookie:
same-site: None
secure: true # 生产是 https 必须 true
port: 9005
port: 9001
#spring:
# data:
# redis:

View File

@@ -89,7 +89,7 @@
(game_id, m3u8_url, type)
values
<foreach collection="list" item="item" separator=",">
(#{gameId}, #{item.url}, #{item.type})
(#{gameId}, #{item.m3u8_url}, #{item.type})
</foreach>
</insert>
<delete id="deleteUrlById" parameterType="java.lang.Integer">