feat(视频):

视频初步
This commit is contained in:
Guwan 2024-12-08 19:44:52 +08:00
parent c341087577
commit 4834c66f04
5 changed files with 13 additions and 4 deletions

1
docs/question.md Normal file
View File

@ -0,0 +1 @@
Field client in cn.easyes.starter.register.MapperFactoryBean required a bean of type 'org.elasticsearch.client.RestHighLevelClient' that could not be found.

View File

@ -17,6 +17,7 @@ public class SecurityConstants {
"/api/user/login", // 用户登录
"/api/user/getEmailCode", // 获取邮箱验证码
"/api/user/getPhoneCode", // 获取手机验证码
"/chat.html",
"/v3/api-docs/**", // Swagger API文档
"/swagger-ui/**", // Swagger UI
"/swagger-ui.html", // Swagger UI HTML

View File

@ -10,13 +10,14 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.HttpServerCodec;
import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
@Slf4j
@Component

View File

@ -3,6 +3,8 @@ package com.guwan.backend.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.guwan.backend.dto.video.VideoDTO;
import java.util.List;
public interface VideoService {
// 上传视频
VideoDTO uploadVideo(String fileUrl, String title, String description, String tags);
@ -24,4 +26,8 @@ public interface VideoService {
// 点赞/取消点赞
void toggleLike(Long id);
public List<VideoDTO> getSimilarVideosByEs(Long id, int limit);
public List<VideoDTO> searchVideosByEs(String keyword);
}

View File

@ -217,12 +217,12 @@ public class VideoServiceImpl implements VideoService {
}
@Override
public List<VideoDTO> searchVideos(String keyword) {
public List<VideoDTO> searchVideosByEs(String keyword) {
return videoSearchService.search(keyword);
}
@Override
public List<VideoDTO> getSimilarVideos(Long id, int limit) {
public List<VideoDTO> getSimilarVideosByEs(Long id, int limit) {
return videoSearchService.findSimilar(id, limit);
}