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(