2 Commits
20358ce9d2
...
5362cbf72c
Author | SHA1 | Message | Date |
---|---|---|---|
|
5362cbf72c |
Merge branch 'master' of http://39.101.133.168:8807/donghanyang/AIgod_shixi_java into master
|
4 weeks ago |
|
d924a78cb5 |
查询
|
1 month ago |
31 changed files with 959 additions and 0 deletions
-
33.gitignore
-
107pom.xml
-
17src/main/java/org/hlrj/duobao_demo/DuobaoDemoApplication.java
-
45src/main/java/org/hlrj/duobao_demo/controller/CuratedVideoController.java
-
49src/main/java/org/hlrj/duobao_demo/controller/RecommendationController.java
-
42src/main/java/org/hlrj/duobao_demo/controller/SpecialTopicController.java
-
42src/main/java/org/hlrj/duobao_demo/controller/VideoDataController.java
-
51src/main/java/org/hlrj/duobao_demo/entity/CuratedVideo.java
-
60src/main/java/org/hlrj/duobao_demo/entity/Recommendation.java
-
60src/main/java/org/hlrj/duobao_demo/entity/SpecialTopic.java
-
47src/main/java/org/hlrj/duobao_demo/entity/VideoData.java
-
16src/main/java/org/hlrj/duobao_demo/mapper/CuratedVideoMapper.java
-
16src/main/java/org/hlrj/duobao_demo/mapper/RecommendationMapper.java
-
16src/main/java/org/hlrj/duobao_demo/mapper/SpecialTopicMapper.java
-
16src/main/java/org/hlrj/duobao_demo/mapper/VideoDataMapper.java
-
22src/main/java/org/hlrj/duobao_demo/service/ICuratedVideoService.java
-
22src/main/java/org/hlrj/duobao_demo/service/IRecommendationService.java
-
22src/main/java/org/hlrj/duobao_demo/service/ISpecialTopicService.java
-
22src/main/java/org/hlrj/duobao_demo/service/IVideoDataService.java
-
33src/main/java/org/hlrj/duobao_demo/service/impl/CuratedVideoServiceImpl.java
-
31src/main/java/org/hlrj/duobao_demo/service/impl/RecommendationServiceImpl.java
-
31src/main/java/org/hlrj/duobao_demo/service/impl/SpecialTopicServiceImpl.java
-
31src/main/java/org/hlrj/duobao_demo/service/impl/VideoDataServiceImpl.java
-
34src/main/java/org/hlrj/duobao_demo/tool/Result.java
-
8src/main/resources/application.properties
-
15src/main/resources/mapper/CuratedVideoMapper.xml
-
18src/main/resources/mapper/RecommendationMapper.xml
-
18src/main/resources/mapper/SpecialTopicMapper.xml
-
16src/main/resources/mapper/VideoDataMapper.xml
-
6src/main/resources/static/index.html
-
13src/test/java/org/hlrj/duobao_demo/DuobaoDemoApplicationTests.java
@ -0,0 +1,33 @@ |
|||||
|
HELP.md |
||||
|
target/ |
||||
|
!.mvn/wrapper/maven-wrapper.jar |
||||
|
!**/src/main/**/target/ |
||||
|
!**/src/test/**/target/ |
||||
|
|
||||
|
### STS ### |
||||
|
.apt_generated |
||||
|
.classpath |
||||
|
.factorypath |
||||
|
.project |
||||
|
.settings |
||||
|
.springBeans |
||||
|
.sts4-cache |
||||
|
|
||||
|
### IntelliJ IDEA ### |
||||
|
.idea |
||||
|
*.iws |
||||
|
*.iml |
||||
|
*.ipr |
||||
|
|
||||
|
### NetBeans ### |
||||
|
/nbproject/private/ |
||||
|
/nbbuild/ |
||||
|
/dist/ |
||||
|
/nbdist/ |
||||
|
/.nb-gradle/ |
||||
|
build/ |
||||
|
!**/src/main/**/build/ |
||||
|
!**/src/test/**/build/ |
||||
|
|
||||
|
### VS Code ### |
||||
|
.vscode/ |
@ -0,0 +1,107 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<groupId>org.hlrj</groupId> |
||||
|
<artifactId>duobao_demo</artifactId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
<name>duobao_demo</name> |
||||
|
<description>duobao_demo</description> |
||||
|
<properties> |
||||
|
<java.version>1.8</java.version> |
||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
||||
|
<spring-boot.version>2.6.13</spring-boot.version> |
||||
|
</properties> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-data-redis</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.mysql</groupId> |
||||
|
<artifactId>mysql-connector-j</artifactId> |
||||
|
<scope>runtime</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
<optional>true</optional> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
<!--mybatis-plus依赖--> |
||||
|
<dependency> |
||||
|
<groupId>com.baomidou</groupId> |
||||
|
<artifactId>mybatis-plus-boot-starter</artifactId> |
||||
|
<version>3.5.3.1</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>io.springfox</groupId> |
||||
|
<artifactId>springfox-swagger2</artifactId> |
||||
|
<version>2.9.2</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>io.springfox</groupId> |
||||
|
<artifactId>springfox-swagger-ui</artifactId> |
||||
|
<version>2.9.2</version> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
</dependencies> |
||||
|
<dependencyManagement> |
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-dependencies</artifactId> |
||||
|
<version>${spring-boot.version}</version> |
||||
|
<type>pom</type> |
||||
|
<scope>import</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
</dependencyManagement> |
||||
|
|
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||
|
<artifactId>maven-compiler-plugin</artifactId> |
||||
|
<version>3.8.1</version> |
||||
|
<configuration> |
||||
|
<source>1.8</source> |
||||
|
<target>1.8</target> |
||||
|
<encoding>UTF-8</encoding> |
||||
|
</configuration> |
||||
|
</plugin> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
<version>${spring-boot.version}</version> |
||||
|
<configuration> |
||||
|
<mainClass>org.hlrj.duobao_demo.DuobaoDemoApplication</mainClass> |
||||
|
<skip>true</skip> |
||||
|
</configuration> |
||||
|
<executions> |
||||
|
<execution> |
||||
|
<id>repackage</id> |
||||
|
<goals> |
||||
|
<goal>repackage</goal> |
||||
|
</goals> |
||||
|
</execution> |
||||
|
</executions> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,17 @@ |
|||||
|
package org.hlrj.duobao_demo; |
||||
|
|
||||
|
import org.mybatis.spring.annotation.MapperScan; |
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
|
||||
|
@SpringBootApplication |
||||
|
@MapperScan("org.hlrj.duobao_demo.mapper") |
||||
|
public class DuobaoDemoApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(DuobaoDemoApplication.class, args); |
||||
|
System.out.println("lllllllllllllllll"); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package org.hlrj.duobao_demo.controller; |
||||
|
|
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.hlrj.duobao_demo.entity.CuratedVideo; |
||||
|
import org.hlrj.duobao_demo.entity.Recommendation; |
||||
|
import org.hlrj.duobao_demo.service.ICuratedVideoService; |
||||
|
import org.hlrj.duobao_demo.service.IRecommendationService; |
||||
|
import org.hlrj.duobao_demo.tool.Result; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 前端控制器 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
@RequestMapping("/curated-video") |
||||
|
public class CuratedVideoController { |
||||
|
@Autowired |
||||
|
private ICuratedVideoService curatedVideoService; |
||||
|
///api/brain/addUserPrivileges |
||||
|
//@RequestMapping(value = "/api/selectRecommendation",method = RequestMethod.POST) |
||||
|
@PostMapping("/api/selectCuratedVideo") |
||||
|
public Result selectCuratedVideo() { |
||||
|
|
||||
|
log.info("查询全部的精选的视频");//日志记录 |
||||
|
//查询全部数据 |
||||
|
List<CuratedVideo> curatedVideo=curatedVideoService.select(); |
||||
|
|
||||
|
return Result.success(curatedVideo); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package org.hlrj.duobao_demo.controller; |
||||
|
|
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import net.bytebuddy.asm.Advice; |
||||
|
import org.hlrj.duobao_demo.entity.Recommendation; |
||||
|
import org.hlrj.duobao_demo.service.IRecommendationService; |
||||
|
import org.hlrj.duobao_demo.tool.Result; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 前端控制器 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Slf4j//日志记录 |
||||
|
@RequestMapping("/recommendation") |
||||
|
public class RecommendationController { |
||||
|
|
||||
|
//记录日志 |
||||
|
//private static Logger log = LoggerFactory.getLogger(RecommendationController.class); |
||||
|
//进行注入 |
||||
|
@Autowired |
||||
|
private IRecommendationService recommendationService; |
||||
|
///api/brain/addUserPrivileges |
||||
|
//@RequestMapping(value = "/api/selectRecommendation",method = RequestMethod.POST) |
||||
|
@PostMapping("/api/selectRecommendation") |
||||
|
public Result selectRecommendation() { |
||||
|
|
||||
|
log.info("查询全部的推荐视频");//日志记录 |
||||
|
//查询全部数据 |
||||
|
List<Recommendation> recommendationList=recommendationService.select(); |
||||
|
|
||||
|
return Result.success(recommendationList); |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package org.hlrj.duobao_demo.controller; |
||||
|
|
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.hlrj.duobao_demo.entity.CuratedVideo; |
||||
|
import org.hlrj.duobao_demo.entity.SpecialTopic; |
||||
|
import org.hlrj.duobao_demo.service.ICuratedVideoService; |
||||
|
import org.hlrj.duobao_demo.service.ISpecialTopicService; |
||||
|
import org.hlrj.duobao_demo.tool.Result; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 前端控制器 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
@RequestMapping("/special-topic") |
||||
|
public class SpecialTopicController { |
||||
|
@Autowired |
||||
|
private ISpecialTopicService specialTopicService; |
||||
|
|
||||
|
@PostMapping("/api/selectSpecialTopic") |
||||
|
public Result selectSpecialTopic() { |
||||
|
|
||||
|
log.info("查询全部的专题视频");//日志记录 |
||||
|
//查询全部数据 |
||||
|
List<SpecialTopic> specialTopic=specialTopicService.select(); |
||||
|
|
||||
|
return Result.success(specialTopic); |
||||
|
} |
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
package org.hlrj.duobao_demo.controller; |
||||
|
|
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.hlrj.duobao_demo.entity.SpecialTopic; |
||||
|
import org.hlrj.duobao_demo.entity.VideoData; |
||||
|
import org.hlrj.duobao_demo.service.ISpecialTopicService; |
||||
|
import org.hlrj.duobao_demo.service.IVideoDataService; |
||||
|
import org.hlrj.duobao_demo.tool.Result; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 前端控制器 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
@RequestMapping("/video-data") |
||||
|
public class VideoDataController { |
||||
|
@Autowired |
||||
|
private IVideoDataService iVideoDataService; |
||||
|
|
||||
|
@PostMapping("/api/selectVideoData") |
||||
|
public Result selectVideoData() { |
||||
|
|
||||
|
log.info("查询全部的z直播广场内容");//日志记录 |
||||
|
//查询全部数据 |
||||
|
List<VideoData> videoData=iVideoDataService.select(); |
||||
|
|
||||
|
return Result.success(videoData); |
||||
|
} |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
package org.hlrj.duobao_demo.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
@TableName("curated_video") |
||||
|
@ApiModel(value="CuratedVideo对象", description="") |
||||
|
public class CuratedVideo implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty(value = "自增ID") |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
@ApiModelProperty(value = "封面图片URL") |
||||
|
private String imageUrl; |
||||
|
|
||||
|
@ApiModelProperty(value = "标题") |
||||
|
private String title; |
||||
|
|
||||
|
@ApiModelProperty(value = "作者") |
||||
|
private String author; |
||||
|
|
||||
|
@ApiModelProperty(value = "发布时间") |
||||
|
private LocalDateTime publishTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "观看次数") |
||||
|
private Long views; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package org.hlrj.duobao_demo.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
@TableName("recommendation") |
||||
|
@ApiModel(value="Recommendation对象", description="") |
||||
|
public class Recommendation implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty(value = "自增ID") |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
@ApiModelProperty(value = "封面图片URL") |
||||
|
private String imageUrl; |
||||
|
|
||||
|
@ApiModelProperty(value = "标题") |
||||
|
private String title; |
||||
|
|
||||
|
@ApiModelProperty(value = "作者") |
||||
|
private String author; |
||||
|
|
||||
|
@ApiModelProperty(value = "发布时间") |
||||
|
private LocalDateTime publishTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "点赞数") |
||||
|
private Integer likes; |
||||
|
|
||||
|
@ApiModelProperty(value = "评论数") |
||||
|
private Integer comments; |
||||
|
|
||||
|
@ApiModelProperty(value = "分享数") |
||||
|
private Integer shares; |
||||
|
|
||||
|
@ApiModelProperty(value = "来源") |
||||
|
private String source; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,60 @@ |
|||||
|
package org.hlrj.duobao_demo.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
@TableName("special_topic") |
||||
|
@ApiModel(value="SpecialTopic对象", description="") |
||||
|
public class SpecialTopic implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@ApiModelProperty(value = "自增ID") |
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
@ApiModelProperty(value = "专题主标题") |
||||
|
private String mainTitle; |
||||
|
|
||||
|
@ApiModelProperty(value = "章节标题") |
||||
|
private String sectionTitle; |
||||
|
|
||||
|
@ApiModelProperty(value = "封面图片URL") |
||||
|
private String coverImg; |
||||
|
|
||||
|
@ApiModelProperty(value = "作者") |
||||
|
private String author; |
||||
|
|
||||
|
@ApiModelProperty(value = "发布时间") |
||||
|
private LocalDateTime publishTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "观看次数") |
||||
|
private Integer viewCount; |
||||
|
|
||||
|
@ApiModelProperty(value = "评论数") |
||||
|
private Integer commentCount; |
||||
|
|
||||
|
@ApiModelProperty(value = "点赞数") |
||||
|
private Integer likeCount; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package org.hlrj.duobao_demo.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.io.Serializable; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = false) |
||||
|
@Accessors(chain = true) |
||||
|
@TableName("video_data") |
||||
|
@ApiModel(value="VideoData对象", description="") |
||||
|
public class VideoData implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||
|
private Integer id; |
||||
|
|
||||
|
private String mainTitle; |
||||
|
|
||||
|
private String sectionTitle; |
||||
|
|
||||
|
private String coverImg; |
||||
|
|
||||
|
private String author; |
||||
|
|
||||
|
private LocalDateTime publishTime; |
||||
|
|
||||
|
private String description; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.hlrj.duobao_demo.mapper; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.CuratedVideo; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* Mapper 接口 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface CuratedVideoMapper extends BaseMapper<CuratedVideo> { |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.hlrj.duobao_demo.mapper; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.Recommendation; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* Mapper 接口 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface RecommendationMapper extends BaseMapper<Recommendation> { |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.hlrj.duobao_demo.mapper; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.SpecialTopic; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* Mapper 接口 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface SpecialTopicMapper extends BaseMapper<SpecialTopic> { |
||||
|
|
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package org.hlrj.duobao_demo.mapper; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.VideoData; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* Mapper 接口 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface VideoDataMapper extends BaseMapper<VideoData> { |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.hlrj.duobao_demo.service; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.CuratedVideo; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface ICuratedVideoService extends IService<CuratedVideo> { |
||||
|
/** |
||||
|
* 查询全部精选视频 |
||||
|
* @return |
||||
|
*/ |
||||
|
public List<CuratedVideo> select(); |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.hlrj.duobao_demo.service; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.Recommendation; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface IRecommendationService extends IService<Recommendation> { |
||||
|
/** |
||||
|
* 查询全部数据 |
||||
|
* @return |
||||
|
*/ |
||||
|
public List<Recommendation> select(); |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.hlrj.duobao_demo.service; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.SpecialTopic; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface ISpecialTopicService extends IService<SpecialTopic> { |
||||
|
/** |
||||
|
* 查询全部的专题视频 |
||||
|
* @return |
||||
|
*/ |
||||
|
public List<SpecialTopic> select(); |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package org.hlrj.duobao_demo.service; |
||||
|
|
||||
|
import org.hlrj.duobao_demo.entity.VideoData; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
public interface IVideoDataService extends IService<VideoData> { |
||||
|
/** |
||||
|
* 查询全部直播广场的内容 |
||||
|
* @return |
||||
|
*/ |
||||
|
public List<VideoData> select(); |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package org.hlrj.duobao_demo.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import org.hlrj.duobao_demo.entity.CuratedVideo; |
||||
|
import org.hlrj.duobao_demo.mapper.CuratedVideoMapper; |
||||
|
import org.hlrj.duobao_demo.service.ICuratedVideoService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务实现类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class CuratedVideoServiceImpl extends ServiceImpl<CuratedVideoMapper, CuratedVideo> implements ICuratedVideoService { |
||||
|
|
||||
|
@Autowired |
||||
|
private CuratedVideoMapper curatedVideoMapper; |
||||
|
@Override |
||||
|
public List<CuratedVideo> select() { |
||||
|
|
||||
|
QueryWrapper<CuratedVideo> queryWrapper = new QueryWrapper<>(); |
||||
|
return curatedVideoMapper.selectList(queryWrapper); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.hlrj.duobao_demo.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import org.hlrj.duobao_demo.entity.Recommendation; |
||||
|
import org.hlrj.duobao_demo.mapper.RecommendationMapper; |
||||
|
import org.hlrj.duobao_demo.service.IRecommendationService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务实现类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class RecommendationServiceImpl extends ServiceImpl<RecommendationMapper, Recommendation> implements IRecommendationService { |
||||
|
@Autowired |
||||
|
private RecommendationMapper recommendationMapper; |
||||
|
@Override |
||||
|
public List<Recommendation> select() { |
||||
|
QueryWrapper<Recommendation> wrapper = new QueryWrapper<>(); |
||||
|
return recommendationMapper.selectList(wrapper); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.hlrj.duobao_demo.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import org.hlrj.duobao_demo.entity.SpecialTopic; |
||||
|
import org.hlrj.duobao_demo.mapper.SpecialTopicMapper; |
||||
|
import org.hlrj.duobao_demo.service.ISpecialTopicService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务实现类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SpecialTopicServiceImpl extends ServiceImpl<SpecialTopicMapper, SpecialTopic> implements ISpecialTopicService { |
||||
|
@Autowired |
||||
|
private SpecialTopicMapper specialTopicMapper; |
||||
|
@Override |
||||
|
public List<SpecialTopic> select() { |
||||
|
QueryWrapper<SpecialTopic> queryWrapper = new QueryWrapper<>(); |
||||
|
return specialTopicMapper.selectList(queryWrapper); |
||||
|
} |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.hlrj.duobao_demo.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import org.hlrj.duobao_demo.entity.VideoData; |
||||
|
import org.hlrj.duobao_demo.mapper.VideoDataMapper; |
||||
|
import org.hlrj.duobao_demo.service.IVideoDataService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* <p> |
||||
|
* 服务实现类 |
||||
|
* </p> |
||||
|
* |
||||
|
* @author liuyusong |
||||
|
* @since 2025-04-09 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class VideoDataServiceImpl extends ServiceImpl<VideoDataMapper, VideoData> implements IVideoDataService { |
||||
|
@Autowired |
||||
|
private VideoDataMapper videoDataMapper; |
||||
|
@Override |
||||
|
public List<VideoData> select() { |
||||
|
QueryWrapper<VideoData> queryWrapper = new QueryWrapper<>(); |
||||
|
return videoDataMapper.selectList(queryWrapper); |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package org.hlrj.duobao_demo.tool; |
||||
|
|
||||
|
import io.swagger.models.auth.In; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
/** |
||||
|
* @program: duobao_demo |
||||
|
* @ClassName Result |
||||
|
* @description: |
||||
|
* @author:liuyusong |
||||
|
* @create: 2025−04-10 10:06 |
||||
|
* @Version 1.0 |
||||
|
**/ |
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@AllArgsConstructor |
||||
|
public class Result { |
||||
|
|
||||
|
private Integer code;//响应码 |
||||
|
private String msg;//响应信息 |
||||
|
private Object data;//返回的数据 |
||||
|
|
||||
|
public static Result success() { //增删改 响应成功 |
||||
|
return new Result(200, "success", null); |
||||
|
} |
||||
|
public static Result success(Object data) {//查询成功 |
||||
|
return new Result(200, "success", data); |
||||
|
} |
||||
|
public static Result success(String msg) { |
||||
|
return new Result(400,"msg",null); |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
# 应用服务 WEB 访问端口 |
||||
|
server.port=8080 |
||||
|
|
||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/duobao?useSSL=false&serverTimezone=UTC |
||||
|
spring.datasource.username=root |
||||
|
spring.datasource.password=password |
||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.hlrj.duobao_demo.mapper.CuratedVideoMapper"> |
||||
|
|
||||
|
<!-- 通用查询映射结果 --> |
||||
|
<resultMap id="BaseResultMap" type="org.hlrj.duobao_demo.entity.CuratedVideo"> |
||||
|
<id column="id" property="id" /> |
||||
|
<result column="image_url" property="imageUrl" /> |
||||
|
<result column="title" property="title" /> |
||||
|
<result column="author" property="author" /> |
||||
|
<result column="publish_time" property="publishTime" /> |
||||
|
<result column="views" property="views" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.hlrj.duobao_demo.mapper.RecommendationMapper"> |
||||
|
|
||||
|
<!-- 通用查询映射结果 --> |
||||
|
<resultMap id="BaseResultMap" type="org.hlrj.duobao_demo.entity.Recommendation"> |
||||
|
<id column="id" property="id" /> |
||||
|
<result column="image_url" property="imageUrl" /> |
||||
|
<result column="title" property="title" /> |
||||
|
<result column="author" property="author" /> |
||||
|
<result column="publish_time" property="publishTime" /> |
||||
|
<result column="likes" property="likes" /> |
||||
|
<result column="comments" property="comments" /> |
||||
|
<result column="shares" property="shares" /> |
||||
|
<result column="source" property="source" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,18 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.hlrj.duobao_demo.mapper.SpecialTopicMapper"> |
||||
|
|
||||
|
<!-- 通用查询映射结果 --> |
||||
|
<resultMap id="BaseResultMap" type="org.hlrj.duobao_demo.entity.SpecialTopic"> |
||||
|
<id column="id" property="id" /> |
||||
|
<result column="main_title" property="mainTitle" /> |
||||
|
<result column="section_title" property="sectionTitle" /> |
||||
|
<result column="cover_img" property="coverImg" /> |
||||
|
<result column="author" property="author" /> |
||||
|
<result column="publish_time" property="publishTime" /> |
||||
|
<result column="view_count" property="viewCount" /> |
||||
|
<result column="comment_count" property="commentCount" /> |
||||
|
<result column="like_count" property="likeCount" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="org.hlrj.duobao_demo.mapper.VideoDataMapper"> |
||||
|
|
||||
|
<!-- 通用查询映射结果 --> |
||||
|
<resultMap id="BaseResultMap" type="org.hlrj.duobao_demo.entity.VideoData"> |
||||
|
<id column="id" property="id" /> |
||||
|
<result column="main_title" property="mainTitle" /> |
||||
|
<result column="section_title" property="sectionTitle" /> |
||||
|
<result column="cover_img" property="coverImg" /> |
||||
|
<result column="author" property="author" /> |
||||
|
<result column="publish_time" property="publishTime" /> |
||||
|
<result column="description" property="description" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,6 @@ |
|||||
|
<html> |
||||
|
<body> |
||||
|
<h1>hello word!!!</h1> |
||||
|
<p>this is a html page</p> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,13 @@ |
|||||
|
package org.hlrj.duobao_demo; |
||||
|
|
||||
|
import org.junit.jupiter.api.Test; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
|
||||
|
@SpringBootTest |
||||
|
class DuobaoDemoApplicationTests { |
||||
|
|
||||
|
@Test |
||||
|
void contextLoads() { |
||||
|
} |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue