Skip to content

Commit

Permalink
Merge pull request #9177 from yjieliang/pref-9074
Browse files Browse the repository at this point in the history
pref:蓝盾国际化信息补充及优化 #9074
  • Loading branch information
bkci-bot authored Jul 25, 2023
2 parents 0b9b07d + f263906 commit 75ca730
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class PipelineBuildQualityService(
buildLogPrinter: BuildLogPrinter
): AtomResponse {
with(task) {
val atomDesc = ControlPointPosition.create(position).name
val atomDesc = ControlPointPosition.create(position).cnName
val elementId = task.taskId

if (checkResult.success) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import com.tencent.devops.process.constant.ProcessMessageCode.BUILD_MSG_PIPELINE
import com.tencent.devops.process.constant.ProcessMessageCode.BUILD_MSG_REMOTE
import com.tencent.devops.process.constant.ProcessMessageCode.BUILD_MSG_SERVICE
import com.tencent.devops.process.constant.ProcessMessageCode.BUILD_MSG_TIME
import com.tencent.devops.process.constant.ProcessMessageCode.BUILD_MSG_WEBHOOK

object BuildMsgUtils {

Expand All @@ -64,9 +65,8 @@ object BuildMsgUtils {
} else {
I18nUtil.getCodeLanMessage(messageCode = BUILD_MSG_SERVICE)
}
PIPELINE ->
I18nUtil.getCodeLanMessage(messageCode = BUILD_MSG_PIPELINE)
WEB_HOOK -> TODO()
PIPELINE -> I18nUtil.getCodeLanMessage(messageCode = BUILD_MSG_PIPELINE)
WEB_HOOK -> I18nUtil.getCodeLanMessage(messageCode = BUILD_MSG_WEBHOOK)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ import com.tencent.devops.quality.constant.BK_AFTER_POSITION
import com.tencent.devops.quality.constant.BK_BEFORE_POSITION

class ControlPointPosition private constructor(
val code: String,
val name: String
val name: String,
val cnName: String
) {
companion object {
const val BEFORE_POSITION = "BEFORE"
const val AFTER_POSITION = "AFTER"

fun create(code: String): ControlPointPosition {
val name = POSITION_NAME_MAP[code]?.let { I18nUtil.getCodeLanMessage(it) } ?: code
return ControlPointPosition(code, name)
fun create(name: String): ControlPointPosition {
val cnName = POSITION_NAME_MAP[name]?.let { I18nUtil.getCodeLanMessage(it) } ?: name
return ControlPointPosition(name, cnName)
}

private val POSITION_NAME_MAP = mapOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ class QualityRuleService @Autowired constructor(
RuleCreateRequest.CreateRequestIndicator(it.hashId, it.operation.name, it.threshold)
}, // indicatorIds
controlPoint = ruleData.controlPoint.name,
controlPointPosition = ruleData.controlPoint.position.name,
controlPointPosition = ruleData.controlPoint.position.cnName,
range = listOf(),
templateRange = listOf(request.targetTemplateId),
operation = ruleData.operation,
Expand All @@ -808,7 +808,7 @@ class QualityRuleService @Autowired constructor(

fun listMatchTask(ruleList: List<QualityRule>): List<QualityRuleMatchTask> {
val matchTaskList = mutableListOf<QualityRuleMatchTask>()
ruleList.groupBy { it.controlPoint.position.name }.forEach { (_, rules) ->
ruleList.groupBy { it.controlPoint.position.cnName }.forEach { (_, rules) ->

// 按照控制点拦截位置再分组
rules.groupBy { it.controlPoint.position }.forEach { (position, positionRules) ->
Expand Down

0 comments on commit 75ca730

Please sign in to comment.