Skip to content

Commit

Permalink
bug:模板查询逻辑在模板列表查询为空时会查询所有源模板等问题修复 TencentBlueKing#2322
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Aug 10, 2020
1 parent 825ec15 commit 74b748a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
Expand Up @@ -76,7 +76,9 @@ class ServicePTemplateResourceImpl @Autowired constructor(
projectId = projectId,
userId = userId,
templateType = templateType,
storeFlag = storeFlag
storeFlag = storeFlag,
page = 1,
pageSize = 1000
))
}

Expand All @@ -102,7 +104,9 @@ class ServicePTemplateResourceImpl @Autowired constructor(
return Result(templateService.listAllTemplate(
projectId = projectId,
templateType = templateType,
templateIds = null
templateIds = null,
page = 1,
pageSize = 1000
))
}

Expand Down
Expand Up @@ -489,32 +489,29 @@ class TemplateService @Autowired constructor(
templateName = null,
storeFlag = storeFlag
)
dslContext.transaction { configuration ->
val context = DSL.using(configuration)
val templates = templateDao.listTemplate(
dslContext = context,
projectId = projectId,
includePublicFlag = null,
templateType = templateType,
templateIdList = null,
storeFlag = storeFlag,
page = page,
pageSize = pageSize
)
logger.info("after get templates")
fillResult(
context = context,
templates = templates,
hasManagerPermission = hasManagerPermission,
userId = userId,
templateType = templateType,
storeFlag = storeFlag,
page = page,
pageSize = pageSize,
keywords = keywords,
result = result
)
}
val templates = templateDao.listTemplate(
dslContext = dslContext,
projectId = projectId,
includePublicFlag = null,
templateType = templateType,
templateIdList = null,
storeFlag = storeFlag,
page = page,
pageSize = pageSize
)
logger.info("after get templates")
fillResult(
context = dslContext,
templates = templates,
hasManagerPermission = hasManagerPermission,
userId = userId,
templateType = templateType,
storeFlag = storeFlag,
page = page,
pageSize = pageSize,
keywords = keywords,
result = result
)
return TemplateListModel(projectId, hasManagerPermission, result, count)
}

Expand Down

0 comments on commit 74b748a

Please sign in to comment.