From 28a0edd44abdc02fdb95b3286109648d3015340d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BD=A9=E8=BE=95=E9=BE=99=E5=84=BF?= Date: Thu, 27 Jul 2023 11:56:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8D=95=E7=9A=84=E6=B8=85=E7=90=86?= =?UTF-8?q?=E8=A7=86=E9=A2=91url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 33 + pom.xml | 67 ++ .../huangge1199/clear/ClearApplication.java | 15 + .../huangge1199/clear/base/ApiErrorCode.java | 57 ++ .../com/huangge1199/clear/base/ErrorCode.java | 20 + .../com/huangge1199/clear/base/Result.java | 74 ++ .../clear/controller/VodController.java | 34 + .../com/huangge1199/clear/entity/MacVod.java | 710 ++++++++++++++++++ .../clear/mapper/MacVodMapper.java | 23 + .../clear/mapper/xml/MacVodMapper.xml | 127 ++++ .../clear/service/MacVodService.java | 18 + .../clear/service/impl/MacVodServiceImpl.java | 69 ++ .../java/com/huangge1199/clear/vo/VodVo.java | 19 + src/main/resources/application.yml | 12 + .../clear/ClearApplicationTests.java | 13 + 15 files changed, 1291 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/com/huangge1199/clear/ClearApplication.java create mode 100644 src/main/java/com/huangge1199/clear/base/ApiErrorCode.java create mode 100644 src/main/java/com/huangge1199/clear/base/ErrorCode.java create mode 100644 src/main/java/com/huangge1199/clear/base/Result.java create mode 100644 src/main/java/com/huangge1199/clear/controller/VodController.java create mode 100644 src/main/java/com/huangge1199/clear/entity/MacVod.java create mode 100644 src/main/java/com/huangge1199/clear/mapper/MacVodMapper.java create mode 100644 src/main/java/com/huangge1199/clear/mapper/xml/MacVodMapper.xml create mode 100644 src/main/java/com/huangge1199/clear/service/MacVodService.java create mode 100644 src/main/java/com/huangge1199/clear/service/impl/MacVodServiceImpl.java create mode 100644 src/main/java/com/huangge1199/clear/vo/VodVo.java create mode 100644 src/main/resources/application.yml create mode 100644 src/test/java/com/huangge1199/clear/ClearApplicationTests.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/.gitignore @@ -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/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9760c3e --- /dev/null +++ b/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.1.2 + + + com.huangge1199 + clear + 0.0.1-SNAPSHOT + clear + clear + + 17 + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + com.baomidou + mybatis-plus-boot-starter + 3.5.3 + + + org.projectlombok + lombok + true + + + mysql + mysql-connector-java + 8.0.17 + + + + com.alibaba + druid + 1.2.8 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + + + diff --git a/src/main/java/com/huangge1199/clear/ClearApplication.java b/src/main/java/com/huangge1199/clear/ClearApplication.java new file mode 100644 index 0000000..10c4978 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/ClearApplication.java @@ -0,0 +1,15 @@ +package com.huangge1199.clear; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@MapperScan("com.huangge1199.clear.mapper") +public class ClearApplication { + + public static void main(String[] args) { + SpringApplication.run(ClearApplication.class, args); + } + +} diff --git a/src/main/java/com/huangge1199/clear/base/ApiErrorCode.java b/src/main/java/com/huangge1199/clear/base/ApiErrorCode.java new file mode 100644 index 0000000..76be40d --- /dev/null +++ b/src/main/java/com/huangge1199/clear/base/ApiErrorCode.java @@ -0,0 +1,57 @@ +package com.huangge1199.clear.base; + +import lombok.Getter; + +/** + * @author hyy + * @Classname ApiErrorCode + * @Description TODO + * @Date 2023/7/26 11:20:40 + */ +@Getter +public enum ApiErrorCode implements ErrorCode { + /** + * 操作失败 + */ + FAILED(-1, "操作失败"), + /** + * 执行成功 + */ + SUCCESS(200, "请求成功"), + /** + * 客户端引起的--请求参数格式错误 + */ + ERR_BAD_REQUEST(400, "请求参数格式错误!"), + /** + * (未授权) 请求要求身份验证。 + */ + UNAUTHORIZED(401, "权限不足!"), + /** + * 客户端引起的--JWT--过期 + */ + ERR_TOKEN_EXPIRED(401, "Token已过期!"), + /** + * 客户端引起的--JWT--数据无效 + */ + ERR_TOKEN_MALFORMED(401, "Token解析错误!"), + /** + * 服务端引起的--插入数据错误 + */ + ERR_INSERT(500, "插入数据错误"), + /** + * 服务端引起的--更新数据错误 + */ + ERR_UPDATE(500, "更新数据错误"), + /** + * 服务端引起的--服务器内部错误 + */ + ERR_INTERNAL_SERVER_ERROR(500, "服务器内部错误"); + + private final long code; + private final String message; + + ApiErrorCode(final long code, final String message) { + this.code = code; + this.message = message; + } +} diff --git a/src/main/java/com/huangge1199/clear/base/ErrorCode.java b/src/main/java/com/huangge1199/clear/base/ErrorCode.java new file mode 100644 index 0000000..35ab185 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/base/ErrorCode.java @@ -0,0 +1,20 @@ +package com.huangge1199.clear.base; + +/** + * @author hyy + * @Classname ErrorCode + * @Description TODO + * @Date 2023/7/26 11:15:03 + */ +public interface ErrorCode { + + /** + * 错误编码 -1、失败 0、成功 + */ + long getCode(); + + /** + * 错误描述 + */ + String getMessage(); +} diff --git a/src/main/java/com/huangge1199/clear/base/Result.java b/src/main/java/com/huangge1199/clear/base/Result.java new file mode 100644 index 0000000..6661e26 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/base/Result.java @@ -0,0 +1,74 @@ +package com.huangge1199.clear.base; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Optional; + +/** + * @author hyy + * @Classname vodController + * @Description TODO + * @Date 2023/7/26 11:13:03 + */ +@Data +public class Result implements Serializable { + + private static final long serialVersionUID = 1L; + + private long code; + + private T data; + + private String message; + + private Result(){ + // to do nothing + } + + public Result(ErrorCode errorCode) { + errorCode = Optional.ofNullable(errorCode).orElse(ApiErrorCode.FAILED); + this.code = errorCode.getCode(); + this.message = errorCode.getMessage(); + } + + public static Result ok() { + return restResult(null, ApiErrorCode.SUCCESS); + } + + public static Result ok(T data) { + ApiErrorCode aec = ApiErrorCode.SUCCESS; + if (data instanceof Boolean && Boolean.FALSE.equals(data)) { + aec = ApiErrorCode.FAILED; + } + return restResult(data, aec); + } + + public static Result failed(String message) { + return restResult(null, ApiErrorCode.FAILED.getCode(), message); + } + + public static Result failed(ErrorCode errorCode) { + return restResult(null, errorCode); + } + + public static Result failed(long errorCode, String message) { + return restResult(null, errorCode, message); + } + + public static Result failed(ErrorCode errorCode, String message) { + return restResult(null, errorCode.getCode(), message); + } + + public static Result restResult(T data, ErrorCode errorCode) { + return restResult(data, errorCode.getCode(), errorCode.getMessage()); + } + + private static Result restResult(T data, long code, String message) { + Result apiResult = new Result<>(); + apiResult.setCode(code); + apiResult.setData(data); + apiResult.setMessage(message); + return apiResult; + } +} diff --git a/src/main/java/com/huangge1199/clear/controller/VodController.java b/src/main/java/com/huangge1199/clear/controller/VodController.java new file mode 100644 index 0000000..a7b7b5a --- /dev/null +++ b/src/main/java/com/huangge1199/clear/controller/VodController.java @@ -0,0 +1,34 @@ +package com.huangge1199.clear.controller; + +import com.huangge1199.clear.base.Result; +import com.huangge1199.clear.entity.MacVod; +import com.huangge1199.clear.service.MacVodService; +import com.huangge1199.clear.vo.VodVo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +/** + * @author hyy + * @Classname vodController + * @Description TODO + * @Date 2023/7/26 11:13:03 + */ +@RestController +@RequestMapping("/data") +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class VodController { + + private final MacVodService macVodService; + + @GetMapping("/all") + public Result> deal() { + List list = macVodService.deal(); + return Result.ok(list); + } +} diff --git a/src/main/java/com/huangge1199/clear/entity/MacVod.java b/src/main/java/com/huangge1199/clear/entity/MacVod.java new file mode 100644 index 0000000..118caa5 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/entity/MacVod.java @@ -0,0 +1,710 @@ +package com.huangge1199.clear.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import lombok.Data; + +/** + * + * @TableName mac_vod + */ +@TableName(value ="mac_vod") +@Data +public class MacVod implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer vodId; + + /** + * + */ + private Integer typeId; + + /** + * + */ + @TableField("type_id_1") + private Integer typeId1; + + /** + * + */ + private Integer groupId; + + /** + * + */ + private String vodName; + + /** + * + */ + private String vodSub; + + /** + * + */ + private String vodEn; + + /** + * + */ + private Integer vodStatus; + + /** + * + */ + private String vodLetter; + + /** + * + */ + private String vodColor; + + /** + * + */ + private String vodTag; + + /** + * + */ + private String vodClass; + + /** + * + */ + private String vodPic; + + /** + * + */ + private String vodPicThumb; + + /** + * + */ + private String vodPicSlide; + + /** + * + */ + private String vodPicScreenshot; + + /** + * + */ + private String vodActor; + + /** + * + */ + private String vodDirector; + + /** + * + */ + private String vodWriter; + + /** + * + */ + private String vodBehind; + + /** + * + */ + private String vodBlurb; + + /** + * + */ + private String vodRemarks; + + /** + * + */ + private String vodPubdate; + + /** + * + */ + private Object vodTotal; + + /** + * + */ + private String vodSerial; + + /** + * + */ + private String vodTv; + + /** + * + */ + private String vodWeekday; + + /** + * + */ + private String vodArea; + + /** + * + */ + private String vodLang; + + /** + * + */ + private String vodYear; + + /** + * + */ + private String vodVersion; + + /** + * + */ + private String vodState; + + /** + * + */ + private String vodAuthor; + + /** + * + */ + private String vodJumpurl; + + /** + * + */ + private String vodTpl; + + /** + * + */ + private String vodTplPlay; + + /** + * + */ + private String vodTplDown; + + /** + * + */ + private Integer vodIsend; + + /** + * + */ + private Integer vodLock; + + /** + * + */ + private Integer vodLevel; + + /** + * + */ + private Integer vodCopyright; + + /** + * + */ + private Integer vodPoints; + + /** + * + */ + private Integer vodPointsPlay; + + /** + * + */ + private Integer vodPointsDown; + + /** + * + */ + private Object vodHits; + + /** + * + */ + private Object vodHitsDay; + + /** + * + */ + private Object vodHitsWeek; + + /** + * + */ + private Object vodHitsMonth; + + /** + * + */ + private String vodDuration; + + /** + * + */ + private Object vodUp; + + /** + * + */ + private Object vodDown; + + /** + * + */ + private BigDecimal vodScore; + + /** + * + */ + private Object vodScoreAll; + + /** + * + */ + private Object vodScoreNum; + + /** + * + */ + private Integer vodTime; + + /** + * + */ + private Integer vodTimeAdd; + + /** + * + */ + private Integer vodTimeHits; + + /** + * + */ + private Integer vodTimeMake; + + /** + * + */ + private Integer vodTrysee; + + /** + * + */ + private Integer vodDoubanId; + + /** + * + */ + private BigDecimal vodDoubanScore; + + /** + * + */ + private String vodReurl; + + /** + * + */ + private String vodRelVod; + + /** + * + */ + private String vodRelArt; + + /** + * + */ + private String vodPwd; + + /** + * + */ + private String vodPwdUrl; + + /** + * + */ + private String vodPwdPlay; + + /** + * + */ + private String vodPwdPlayUrl; + + /** + * + */ + private String vodPwdDown; + + /** + * + */ + private String vodPwdDownUrl; + + /** + * + */ + private String vodContent; + + /** + * + */ + private String vodPlayFrom; + + /** + * + */ + private String vodPlayServer; + + /** + * + */ + private String vodPlayNote; + + /** + * + */ + private String vodPlayUrl; + + /** + * + */ + private String vodDownFrom; + + /** + * + */ + private String vodDownServer; + + /** + * + */ + private String vodDownNote; + + /** + * + */ + private String vodDownUrl; + + /** + * + */ + private Integer vodPlot; + + /** + * + */ + private String vodPlotName; + + /** + * + */ + private String vodPlotDetail; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + MacVod other = (MacVod) that; + return (this.getVodId() == null ? other.getVodId() == null : this.getVodId().equals(other.getVodId())) + && (this.getTypeId() == null ? other.getTypeId() == null : this.getTypeId().equals(other.getTypeId())) + && (this.getTypeId1() == null ? other.getTypeId1() == null : this.getTypeId1().equals(other.getTypeId1())) + && (this.getGroupId() == null ? other.getGroupId() == null : this.getGroupId().equals(other.getGroupId())) + && (this.getVodName() == null ? other.getVodName() == null : this.getVodName().equals(other.getVodName())) + && (this.getVodSub() == null ? other.getVodSub() == null : this.getVodSub().equals(other.getVodSub())) + && (this.getVodEn() == null ? other.getVodEn() == null : this.getVodEn().equals(other.getVodEn())) + && (this.getVodStatus() == null ? other.getVodStatus() == null : this.getVodStatus().equals(other.getVodStatus())) + && (this.getVodLetter() == null ? other.getVodLetter() == null : this.getVodLetter().equals(other.getVodLetter())) + && (this.getVodColor() == null ? other.getVodColor() == null : this.getVodColor().equals(other.getVodColor())) + && (this.getVodTag() == null ? other.getVodTag() == null : this.getVodTag().equals(other.getVodTag())) + && (this.getVodClass() == null ? other.getVodClass() == null : this.getVodClass().equals(other.getVodClass())) + && (this.getVodPic() == null ? other.getVodPic() == null : this.getVodPic().equals(other.getVodPic())) + && (this.getVodPicThumb() == null ? other.getVodPicThumb() == null : this.getVodPicThumb().equals(other.getVodPicThumb())) + && (this.getVodPicSlide() == null ? other.getVodPicSlide() == null : this.getVodPicSlide().equals(other.getVodPicSlide())) + && (this.getVodPicScreenshot() == null ? other.getVodPicScreenshot() == null : this.getVodPicScreenshot().equals(other.getVodPicScreenshot())) + && (this.getVodActor() == null ? other.getVodActor() == null : this.getVodActor().equals(other.getVodActor())) + && (this.getVodDirector() == null ? other.getVodDirector() == null : this.getVodDirector().equals(other.getVodDirector())) + && (this.getVodWriter() == null ? other.getVodWriter() == null : this.getVodWriter().equals(other.getVodWriter())) + && (this.getVodBehind() == null ? other.getVodBehind() == null : this.getVodBehind().equals(other.getVodBehind())) + && (this.getVodBlurb() == null ? other.getVodBlurb() == null : this.getVodBlurb().equals(other.getVodBlurb())) + && (this.getVodRemarks() == null ? other.getVodRemarks() == null : this.getVodRemarks().equals(other.getVodRemarks())) + && (this.getVodPubdate() == null ? other.getVodPubdate() == null : this.getVodPubdate().equals(other.getVodPubdate())) + && (this.getVodTotal() == null ? other.getVodTotal() == null : this.getVodTotal().equals(other.getVodTotal())) + && (this.getVodSerial() == null ? other.getVodSerial() == null : this.getVodSerial().equals(other.getVodSerial())) + && (this.getVodTv() == null ? other.getVodTv() == null : this.getVodTv().equals(other.getVodTv())) + && (this.getVodWeekday() == null ? other.getVodWeekday() == null : this.getVodWeekday().equals(other.getVodWeekday())) + && (this.getVodArea() == null ? other.getVodArea() == null : this.getVodArea().equals(other.getVodArea())) + && (this.getVodLang() == null ? other.getVodLang() == null : this.getVodLang().equals(other.getVodLang())) + && (this.getVodYear() == null ? other.getVodYear() == null : this.getVodYear().equals(other.getVodYear())) + && (this.getVodVersion() == null ? other.getVodVersion() == null : this.getVodVersion().equals(other.getVodVersion())) + && (this.getVodState() == null ? other.getVodState() == null : this.getVodState().equals(other.getVodState())) + && (this.getVodAuthor() == null ? other.getVodAuthor() == null : this.getVodAuthor().equals(other.getVodAuthor())) + && (this.getVodJumpurl() == null ? other.getVodJumpurl() == null : this.getVodJumpurl().equals(other.getVodJumpurl())) + && (this.getVodTpl() == null ? other.getVodTpl() == null : this.getVodTpl().equals(other.getVodTpl())) + && (this.getVodTplPlay() == null ? other.getVodTplPlay() == null : this.getVodTplPlay().equals(other.getVodTplPlay())) + && (this.getVodTplDown() == null ? other.getVodTplDown() == null : this.getVodTplDown().equals(other.getVodTplDown())) + && (this.getVodIsend() == null ? other.getVodIsend() == null : this.getVodIsend().equals(other.getVodIsend())) + && (this.getVodLock() == null ? other.getVodLock() == null : this.getVodLock().equals(other.getVodLock())) + && (this.getVodLevel() == null ? other.getVodLevel() == null : this.getVodLevel().equals(other.getVodLevel())) + && (this.getVodCopyright() == null ? other.getVodCopyright() == null : this.getVodCopyright().equals(other.getVodCopyright())) + && (this.getVodPoints() == null ? other.getVodPoints() == null : this.getVodPoints().equals(other.getVodPoints())) + && (this.getVodPointsPlay() == null ? other.getVodPointsPlay() == null : this.getVodPointsPlay().equals(other.getVodPointsPlay())) + && (this.getVodPointsDown() == null ? other.getVodPointsDown() == null : this.getVodPointsDown().equals(other.getVodPointsDown())) + && (this.getVodHits() == null ? other.getVodHits() == null : this.getVodHits().equals(other.getVodHits())) + && (this.getVodHitsDay() == null ? other.getVodHitsDay() == null : this.getVodHitsDay().equals(other.getVodHitsDay())) + && (this.getVodHitsWeek() == null ? other.getVodHitsWeek() == null : this.getVodHitsWeek().equals(other.getVodHitsWeek())) + && (this.getVodHitsMonth() == null ? other.getVodHitsMonth() == null : this.getVodHitsMonth().equals(other.getVodHitsMonth())) + && (this.getVodDuration() == null ? other.getVodDuration() == null : this.getVodDuration().equals(other.getVodDuration())) + && (this.getVodUp() == null ? other.getVodUp() == null : this.getVodUp().equals(other.getVodUp())) + && (this.getVodDown() == null ? other.getVodDown() == null : this.getVodDown().equals(other.getVodDown())) + && (this.getVodScore() == null ? other.getVodScore() == null : this.getVodScore().equals(other.getVodScore())) + && (this.getVodScoreAll() == null ? other.getVodScoreAll() == null : this.getVodScoreAll().equals(other.getVodScoreAll())) + && (this.getVodScoreNum() == null ? other.getVodScoreNum() == null : this.getVodScoreNum().equals(other.getVodScoreNum())) + && (this.getVodTime() == null ? other.getVodTime() == null : this.getVodTime().equals(other.getVodTime())) + && (this.getVodTimeAdd() == null ? other.getVodTimeAdd() == null : this.getVodTimeAdd().equals(other.getVodTimeAdd())) + && (this.getVodTimeHits() == null ? other.getVodTimeHits() == null : this.getVodTimeHits().equals(other.getVodTimeHits())) + && (this.getVodTimeMake() == null ? other.getVodTimeMake() == null : this.getVodTimeMake().equals(other.getVodTimeMake())) + && (this.getVodTrysee() == null ? other.getVodTrysee() == null : this.getVodTrysee().equals(other.getVodTrysee())) + && (this.getVodDoubanId() == null ? other.getVodDoubanId() == null : this.getVodDoubanId().equals(other.getVodDoubanId())) + && (this.getVodDoubanScore() == null ? other.getVodDoubanScore() == null : this.getVodDoubanScore().equals(other.getVodDoubanScore())) + && (this.getVodReurl() == null ? other.getVodReurl() == null : this.getVodReurl().equals(other.getVodReurl())) + && (this.getVodRelVod() == null ? other.getVodRelVod() == null : this.getVodRelVod().equals(other.getVodRelVod())) + && (this.getVodRelArt() == null ? other.getVodRelArt() == null : this.getVodRelArt().equals(other.getVodRelArt())) + && (this.getVodPwd() == null ? other.getVodPwd() == null : this.getVodPwd().equals(other.getVodPwd())) + && (this.getVodPwdUrl() == null ? other.getVodPwdUrl() == null : this.getVodPwdUrl().equals(other.getVodPwdUrl())) + && (this.getVodPwdPlay() == null ? other.getVodPwdPlay() == null : this.getVodPwdPlay().equals(other.getVodPwdPlay())) + && (this.getVodPwdPlayUrl() == null ? other.getVodPwdPlayUrl() == null : this.getVodPwdPlayUrl().equals(other.getVodPwdPlayUrl())) + && (this.getVodPwdDown() == null ? other.getVodPwdDown() == null : this.getVodPwdDown().equals(other.getVodPwdDown())) + && (this.getVodPwdDownUrl() == null ? other.getVodPwdDownUrl() == null : this.getVodPwdDownUrl().equals(other.getVodPwdDownUrl())) + && (this.getVodContent() == null ? other.getVodContent() == null : this.getVodContent().equals(other.getVodContent())) + && (this.getVodPlayFrom() == null ? other.getVodPlayFrom() == null : this.getVodPlayFrom().equals(other.getVodPlayFrom())) + && (this.getVodPlayServer() == null ? other.getVodPlayServer() == null : this.getVodPlayServer().equals(other.getVodPlayServer())) + && (this.getVodPlayNote() == null ? other.getVodPlayNote() == null : this.getVodPlayNote().equals(other.getVodPlayNote())) + && (this.getVodPlayUrl() == null ? other.getVodPlayUrl() == null : this.getVodPlayUrl().equals(other.getVodPlayUrl())) + && (this.getVodDownFrom() == null ? other.getVodDownFrom() == null : this.getVodDownFrom().equals(other.getVodDownFrom())) + && (this.getVodDownServer() == null ? other.getVodDownServer() == null : this.getVodDownServer().equals(other.getVodDownServer())) + && (this.getVodDownNote() == null ? other.getVodDownNote() == null : this.getVodDownNote().equals(other.getVodDownNote())) + && (this.getVodDownUrl() == null ? other.getVodDownUrl() == null : this.getVodDownUrl().equals(other.getVodDownUrl())) + && (this.getVodPlot() == null ? other.getVodPlot() == null : this.getVodPlot().equals(other.getVodPlot())) + && (this.getVodPlotName() == null ? other.getVodPlotName() == null : this.getVodPlotName().equals(other.getVodPlotName())) + && (this.getVodPlotDetail() == null ? other.getVodPlotDetail() == null : this.getVodPlotDetail().equals(other.getVodPlotDetail())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getVodId() == null) ? 0 : getVodId().hashCode()); + result = prime * result + ((getTypeId() == null) ? 0 : getTypeId().hashCode()); + result = prime * result + ((getTypeId1() == null) ? 0 : getTypeId1().hashCode()); + result = prime * result + ((getGroupId() == null) ? 0 : getGroupId().hashCode()); + result = prime * result + ((getVodName() == null) ? 0 : getVodName().hashCode()); + result = prime * result + ((getVodSub() == null) ? 0 : getVodSub().hashCode()); + result = prime * result + ((getVodEn() == null) ? 0 : getVodEn().hashCode()); + result = prime * result + ((getVodStatus() == null) ? 0 : getVodStatus().hashCode()); + result = prime * result + ((getVodLetter() == null) ? 0 : getVodLetter().hashCode()); + result = prime * result + ((getVodColor() == null) ? 0 : getVodColor().hashCode()); + result = prime * result + ((getVodTag() == null) ? 0 : getVodTag().hashCode()); + result = prime * result + ((getVodClass() == null) ? 0 : getVodClass().hashCode()); + result = prime * result + ((getVodPic() == null) ? 0 : getVodPic().hashCode()); + result = prime * result + ((getVodPicThumb() == null) ? 0 : getVodPicThumb().hashCode()); + result = prime * result + ((getVodPicSlide() == null) ? 0 : getVodPicSlide().hashCode()); + result = prime * result + ((getVodPicScreenshot() == null) ? 0 : getVodPicScreenshot().hashCode()); + result = prime * result + ((getVodActor() == null) ? 0 : getVodActor().hashCode()); + result = prime * result + ((getVodDirector() == null) ? 0 : getVodDirector().hashCode()); + result = prime * result + ((getVodWriter() == null) ? 0 : getVodWriter().hashCode()); + result = prime * result + ((getVodBehind() == null) ? 0 : getVodBehind().hashCode()); + result = prime * result + ((getVodBlurb() == null) ? 0 : getVodBlurb().hashCode()); + result = prime * result + ((getVodRemarks() == null) ? 0 : getVodRemarks().hashCode()); + result = prime * result + ((getVodPubdate() == null) ? 0 : getVodPubdate().hashCode()); + result = prime * result + ((getVodTotal() == null) ? 0 : getVodTotal().hashCode()); + result = prime * result + ((getVodSerial() == null) ? 0 : getVodSerial().hashCode()); + result = prime * result + ((getVodTv() == null) ? 0 : getVodTv().hashCode()); + result = prime * result + ((getVodWeekday() == null) ? 0 : getVodWeekday().hashCode()); + result = prime * result + ((getVodArea() == null) ? 0 : getVodArea().hashCode()); + result = prime * result + ((getVodLang() == null) ? 0 : getVodLang().hashCode()); + result = prime * result + ((getVodYear() == null) ? 0 : getVodYear().hashCode()); + result = prime * result + ((getVodVersion() == null) ? 0 : getVodVersion().hashCode()); + result = prime * result + ((getVodState() == null) ? 0 : getVodState().hashCode()); + result = prime * result + ((getVodAuthor() == null) ? 0 : getVodAuthor().hashCode()); + result = prime * result + ((getVodJumpurl() == null) ? 0 : getVodJumpurl().hashCode()); + result = prime * result + ((getVodTpl() == null) ? 0 : getVodTpl().hashCode()); + result = prime * result + ((getVodTplPlay() == null) ? 0 : getVodTplPlay().hashCode()); + result = prime * result + ((getVodTplDown() == null) ? 0 : getVodTplDown().hashCode()); + result = prime * result + ((getVodIsend() == null) ? 0 : getVodIsend().hashCode()); + result = prime * result + ((getVodLock() == null) ? 0 : getVodLock().hashCode()); + result = prime * result + ((getVodLevel() == null) ? 0 : getVodLevel().hashCode()); + result = prime * result + ((getVodCopyright() == null) ? 0 : getVodCopyright().hashCode()); + result = prime * result + ((getVodPoints() == null) ? 0 : getVodPoints().hashCode()); + result = prime * result + ((getVodPointsPlay() == null) ? 0 : getVodPointsPlay().hashCode()); + result = prime * result + ((getVodPointsDown() == null) ? 0 : getVodPointsDown().hashCode()); + result = prime * result + ((getVodHits() == null) ? 0 : getVodHits().hashCode()); + result = prime * result + ((getVodHitsDay() == null) ? 0 : getVodHitsDay().hashCode()); + result = prime * result + ((getVodHitsWeek() == null) ? 0 : getVodHitsWeek().hashCode()); + result = prime * result + ((getVodHitsMonth() == null) ? 0 : getVodHitsMonth().hashCode()); + result = prime * result + ((getVodDuration() == null) ? 0 : getVodDuration().hashCode()); + result = prime * result + ((getVodUp() == null) ? 0 : getVodUp().hashCode()); + result = prime * result + ((getVodDown() == null) ? 0 : getVodDown().hashCode()); + result = prime * result + ((getVodScore() == null) ? 0 : getVodScore().hashCode()); + result = prime * result + ((getVodScoreAll() == null) ? 0 : getVodScoreAll().hashCode()); + result = prime * result + ((getVodScoreNum() == null) ? 0 : getVodScoreNum().hashCode()); + result = prime * result + ((getVodTime() == null) ? 0 : getVodTime().hashCode()); + result = prime * result + ((getVodTimeAdd() == null) ? 0 : getVodTimeAdd().hashCode()); + result = prime * result + ((getVodTimeHits() == null) ? 0 : getVodTimeHits().hashCode()); + result = prime * result + ((getVodTimeMake() == null) ? 0 : getVodTimeMake().hashCode()); + result = prime * result + ((getVodTrysee() == null) ? 0 : getVodTrysee().hashCode()); + result = prime * result + ((getVodDoubanId() == null) ? 0 : getVodDoubanId().hashCode()); + result = prime * result + ((getVodDoubanScore() == null) ? 0 : getVodDoubanScore().hashCode()); + result = prime * result + ((getVodReurl() == null) ? 0 : getVodReurl().hashCode()); + result = prime * result + ((getVodRelVod() == null) ? 0 : getVodRelVod().hashCode()); + result = prime * result + ((getVodRelArt() == null) ? 0 : getVodRelArt().hashCode()); + result = prime * result + ((getVodPwd() == null) ? 0 : getVodPwd().hashCode()); + result = prime * result + ((getVodPwdUrl() == null) ? 0 : getVodPwdUrl().hashCode()); + result = prime * result + ((getVodPwdPlay() == null) ? 0 : getVodPwdPlay().hashCode()); + result = prime * result + ((getVodPwdPlayUrl() == null) ? 0 : getVodPwdPlayUrl().hashCode()); + result = prime * result + ((getVodPwdDown() == null) ? 0 : getVodPwdDown().hashCode()); + result = prime * result + ((getVodPwdDownUrl() == null) ? 0 : getVodPwdDownUrl().hashCode()); + result = prime * result + ((getVodContent() == null) ? 0 : getVodContent().hashCode()); + result = prime * result + ((getVodPlayFrom() == null) ? 0 : getVodPlayFrom().hashCode()); + result = prime * result + ((getVodPlayServer() == null) ? 0 : getVodPlayServer().hashCode()); + result = prime * result + ((getVodPlayNote() == null) ? 0 : getVodPlayNote().hashCode()); + result = prime * result + ((getVodPlayUrl() == null) ? 0 : getVodPlayUrl().hashCode()); + result = prime * result + ((getVodDownFrom() == null) ? 0 : getVodDownFrom().hashCode()); + result = prime * result + ((getVodDownServer() == null) ? 0 : getVodDownServer().hashCode()); + result = prime * result + ((getVodDownNote() == null) ? 0 : getVodDownNote().hashCode()); + result = prime * result + ((getVodDownUrl() == null) ? 0 : getVodDownUrl().hashCode()); + result = prime * result + ((getVodPlot() == null) ? 0 : getVodPlot().hashCode()); + result = prime * result + ((getVodPlotName() == null) ? 0 : getVodPlotName().hashCode()); + result = prime * result + ((getVodPlotDetail() == null) ? 0 : getVodPlotDetail().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", vodId=").append(vodId); + sb.append(", typeId=").append(typeId); + sb.append(", typeId1=").append(typeId1); + sb.append(", groupId=").append(groupId); + sb.append(", vodName=").append(vodName); + sb.append(", vodSub=").append(vodSub); + sb.append(", vodEn=").append(vodEn); + sb.append(", vodStatus=").append(vodStatus); + sb.append(", vodLetter=").append(vodLetter); + sb.append(", vodColor=").append(vodColor); + sb.append(", vodTag=").append(vodTag); + sb.append(", vodClass=").append(vodClass); + sb.append(", vodPic=").append(vodPic); + sb.append(", vodPicThumb=").append(vodPicThumb); + sb.append(", vodPicSlide=").append(vodPicSlide); + sb.append(", vodPicScreenshot=").append(vodPicScreenshot); + sb.append(", vodActor=").append(vodActor); + sb.append(", vodDirector=").append(vodDirector); + sb.append(", vodWriter=").append(vodWriter); + sb.append(", vodBehind=").append(vodBehind); + sb.append(", vodBlurb=").append(vodBlurb); + sb.append(", vodRemarks=").append(vodRemarks); + sb.append(", vodPubdate=").append(vodPubdate); + sb.append(", vodTotal=").append(vodTotal); + sb.append(", vodSerial=").append(vodSerial); + sb.append(", vodTv=").append(vodTv); + sb.append(", vodWeekday=").append(vodWeekday); + sb.append(", vodArea=").append(vodArea); + sb.append(", vodLang=").append(vodLang); + sb.append(", vodYear=").append(vodYear); + sb.append(", vodVersion=").append(vodVersion); + sb.append(", vodState=").append(vodState); + sb.append(", vodAuthor=").append(vodAuthor); + sb.append(", vodJumpurl=").append(vodJumpurl); + sb.append(", vodTpl=").append(vodTpl); + sb.append(", vodTplPlay=").append(vodTplPlay); + sb.append(", vodTplDown=").append(vodTplDown); + sb.append(", vodIsend=").append(vodIsend); + sb.append(", vodLock=").append(vodLock); + sb.append(", vodLevel=").append(vodLevel); + sb.append(", vodCopyright=").append(vodCopyright); + sb.append(", vodPoints=").append(vodPoints); + sb.append(", vodPointsPlay=").append(vodPointsPlay); + sb.append(", vodPointsDown=").append(vodPointsDown); + sb.append(", vodHits=").append(vodHits); + sb.append(", vodHitsDay=").append(vodHitsDay); + sb.append(", vodHitsWeek=").append(vodHitsWeek); + sb.append(", vodHitsMonth=").append(vodHitsMonth); + sb.append(", vodDuration=").append(vodDuration); + sb.append(", vodUp=").append(vodUp); + sb.append(", vodDown=").append(vodDown); + sb.append(", vodScore=").append(vodScore); + sb.append(", vodScoreAll=").append(vodScoreAll); + sb.append(", vodScoreNum=").append(vodScoreNum); + sb.append(", vodTime=").append(vodTime); + sb.append(", vodTimeAdd=").append(vodTimeAdd); + sb.append(", vodTimeHits=").append(vodTimeHits); + sb.append(", vodTimeMake=").append(vodTimeMake); + sb.append(", vodTrysee=").append(vodTrysee); + sb.append(", vodDoubanId=").append(vodDoubanId); + sb.append(", vodDoubanScore=").append(vodDoubanScore); + sb.append(", vodReurl=").append(vodReurl); + sb.append(", vodRelVod=").append(vodRelVod); + sb.append(", vodRelArt=").append(vodRelArt); + sb.append(", vodPwd=").append(vodPwd); + sb.append(", vodPwdUrl=").append(vodPwdUrl); + sb.append(", vodPwdPlay=").append(vodPwdPlay); + sb.append(", vodPwdPlayUrl=").append(vodPwdPlayUrl); + sb.append(", vodPwdDown=").append(vodPwdDown); + sb.append(", vodPwdDownUrl=").append(vodPwdDownUrl); + sb.append(", vodContent=").append(vodContent); + sb.append(", vodPlayFrom=").append(vodPlayFrom); + sb.append(", vodPlayServer=").append(vodPlayServer); + sb.append(", vodPlayNote=").append(vodPlayNote); + sb.append(", vodPlayUrl=").append(vodPlayUrl); + sb.append(", vodDownFrom=").append(vodDownFrom); + sb.append(", vodDownServer=").append(vodDownServer); + sb.append(", vodDownNote=").append(vodDownNote); + sb.append(", vodDownUrl=").append(vodDownUrl); + sb.append(", vodPlot=").append(vodPlot); + sb.append(", vodPlotName=").append(vodPlotName); + sb.append(", vodPlotDetail=").append(vodPlotDetail); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/huangge1199/clear/mapper/MacVodMapper.java b/src/main/java/com/huangge1199/clear/mapper/MacVodMapper.java new file mode 100644 index 0000000..508a4ec --- /dev/null +++ b/src/main/java/com/huangge1199/clear/mapper/MacVodMapper.java @@ -0,0 +1,23 @@ +package com.huangge1199.clear.mapper; + +import com.huangge1199.clear.entity.MacVod; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** +* @author hyy +* @description 针对表【mac_vod】的数据库操作Mapper +* @createDate 2023-07-26 11:12:38 +* @Entity com.huangge1199.clear.entity.MacVod +*/ +@Mapper +public interface MacVodMapper extends BaseMapper { + + List showByDay(); +} + + + + diff --git a/src/main/java/com/huangge1199/clear/mapper/xml/MacVodMapper.xml b/src/main/java/com/huangge1199/clear/mapper/xml/MacVodMapper.xml new file mode 100644 index 0000000..a762f26 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/mapper/xml/MacVodMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vod_id,type_id,type_id_1, + group_id,vod_name,vod_sub, + vod_en,vod_status,vod_letter, + vod_color,vod_tag,vod_class, + vod_pic,vod_pic_thumb,vod_pic_slide, + vod_pic_screenshot,vod_actor,vod_director, + vod_writer,vod_behind,vod_blurb, + vod_remarks,vod_pubdate,vod_total, + vod_serial,vod_tv,vod_weekday, + vod_area,vod_lang,vod_year, + vod_version,vod_state,vod_author, + vod_jumpurl,vod_tpl,vod_tpl_play, + vod_tpl_down,vod_isend,vod_lock, + vod_level,vod_copyright,vod_points, + vod_points_play,vod_points_down,vod_hits, + vod_hits_day,vod_hits_week,vod_hits_month, + vod_duration,vod_up,vod_down, + vod_score,vod_score_all,vod_score_num, + vod_time,vod_time_add,vod_time_hits, + vod_time_make,vod_trysee,vod_douban_id, + vod_douban_score,vod_reurl,vod_rel_vod, + vod_rel_art,vod_pwd,vod_pwd_url, + vod_pwd_play,vod_pwd_play_url,vod_pwd_down, + vod_pwd_down_url,vod_content,vod_play_from, + vod_play_server,vod_play_note,vod_play_url, + vod_down_from,vod_down_server,vod_down_note, + vod_down_url,vod_plot,vod_plot_name, + vod_plot_detail + + + diff --git a/src/main/java/com/huangge1199/clear/service/MacVodService.java b/src/main/java/com/huangge1199/clear/service/MacVodService.java new file mode 100644 index 0000000..5008979 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/service/MacVodService.java @@ -0,0 +1,18 @@ +package com.huangge1199.clear.service; + +import com.huangge1199.clear.entity.MacVod; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huangge1199.clear.vo.VodVo; + +import java.util.List; +import java.util.Map; + +/** +* @author hyy +* @description 针对表【mac_vod】的数据库操作Service +* @createDate 2023-07-26 11:12:38 +*/ +public interface MacVodService extends IService { + + List deal(); +} diff --git a/src/main/java/com/huangge1199/clear/service/impl/MacVodServiceImpl.java b/src/main/java/com/huangge1199/clear/service/impl/MacVodServiceImpl.java new file mode 100644 index 0000000..68fb093 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/service/impl/MacVodServiceImpl.java @@ -0,0 +1,69 @@ +package com.huangge1199.clear.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huangge1199.clear.entity.MacVod; +import com.huangge1199.clear.service.MacVodService; +import com.huangge1199.clear.mapper.MacVodMapper; +import com.huangge1199.clear.vo.VodVo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * @author hyy + * @description 针对表【mac_vod】的数据库操作Service实现 + * @createDate 2023-07-26 11:12:38 + */ +@Service +@RequiredArgsConstructor(onConstructor = @__(@Autowired)) +public class MacVodServiceImpl extends ServiceImpl + implements MacVodService { + + private final MacVodMapper macVodMapper; + + @Override + @Transactional + public List deal() { + List list = new ArrayList<>(); + List macVodList = macVodMapper.showByDay(); + + for (MacVod macVod : macVodList) { + String url = macVod.getVodPlayUrl().replace(" ", ""); + if (!url.contains("$$$")) { + continue; + } + String[] groups = url.split("\\$\\$\\$"); + if (groups.length == 1) { + continue; + } + String playUrl = ""+groups[groups.length-2]+"$$$"+groups[groups.length-1]; +// List froms = new ArrayList<>(); +// for (String group:groups){ +// if(group.contains("#")){ +// String[] strs = group.split("#"); +// for (String str:strs){ +// if(!froms.contains(str)){ +// froms.add(str); +// } +// } +// }else { +// if(!froms.contains(group)){ +// froms.add(group); +// } +// } +// } + macVod.setVodPlayUrl(playUrl); + macVodMapper.updateById(macVod); + } + + return list; + } +} + + + + diff --git a/src/main/java/com/huangge1199/clear/vo/VodVo.java b/src/main/java/com/huangge1199/clear/vo/VodVo.java new file mode 100644 index 0000000..513b576 --- /dev/null +++ b/src/main/java/com/huangge1199/clear/vo/VodVo.java @@ -0,0 +1,19 @@ +package com.huangge1199.clear.vo; + +import lombok.Data; + +import java.util.List; + +/** + * @author hyy + * @Classname vodVo + * @Description TODO + * @Date 2023/7/26 11:53:50 + */ +@Data +public class VodVo { + + String name; + List oldPlayUrl; + List newPlayUrl; +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..343a71d --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,12 @@ +server: + port: 1111 +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://192.168.0.198:3306/cms?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false + username: root + password: huangge1199 + type: com.alibaba.druid.pool.DruidDataSource +mybatis-plus: + mapper-locations: classpath:/com/huangge1199/clear/mapper/xml/*Mapper.xml + typeAliasesPackage: com.huangge1199.clear.entity \ No newline at end of file diff --git a/src/test/java/com/huangge1199/clear/ClearApplicationTests.java b/src/test/java/com/huangge1199/clear/ClearApplicationTests.java new file mode 100644 index 0000000..0a5149d --- /dev/null +++ b/src/test/java/com/huangge1199/clear/ClearApplicationTests.java @@ -0,0 +1,13 @@ +package com.huangge1199.clear; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ClearApplicationTests { + + @Test + void contextLoads() { + } + +}