From afdcc1e87e208e1e2f945eaf30d60a48907b8a58 Mon Sep 17 00:00:00 2001 From: dragove Date: Thu, 21 Mar 2024 20:39:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BD=9C=E4=B8=9A=E9=9B=86=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=80=85id=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/controller/request/copilotset/CopilotSetQuery.kt | 3 +++ src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/kotlin/plus/maa/backend/controller/request/copilotset/CopilotSetQuery.kt b/src/main/kotlin/plus/maa/backend/controller/request/copilotset/CopilotSetQuery.kt index 2c423273..36aea2cb 100644 --- a/src/main/kotlin/plus/maa/backend/controller/request/copilotset/CopilotSetQuery.kt +++ b/src/main/kotlin/plus/maa/backend/controller/request/copilotset/CopilotSetQuery.kt @@ -23,6 +23,9 @@ data class CopilotSetQuery ( @Schema(title = "查询关键词") val keyword: String? = null, + @Schema(title = "创建者id") + val creatorId: String? = null, + @Schema(title = "需要包含的作业id列表") val copilotIds: List? = null ) diff --git a/src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt b/src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt index a5917d54..4ba66d94 100644 --- a/src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt +++ b/src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt @@ -120,6 +120,9 @@ class CopilotSetService( if (!req.copilotIds.isNullOrEmpty()) { query.addCriteria(Criteria.where("copilotIds").all(req.copilotIds)).with(pageRequest) } + if (!req.creatorId.isNullOrBlank()) { + query.addCriteria(Criteria.where("creatorId").`is`(req.creatorId)) + } if (!req.keyword.isNullOrBlank()) { val pattern = Pattern.compile(req.keyword, Pattern.CASE_INSENSITIVE) query.addCriteria(