From 6b46e8a897e858a20480c241e696271c20269361 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Mon, 22 Apr 2019 00:24:16 +0800 Subject: [PATCH] Support attachment query by type. --- .../java/run/halo/app/model/params/AttachmentQuery.java | 2 ++ .../run/halo/app/service/impl/AttachmentServiceImpl.java | 6 ++++++ src/main/resources/templates/common/web/sitemap_html.ftl | 8 +++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/run/halo/app/model/params/AttachmentQuery.java b/src/main/java/run/halo/app/model/params/AttachmentQuery.java index 4cf7550fc..576bb50d8 100644 --- a/src/main/java/run/halo/app/model/params/AttachmentQuery.java +++ b/src/main/java/run/halo/app/model/params/AttachmentQuery.java @@ -17,4 +17,6 @@ public class AttachmentQuery { private String keyword; private String mediaType; + + private String attachmentType; } diff --git a/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java b/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java index 0596bc5fe..70e117273 100644 --- a/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java +++ b/src/main/java/run/halo/app/service/impl/AttachmentServiceImpl.java @@ -13,8 +13,10 @@ import run.halo.app.handler.file.FileHandlers; import run.halo.app.model.dto.AttachmentOutputDTO; import run.halo.app.model.entity.Attachment; import run.halo.app.model.enums.AttachmentType; +import run.halo.app.model.enums.converter.AttachmentTypeConverter; import run.halo.app.model.params.AttachmentQuery; import run.halo.app.model.properties.AttachmentProperties; +import run.halo.app.model.properties.PropertyEnum; import run.halo.app.model.support.UploadResult; import run.halo.app.repository.AttachmentRepository; import run.halo.app.service.AttachmentService; @@ -73,6 +75,10 @@ public class AttachmentServiceImpl extends AbstractCrudService