mirror of https://gitee.com/xiaonuobase/snowy
【新增】通过文件URL获得文件数组
parent
da0d57b09c
commit
aa55ada46d
|
@ -76,6 +76,10 @@ export default {
|
|||
fileDetail(data) {
|
||||
return request('detail', data, 'get')
|
||||
},
|
||||
// 根据文件url集合获取文件集合
|
||||
fileGetFileListByUrlList(data) {
|
||||
return request('getFileListByUrlList', data)
|
||||
},
|
||||
// 删除文件
|
||||
fileDelete(data) {
|
||||
return request('delete', data)
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright [2022] [https://www.xiaonuo.vip]
|
||||
*
|
||||
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Snowy源码头部的版权声明。
|
||||
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
|
||||
* 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
|
||||
* 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
|
||||
*/
|
||||
package vip.xiaonuo.dev.modular.file.param;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件列表参数
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/6/9 23:52
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class DevFileUrlListParam {
|
||||
|
||||
/** 文件路径集合 */
|
||||
@Schema(description = "文件路径集合")
|
||||
@NotNull(message = "urlList不能为空")
|
||||
private List<String> urlList;
|
||||
}
|
|
@ -20,6 +20,7 @@ import vip.xiaonuo.dev.modular.file.entity.DevFile;
|
|||
import vip.xiaonuo.dev.modular.file.param.DevFileIdParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFileListParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFilePageParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFileUrlListParam;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -88,6 +89,14 @@ public interface DevFileService extends IService<DevFile> {
|
|||
*/
|
||||
DevFile detail(DevFileIdParam devFileIdParam);
|
||||
|
||||
/**
|
||||
* 根据文件url集合获取文件集合
|
||||
*
|
||||
* @author yubaoshan
|
||||
* @date 2024/6/9 23:52
|
||||
**/
|
||||
List<DevFile> getFileListByUrlList(DevFileUrlListParam devFileUrlListParam);
|
||||
|
||||
/**
|
||||
* 获取文件详情
|
||||
*
|
||||
|
|
|
@ -21,6 +21,7 @@ import cn.hutool.core.io.IoUtil;
|
|||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
@ -40,6 +41,7 @@ import vip.xiaonuo.dev.modular.file.mapper.DevFileMapper;
|
|||
import vip.xiaonuo.dev.modular.file.param.DevFileIdParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFileListParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFilePageParam;
|
||||
import vip.xiaonuo.dev.modular.file.param.DevFileUrlListParam;
|
||||
import vip.xiaonuo.dev.modular.file.service.DevFileService;
|
||||
import vip.xiaonuo.dev.modular.file.util.DevFileAliyunUtil;
|
||||
import vip.xiaonuo.dev.modular.file.util.DevFileLocalUtil;
|
||||
|
@ -260,6 +262,16 @@ public class DevFileServiceImpl extends ServiceImpl<DevFileMapper, DevFile> impl
|
|||
return this.queryEntity(devFileIdParam.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DevFile> getFileListByUrlList(DevFileUrlListParam devFileUrlListParam) {
|
||||
LambdaQueryWrapper<DevFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// 只查询部分字段
|
||||
lambdaQueryWrapper.select(DevFile::getId, DevFile::getSuffix, DevFile::getDownloadPath, DevFile::getName, DevFile::getThumbnail,
|
||||
DevFile::getSizeKb, DevFile::getSizeInfo, DevFile::getObjName)
|
||||
.in(DevFile::getDownloadPath, devFileUrlListParam.getUrlList());
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevFile queryEntity(String id) {
|
||||
DevFile devFile = this.getById(id);
|
||||
|
|
Loading…
Reference in New Issue