Skip to content

Commit

Permalink
1.修改前段增加前预览
Browse files Browse the repository at this point in the history
2.优化其他源错误
  • Loading branch information
a13087635768 committed Aug 19, 2024
1 parent 3a6f687 commit 2a4b1c1
Show file tree
Hide file tree
Showing 61 changed files with 4,014 additions and 2,672 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/sqmusicplus/base/entity/DownloadInfo.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.sqmusicplus.base.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
Expand Down Expand Up @@ -34,6 +37,8 @@ public class DownloadInfo implements Serializable {
private String downloadType;

@TableField("download_time")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date downloadTime;

@TableField("download_file")
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/sqmusicplus/base/entity/SqConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class SqConfig implements Serializable {
public static final String COL_CONFIG_VALUE = "config_value";
public static final String COL_CONFIG_KEY = "config_key";
public static final String COL_TYPE = "type";
public static final String COL_CONFIG_SHOW = "config_show";
@TableId(value = "config_id", type = IdType.AUTO)
private Integer configId;
@TableField(value = "config_name")
Expand All @@ -35,4 +36,6 @@ public class SqConfig implements Serializable {
private String configKey;
@TableField(value = "type")
private String type;
@TableField(value = "config_show")
private String configShow;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.sqmusicplus.base.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sqmusicplus.base.entity.DownloadInfo;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

/**
* @Classname DownloadInfoSearch
* @Description 下载搜索
* @Version 1.0.0
* @Date 2024/8/15 16:01
* @Created by SQ
*/
@Getter
@Setter
@Accessors(chain = true)
public class DownloadInfoSearch extends DownloadInfo {
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date downloadTimeStart ;


@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@JSONField(format="yyyy-MM-dd HH:mm:ss")
private Date downloadTimeEnd ;


private Integer pageSize;
private Integer pageIndex;
}
2 changes: 1 addition & 1 deletion src/main/java/com/sqmusicplus/config/AutoDdlConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class AutoDdlConfig extends SimpleDdl {
@Override
public List<String> getSqlFiles() {
return CollUtil.newArrayList("db/sqmusic.sql","db/insert_config.sql","db/v2.13.1_updat.sql");
return CollUtil.newArrayList("db/sqmusic.sql","db/insert_config.sql","db/v2.13.1_updat.sql","db/v2.13.3_update.sql");
}

@Bean("ddlApplicationRunner")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sqmusicplus/config/SaTokenConfigure.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
public SaServletFilter getSaServletFilter() {
return new SaServletFilter()
.addInclude("/**")
.addExclude("/**/*.json","/**/*.js","/","/**/*.html","/**/*.css","/**/*.png","/**/*.jpg","/**/*.otf","/**/*.ttf","/**/*.wasm","/login", "/favicon.ico","/isLogin","/set/selectOption","/set/getSetList","/set/getSearchType","/set/getSearchTypeBrType","/set/getSetListByType","/set/getSetListByTypeBrType","/set/getSetListByTypeBrTypeId","/set/getSetListByTypeId","/set/getSetListByTypeIdBrType","/set/getSetListByTypeIdBrTypeId","/set/getSetListByTypeIdBrTypeIdId","/set/check","/download/freemp3")
.addExclude("/**/*.webmanifest","/**/*.svg","/**/*.json","/**/*.js","/","/**/*.html","/**/*.css","/**/*.png","/**/*.jpg","/**/*.otf","/**/*.ttf","/**/*.wasm","/login", "/favicon.ico","/isLogin","/set/selectOption","/set/getSetList","/set/getSearchType","/set/getSearchTypeBrType","/set/getSetListByType","/set/getSetListByTypeBrType","/set/getSetListByTypeBrTypeId","/set/getSetListByTypeId","/set/getSetListByTypeIdBrType","/set/getSetListByTypeIdBrTypeId","/set/getSetListByTypeIdBrTypeIdId","/set/check","/download/freemp3")

.setBeforeAuth(obj -> {
// ---------- 设置跨域响应头 ----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqmusicplus.base.entity.DownloadInfo;
import com.sqmusicplus.base.entity.vo.DownloadInfoSearch;
import com.sqmusicplus.base.service.DownloadInfoService;
import com.sqmusicplus.config.AjaxResult;
import com.sqmusicplus.download.DownloadStatus;
import com.sqmusicplus.task.ScanQQVIPLikeMusic;
import com.sqmusicplus.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -41,6 +43,49 @@ public AjaxResult getDownloadInfo(@PathVariable("type") String type, @PathVariab
return AjaxResult.success(page);
}

@PostMapping("/getDownloadInfo/search")
public AjaxResult getDownloadInfo(@RequestBody DownloadInfoSearch downloadInfo){
LambdaQueryWrapper<DownloadInfo> downloadInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
downloadInfoLambdaQueryWrapper.eq(StringUtils.isNotEmpty(downloadInfo.getStatus()),DownloadInfo::getStatus, downloadInfo.getStatus());
downloadInfoLambdaQueryWrapper.between(downloadInfo.getDownloadTimeStart()!=null&&downloadInfo.getDownloadTimeEnd()!=null,DownloadInfo::getDownloadTime, downloadInfo.getDownloadTimeStart(), downloadInfo.getDownloadTimeEnd());
downloadInfoLambdaQueryWrapper.like(StringUtils.isNotEmpty(downloadInfo.getDownloadMusicname()),DownloadInfo::getDownloadMusicname, downloadInfo.getDownloadMusicname());
downloadInfoLambdaQueryWrapper.like(StringUtils.isNotEmpty(downloadInfo.getDownloadArtistname()),DownloadInfo::getDownloadArtistname, downloadInfo.getDownloadArtistname());
downloadInfoLambdaQueryWrapper.like(StringUtils.isNotEmpty(downloadInfo.getDownloadAlbumname()),DownloadInfo::getDownloadAlbumname, downloadInfo.getDownloadAlbumname());
downloadInfoLambdaQueryWrapper.eq(StringUtils.isNotEmpty(downloadInfo.getDownloadType()),DownloadInfo::getDownloadType, downloadInfo.getDownloadType());
downloadInfoLambdaQueryWrapper.eq(StringUtils.isNotEmpty(downloadInfo.getAudioBook()),DownloadInfo::getAudioBook, downloadInfo.getAudioBook());
downloadInfoLambdaQueryWrapper.orderByDesc(DownloadInfo::getDownloadTime);
Page<DownloadInfo> page = downloadInfoService.page(new Page<>(downloadInfo.getPageIndex(), downloadInfo.getPageSize()),downloadInfoLambdaQueryWrapper);
return AjaxResult.success(page);
}

/**
* 删除任务
* @param downloadInfo
* @return
*/
@PostMapping("/deleteDownloadInfo")
public AjaxResult deleteDownloadInfo(@RequestBody DownloadInfo downloadInfo){
Integer id = downloadInfo.getId();
if (id!=null){
downloadInfoService.removeById(id);
return AjaxResult.success();
}
return AjaxResult.error();

}
@PostMapping("/refresh/status")
public AjaxResult updateDownloadInfo(@RequestBody DownloadInfo downloadInfo){
Integer id = downloadInfo.getId();
if (id!=null){
DownloadInfo updownloadInfo = new DownloadInfo();
updownloadInfo.setStatus(DownloadStatus.waiting.getValue());
updownloadInfo.setId(id);
downloadInfoService.updateById(updownloadInfo);
return AjaxResult.success();
}
return AjaxResult.error();
}



@GetMapping("/delAllTask")
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sqmusicplus/download/DownloadStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* @Classname DownloadStatus
* @Description TODO
* @Description 下载状态
* @Version 1.0.0
* @Date 2023/8/23 15:00
* @Created by Administrator
* @Created by SQ
*/
public enum DownloadStatus {

Expand Down
Loading

0 comments on commit 2a4b1c1

Please sign in to comment.