Skip to content

Commit

Permalink
refactor: 代码优化 #756
Browse files Browse the repository at this point in the history
  • Loading branch information
scplsy committed Jun 30, 2023
1 parent e3047b1 commit 9f4700c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ import java.time.LocalDateTime
@Service
@Conditional(DefaultCondition::class)
class MetadataServiceImpl(
private val nodeDao: NodeDao,
private val nodeBaseService: NodeBaseService
) : MetadataService {

private val nodeDao: NodeDao = nodeBaseService.nodeDao

override fun listMetadata(projectId: String, repoName: String, fullPath: String): Map<String, Any> {
return MetadataUtils.toMap(nodeDao.findOne(NodeQueryHelper.nodeQuery(projectId, repoName, fullPath))?.metadata)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
package com.tencent.bkrepo.repository.service.metadata.impl.center

import com.tencent.bkrepo.common.service.cluster.CommitEdgeCenterCondition
import com.tencent.bkrepo.repository.dao.NodeDao
import com.tencent.bkrepo.repository.service.metadata.impl.MetadataServiceImpl
import com.tencent.bkrepo.repository.service.node.impl.NodeBaseService
import org.springframework.context.annotation.Conditional
Expand All @@ -37,9 +36,7 @@ import org.springframework.stereotype.Service
@Service
@Conditional(CommitEdgeCenterCondition::class)
class CommitEdgeCenterMetadataServiceImpl(
nodeDao: NodeDao,
nodeBaseService: NodeBaseService
) : MetadataServiceImpl(
nodeDao,
nodeBaseService
)
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import com.tencent.bkrepo.common.service.cluster.ClusterProperties
import com.tencent.bkrepo.common.service.cluster.CommitEdgeEdgeCondition
import com.tencent.bkrepo.common.service.feign.FeignClientFactory
import com.tencent.bkrepo.repository.api.cluster.ClusterMetadataClient
import com.tencent.bkrepo.repository.dao.NodeDao
import com.tencent.bkrepo.repository.pojo.metadata.MetadataDeleteRequest
import com.tencent.bkrepo.repository.pojo.metadata.MetadataSaveRequest
import com.tencent.bkrepo.repository.service.metadata.impl.MetadataServiceImpl
Expand All @@ -42,11 +41,9 @@ import org.springframework.stereotype.Service
@Service
@Conditional(CommitEdgeEdgeCondition::class)
class EdgeMetadataServiceImpl(
nodeDao: NodeDao,
nodeBaseService: NodeBaseService,
clusterProperties: ClusterProperties
) : MetadataServiceImpl(
nodeDao,
nodeBaseService
) {

Expand Down

0 comments on commit 9f4700c

Please sign in to comment.