-
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
【研发商店】支持展示版本日志 #1761 #11477
Open
Kzhou991
wants to merge
9
commits into
TencentBlueKing:master
Choose a base branch
from
Kzhou991:issue_1761
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
【研发商店】支持展示版本日志 #1761 #11477
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a35783e
【研发商店】支持展示版本日志 #1761
Kzhou991 320936e
【研发商店】支持展示版本日志 #1761
Kzhou991 338184d
【研发商店】支持展示版本日志 #1761
Kzhou991 eca52ec
【研发商店】支持展示版本日志 #1761
Kzhou991 473800a
【研发商店】支持展示版本日志 #1761
Kzhou991 3ce0e76
【研发商店】支持展示版本日志 #1761
Kzhou991 2514776
【研发商店】支持展示版本日志 #1761
Kzhou991 c0d64fc
【研发商店】支持展示版本日志 #1761
Kzhou991 b96f034
【研发商店】支持展示版本日志 #1761
Kzhou991 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...store/src/main/kotlin/com/tencent/devops/store/pojo/common/version/StoreVersionLogInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.tencent.devops.store.pojo.common.version | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema(title = "商店组件-版本日志") | ||
data class StoreVersionLogInfo( | ||
@Schema(description = "版本号") | ||
val version: String?, | ||
@Schema(description = "tag") | ||
val tag: String?, | ||
@Schema(description = "最近更新时间") | ||
val lastUpdateTime: String?, | ||
@Schema(description = "更新日志") | ||
val updateLog: String? | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...src/main/kotlin/com/tencent/devops/store/common/service/StoreComponentVersonLogService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.tencent.devops.store.common.service | ||
|
||
import com.tencent.devops.common.api.pojo.Page | ||
import com.tencent.devops.common.api.pojo.Result | ||
import com.tencent.devops.common.api.util.DateTimeUtil | ||
import com.tencent.devops.common.service.utils.SpringContextUtil | ||
import com.tencent.devops.store.common.dao.AbstractStoreCommonDao | ||
import com.tencent.devops.store.pojo.common.enums.StoreTypeEnum | ||
import com.tencent.devops.store.pojo.common.version.StoreVersionLogInfo | ||
import org.jooq.Record3 | ||
import java.time.LocalDateTime | ||
|
||
abstract class StoreComponentVersonLogService { | ||
|
||
companion object { | ||
val HAS_TAG = setOf(StoreTypeEnum.ATOM) | ||
} | ||
|
||
abstract fun getStoreComponentVersionLogs( | ||
userId: String, | ||
storeCode: String, | ||
storeType: StoreTypeEnum, | ||
page: Int, | ||
pageSize: Int | ||
): Result<Page<StoreVersionLogInfo>> | ||
|
||
|
||
fun getStoreCommonDao(storeType: String): AbstractStoreCommonDao { | ||
return SpringContextUtil.getBean(AbstractStoreCommonDao::class.java, "${storeType}_COMMON_DAO") | ||
} | ||
|
||
fun createStoreVersionLogInfo( | ||
record: Record3<String, String, LocalDateTime>, | ||
storeType: StoreTypeEnum | ||
): StoreVersionLogInfo { | ||
return StoreVersionLogInfo( | ||
version = record.value1(), | ||
updateLog = record.value2(), | ||
lastUpdateTime = DateTimeUtil.formatDate( | ||
DateTimeUtil.convertLocalDateTimeToDate(record.value3()), | ||
DateTimeUtil.YYYY_MM_DD_HH_MM_SS | ||
), | ||
tag = generateTag(storeType, record.value1(), record.value3()) | ||
) | ||
} | ||
|
||
private fun generateTag(storeType: StoreTypeEnum, version: String, updateTime: LocalDateTime): String { | ||
return if (storeType in HAS_TAG) { | ||
val updateTimeStr = DateTimeUtil.formatDate( | ||
DateTimeUtil.convertLocalDateTimeToDate(updateTime), | ||
DateTimeUtil.YYYY_MM_DD | ||
) | ||
"prod-v${version}-$updateTimeStr" | ||
} else { | ||
" " | ||
} | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
现在确定姚分页,page和pageSize不要考虑可为空的情况