Skip to content

Commit

Permalink
feat: 作业集查询接口添加创建者id入参
Browse files Browse the repository at this point in the history
  • Loading branch information
dragove committed Mar 21, 2024
1 parent 4500180 commit afdcc1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Long>? = null
)
3 changes: 3 additions & 0 deletions src/main/kotlin/plus/maa/backend/service/CopilotSetService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit afdcc1e

Please sign in to comment.