【新增】通过文件URL获得文件数组

pull/227/head
俞宝山 4 months ago
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]
*
* SnowyAPACHE 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…
Cancel
Save