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

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

View File

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

View File

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