Skip to content

Commit

Permalink
pref:研发商店通用化接口封装优化 TencentBlueKing#11049
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Nov 11, 2024
1 parent 2f7497c commit c61b8a6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import io.swagger.v3.oas.annotations.media.Schema

@Schema(title = "创建git仓库响应体")
class GitRepositoryResp(
@get:Schema(title = "仓库ID", required = true)
val id: Long,
@get:Schema(title = "仓库名称", required = true)
val name: String,
@get:Schema(title = "仓库地址", required = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ data class RepositoryInfo(
@get:Schema(title = "最后更新时间", required = true)
val updatedTime: Long,
@get:Schema(title = "创建人", required = false)
val createUser: String? = null
val createUser: String? = null,
@get:Schema(title = "远程仓库ID", required = false)
val remoteRepoId: Long? = null
)
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ class RepositoryService @Autowired constructor(
aliasName = gitRepositoryResp.name,
url = gitRepositoryResp.repositoryUrl,
type = ScmType.CODE_GIT,
updatedTime = LocalDateTime.now().timestampmilli()
updatedTime = LocalDateTime.now().timestampmilli(),
remoteRepoId = gitRepositoryResp.id
)
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import com.google.gson.JsonParser
import com.tencent.devops.common.api.constant.CommonMessageCode
import com.tencent.devops.common.api.constant.ID
import com.tencent.devops.common.api.enums.FrontendTypeEnum
import com.tencent.devops.common.api.exception.CustomException
import com.tencent.devops.common.api.pojo.Result
Expand Down Expand Up @@ -628,7 +629,8 @@ class GitService @Autowired constructor(
)
}
}
return Result(GitRepositoryResp(nameSpaceName, atomRepositoryUrl as String))
val id = dataMap[ID] as Long
return Result(GitRepositoryResp(id, nameSpaceName, atomRepositoryUrl as String))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ class StoreComponentQueryServiceImpl : StoreComponentQueryService {
val userCommentInfo = storeCommentService.getStoreUserCommentInfo(userId, storeCode, storeType)

val baseExtRecords = storeBaseExtQueryDao.getBaseExtByIds(dslContext, listOf(storeId))
val extData = baseExtRecords.associateBy({ it.fieldName }, { formatJson(it.fieldValue) })
var extData = baseExtRecords.associateBy({ it.fieldName }, { formatJson(it.fieldValue) })
val baseFeatureExtRecords = storeBaseFeatureExtQueryDao.queryStoreBaseFeatureExt(
dslContext = dslContext,
storeCode = storeCode,
storeType = storeType
)
extData = extData.plus(baseFeatureExtRecords.associateBy({ it.fieldName }, { formatJson(it.fieldValue) }))
val htmlTemplateVersion = extData[KEY_HTML_TEMPLATE_VERSION]
val initProjectCode =
if (htmlTemplateVersion != null && htmlTemplateVersion == FrontendTypeEnum.HISTORY.typeVersion) {
Expand Down

0 comments on commit c61b8a6

Please sign in to comment.