fix:文件列表接口
This commit is contained in:
@@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public abstract class BaseQuery<T> {
|
public abstract class BaseQuery<T> {
|
||||||
private String blurry;
|
private String searchKey;
|
||||||
private String is_used;
|
private String is_used;
|
||||||
private String start_time;
|
private String start_time;
|
||||||
private String end_time;
|
private String end_time;
|
||||||
@@ -27,7 +27,7 @@ public abstract class BaseQuery<T> {
|
|||||||
*/
|
*/
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
protected Map<String, QParam> fieldMappings = new HashMap<String, QParam>() {{
|
protected Map<String, QParam> fieldMappings = new HashMap<String, QParam>() {{
|
||||||
put("blurry", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.LK).build());
|
put("searchKey", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.LK).build());
|
||||||
put("start_time", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LT).build());
|
put("start_time", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LT).build());
|
||||||
put("end_time", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LE).build());
|
put("end_time", QParam.builder().k(new String[]{"create_time"}).type(QueryTEnum.LE).build());
|
||||||
put("sort", QParam.builder().k(new String[]{"sort"}).type(QueryTEnum.BY).build());
|
put("sort", QParam.builder().k(new String[]{"sort"}).type(QueryTEnum.BY).build());
|
||||||
|
|||||||
@@ -21,14 +21,12 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import org.nl.common.annotation.CommonLog;
|
import org.nl.common.annotation.CommonLog;
|
||||||
|
import org.nl.common.page.PageQuery;
|
||||||
import org.nl.common.pojo.CommonResult;
|
import org.nl.common.pojo.CommonResult;
|
||||||
import org.nl.dev.api.DevConfigApi;
|
import org.nl.dev.api.DevConfigApi;
|
||||||
import org.nl.dev.modular.file.entity.DevFile;
|
import org.nl.dev.modular.file.entity.DevFile;
|
||||||
import org.nl.dev.modular.file.enums.DevFileEngineTypeEnum;
|
import org.nl.dev.modular.file.enums.DevFileEngineTypeEnum;
|
||||||
import org.nl.dev.modular.file.param.DevFileIdParam;
|
import org.nl.dev.modular.file.param.*;
|
||||||
import org.nl.dev.modular.file.param.DevFileListParam;
|
|
||||||
import org.nl.dev.modular.file.param.DevFilePageParam;
|
|
||||||
import org.nl.dev.modular.file.param.DevFileUrlListParam;
|
|
||||||
import org.nl.dev.modular.file.service.DevFileService;
|
import org.nl.dev.modular.file.service.DevFileService;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -273,4 +271,10 @@ public class DevFileController {
|
|||||||
public void download(@RequestParam String storageId , HttpServletResponse response, HttpServletRequest request) throws IOException {
|
public void download(@RequestParam String storageId , HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||||
this.devFileService.downloadFile(this.devFileService.getById(storageId),request, response);
|
this.devFileService.downloadFile(this.devFileService.getById(storageId),request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取文件列表")
|
||||||
|
@GetMapping("/api/localStorage/page")
|
||||||
|
public CommonResult<Page<DevFile>> pageList(DevFileQuery devFilePageParam, PageQuery pageQuery) {
|
||||||
|
return CommonResult.data(devFileService.page(pageQuery.build(),devFilePageParam.build()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.dev.modular.file.param;
|
package org.nl.dev.modular.file.param;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.nl.dev.modular.file.entity.DevFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件分页列表参数
|
* 文件分页列表参数
|
||||||
@@ -25,7 +27,6 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DevFilePageParam {
|
public class DevFilePageParam {
|
||||||
|
|
||||||
/** 文件引擎 */
|
/** 文件引擎 */
|
||||||
@Schema(description = "文件引擎")
|
@Schema(description = "文件引擎")
|
||||||
private String engine;
|
private String engine;
|
||||||
@@ -33,4 +34,6 @@ public class DevFilePageParam {
|
|||||||
/** 文件名关键词 */
|
/** 文件名关键词 */
|
||||||
@Schema(description = "文件名关键词")
|
@Schema(description = "文件名关键词")
|
||||||
private String searchKey;
|
private String searchKey;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.dev.modular.file.param;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import org.nl.common.page.BaseQuery;
|
||||||
|
import org.nl.dev.modular.file.entity.DevFile;
|
||||||
|
|
||||||
|
public class DevFileQuery extends BaseQuery<DevFile> {
|
||||||
|
/** 文件引擎 */
|
||||||
|
@Schema(description = "文件引擎")
|
||||||
|
private String engine;
|
||||||
|
|
||||||
|
/** 文件名关键词 */
|
||||||
|
@Schema(description = "文件名关键词")
|
||||||
|
private String searchKey;
|
||||||
|
@Override
|
||||||
|
protected Class<DevFile> getEntityClass() {
|
||||||
|
return DevFile.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void paramMapping() {
|
||||||
|
// super.fieldMappings.put("searchKey", QParam.builder().k(new String[]{"name"}).type(QueryTEnum.EQ).build());
|
||||||
|
// }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user