Skip to content

Commit

Permalink
pref:研发商店通用化接口封装优化 TencentBlueKing#11049
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Oct 14, 2024
1 parent c90875e commit 35641d4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
*
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
*
* A copy of the MIT License is included in this file.
*
*
* Terms of the MIT License:
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
* LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package com.tencent.devops.store.common.handler

import com.tencent.devops.store.common.service.StoreBaseUpdateService
import com.tencent.devops.store.pojo.common.handler.Handler
import com.tencent.devops.store.pojo.common.publication.StoreUpdateRequest
import org.springframework.stereotype.Service

@Service
class StoreUpdatePreBusHandler(
private val storeBaseUpdateService: StoreBaseUpdateService
) : Handler<StoreUpdateRequest> {

override fun canExecute(handlerRequest: StoreUpdateRequest): Boolean {
return true
}

override fun execute(handlerRequest: StoreUpdateRequest) {
// 执行前置业务
storeBaseUpdateService.doStoreUpdatePreBus(handlerRequest)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ interface StoreBaseUpdateService {
storeUpdateRequest: StoreUpdateRequest
)

/**
* 执行更新组件请求前置业务
* @param storeUpdateRequest 更新组件请求报文
*/
fun doStoreUpdatePreBus(
storeUpdateRequest: StoreUpdateRequest
)

/**
* 持久化更新组件数据
* @param storeUpdateRequest 更新组件请求报文
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ interface StoreReleaseSpecBusService {
storeCreateRequest: StoreCreateRequest
)

/**
* 执行更新组件请求前置业务
* @param storeUpdateRequest 更新组件请求报文
*/
fun doStoreUpdatePreBus(
storeUpdateRequest: StoreUpdateRequest
)

/**
* 对更新组件请求参数进行国际化转换个性化逻辑
* @param storeUpdateRequest 更新组件请求报文
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class StoreBaseUpdateServiceImpl @Autowired constructor(
getStoreSpecBusService(storeType).doCheckStoreUpdateParamSpecBus(storeUpdateRequest)
}

override fun doStoreUpdatePreBus(storeUpdateRequest: StoreUpdateRequest) {
val storeBaseUpdateRequest = storeUpdateRequest.baseInfo
val storeType = storeBaseUpdateRequest.storeType
getStoreSpecBusService(storeType).doStoreUpdatePreBus(storeUpdateRequest)
}

override fun doStoreUpdateDataPersistent(storeUpdateRequest: StoreUpdateRequest) {
val storeBaseUpdateRequest = storeUpdateRequest.baseInfo
val storeType = storeBaseUpdateRequest.storeType
Expand Down

0 comments on commit 35641d4

Please sign in to comment.