Skip to content

Commit

Permalink
【PAC】feat:新增代码库详情页 #8118
Browse files Browse the repository at this point in the history
删除代码库时重置代码库别名
  • Loading branch information
mingshewhe committed Nov 11, 2023
1 parent 45ed18f commit f4e3828
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ class RepositoryDao {
}
}

fun delete(dslContext: DSLContext, repositoryId: Long, updateUser: String) {
fun delete(dslContext: DSLContext, repositoryId: Long, deleteAliasName: String, updateUser: String) {
with(TRepository.T_REPOSITORY) {
dslContext.update(this)
.set(IS_DELETED, true)
.set(ALIAS_NAME, deleteAliasName)
.set(UPDATED_USER, updateUser)
.where(REPOSITORY_ID.eq(repositoryId))
.execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,14 @@ class RepositoryService @Autowired constructor(
}

deleteResource(projectId, repositoryId)
repositoryDao.delete(dslContext, repositoryId, userId)
val deleteTime = org.joda.time.LocalDateTime.now().toString("yyMMddHHmmSS")
val deleteAliasName = "${record.aliasName}[$deleteTime]"
repositoryDao.delete(
dslContext = dslContext,
repositoryId = repositoryId,
deleteAliasName = deleteAliasName,
updateUser = userId
)
}

fun validatePermission(user: String, projectId: String, authPermission: AuthPermission, message: String) {
Expand Down

0 comments on commit f4e3828

Please sign in to comment.