-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug:研发商店组件审核发布时录入T_STORE_RELEASE表的首次发布人有误 #11366 #11408
base: master
Are you sure you want to change the base?
Conversation
@@ -348,7 +348,8 @@ class OpAtomServiceImpl @Autowired constructor( | |||
atomStatus = atomStatus, | |||
releaseType = releaseType, | |||
repositoryHashId = atom.repositoryHashId, | |||
branch = atom.branch | |||
branch = atom.branch, | |||
publisher = atom.publisher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是首次发布人吗?publisher有可能是组织,这个需求应该取首个版本的创建人数据录入
@PUT | ||
@Path("/updateComponentFirstPublisher") | ||
fun updateComponentFirstPublisher( | ||
@Parameter(description = "userId", required = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要一键刷新所有历史数据的op接口,不是人工一个个改
# Conflicts: # src/backend/ci/core/store/biz-store/src/main/kotlin/com/tencent/devops/store/atom/dao/MarketAtomDao.kt
lateinit var dslContext: DSLContext | ||
|
||
@Autowired | ||
lateinit var atomDao: MarketAtomDao |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是公共模块,怎么依赖特定业务模块的bean,这需要用设计模式屏蔽差异
|
||
|
||
@Service | ||
class StoreCoreComponentDataCorrectionServiceImpl : StoreComponentDataCorrectionService() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StoreComponentDataCorrectionService这类名称起的不好
fun updateFirstPublisherIfNecessary( | ||
storeTypeEnum: StoreTypeEnum, | ||
list: List<Component>?, | ||
dao: StoreReleaseDao, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dao和dslContext为什么要作参数传?
.select(tAtom.ATOM_CODE, tAtomVersionLog.MODIFIER) | ||
.from(tAtom) | ||
.join(tAtomVersionLog) | ||
.on(tAtom.ID.eq(tAtomVersionLog.ATOM_ID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
关联tAtomVersionLog干什么,一次把所有记录都查出来吗?没有考虑性能问题
|
||
fun selectStoreReleaseInfo( | ||
dslContext: DSLContext, | ||
storeCode: List<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
集合字段名称应该定义成storeCodes吧
override fun updateComponentFirstPublisher( | ||
userId: String, | ||
): Boolean { | ||
storeComponentDataCorrectionService.updateComponentFirstPublisher(userId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一次更新这么多组件,更新逻辑应该搞成异步的吧
@@ -911,4 +913,39 @@ class MarketAtomDao : AtomBaseDao() { | |||
} | |||
} | |||
} | |||
|
|||
fun listByAtomCode(dslContext: DSLContext): Result<Record2<String, String>>? { | |||
val tAtom = TAtom.T_ATOM.`as`("t_atom") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.as
("t_atom")之类的代码不用写
|
||
val imageList = imageDao.listByImageCode(dslContext)?.map { Component(it.value1(), it.value2()) } | ||
updateFirstPublisherIfNecessary(StoreTypeEnum.IMAGE, imageList, storeReleaseDao, dslContext, userId) | ||
} catch (e: Exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
异常统一用ignored: Throwable
val imageList = imageDao.listByImageCode(dslContext)?.map { Component(it.value1(), it.value2()) } | ||
updateFirstPublisherIfNecessary(StoreTypeEnum.IMAGE, imageList, storeReleaseDao, dslContext, userId) | ||
} catch (e: Exception) { | ||
logger.info("updateComponentFirstPublisher error:${e.message}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger日志打印不规范,应该至少使用warn级别吧
val tAtomChild = TAtom.T_ATOM.`as`("t_atom_child") | ||
val tAtomVersionLog = TAtomVersionLog.T_ATOM_VERSION_LOG | ||
|
||
val minCreateTimeSubquery = dslContext.select(min(tAtomChild.CREATE_TIME)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这么分组没看懂,确定没问题吗?都没体现是按组件分组?
No description provided.