Skip to content

Commit

Permalink
pref:研发商店通用化接口封装优化 #11049
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Dec 4, 2024
1 parent ba82146 commit 3204fd2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class UserStoreComponentManageResourceImpl(
storeCode: String,
storeTestRequest: StoreTestRequest
): Result<Boolean> {
return Result(
return Result(
storeProjectService.saveStoreTestInfo(
userId = userId,
storeType = storeType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ import com.tencent.devops.store.common.service.StoreCommonService
import com.tencent.devops.store.common.service.StoreReleaseSpecBusService
import com.tencent.devops.store.common.utils.StoreReleaseUtils
import com.tencent.devops.store.common.utils.StoreUtils
import com.tencent.devops.store.constant.StoreMessageCode
import com.tencent.devops.store.pojo.common.KEY_CLASSIFY_ID
import com.tencent.devops.store.pojo.common.KEY_STORE_ID
import com.tencent.devops.store.pojo.common.enums.ReleaseTypeEnum
import com.tencent.devops.store.pojo.common.enums.StoreStatusEnum
import com.tencent.devops.store.pojo.common.enums.StoreTypeEnum
import com.tencent.devops.store.pojo.common.publication.StoreBaseDataPO
import com.tencent.devops.store.pojo.common.publication.StoreUpdateRequest
Expand Down Expand Up @@ -94,6 +96,15 @@ class StoreBaseUpdateServiceImpl @Autowired constructor(
val storeCode = storeBaseUpdateRequest.storeCode
val name = storeBaseUpdateRequest.name
val versionInfo = storeBaseUpdateRequest.versionInfo
val version = versionInfo.version
val baseRecord = storeBaseQueryDao.getComponent(
dslContext = dslContext, storeCode = storeCode, version = version, storeType = storeType
) ?: throw ErrorCodeException(
errorCode = CommonMessageCode.PARAMETER_IS_INVALID, params = arrayOf("$storeCode:$version")
)
if (StoreStatusEnum.INIT.name != baseRecord.status) {
throw ErrorCodeException(errorCode = StoreMessageCode.STORE_RELEASE_STEPS_ERROR)
}
val classifyCode = storeBaseUpdateRequest.classifyCode
// 校验分类信息是否准确
val classifyRecord =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,7 @@ class StoreComponentQueryServiceImpl : StoreComponentQueryService {
val installed = storeInfoQuery.installed
installed?.let {
// 根据是否安装条件筛选组件
if ((installed && !installComponentMap.contains(storeCode)) ||
(!installed && installComponentMap.contains(storeCode))) {
if (installed != installComponentMap.containsKey(storeCode)) {
return@forEach
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ class StoreReleaseServiceImpl @Autowired constructor(
StoreReleaseSpecBusService::class.java, StoreUtils.getReleaseSpecBusServiceBeanName(storeType)
)
val status = storeReleaseSpecBusService.getStoreRunPipelineStatus(startFlag = false)
val lock = RedisLock(redisOperation, "store:$storeId:rebuild", 30)
val lock = RedisLock(redisOperation, "store:$storeId:build", 30)
try {
lock.lock()
status?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ import org.jooq.Condition
import org.jooq.DSLContext
import org.jooq.Record
import org.jooq.Record1
import org.jooq.Record18
import org.jooq.Record19
import org.jooq.Result
import org.jooq.UpdateSetFirstStep
Expand Down

0 comments on commit 3204fd2

Please sign in to comment.