-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TencentBlueKing:master' into issue_2765
- Loading branch information
Showing
73 changed files
with
10,345 additions
and
2 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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. | ||
*/ | ||
|
||
dependencies { | ||
api(project(":common:common-api")) | ||
api(project(":repository:api-repository")) | ||
api(project(":auth:api-auth")) | ||
compileOnly("org.springframework:spring-web") | ||
} |
47 changes: 47 additions & 0 deletions
47
...ew/api-preview/src/main/kotlin/com/tencent/bkrepo/preview/artifact/PreviewArtifactInfo.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,47 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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.bkrepo.preview.artifact | ||
|
||
import com.tencent.bkrepo.common.artifact.api.ArtifactInfo | ||
|
||
class PreviewArtifactInfo( | ||
projectId: String, | ||
repoName: String, | ||
artifactUri: String | ||
) : ArtifactInfo(projectId, repoName, artifactUri) { | ||
companion object { | ||
const val PREVIEW_BKREPO_MAPPING_URI = "/api/file/onlinePreview/{projectId}/{repoName}/**" | ||
const val PREVIEW_REMOTE_MAPPING_URI = "/api/file/onlinePreview" | ||
const val PREVIEW_INFO_REMOTE_MAPPING_URI = "/api/file/getPreviewInfo" | ||
const val PREVIEW_INFO_BKREPO_MAPPING_URI = "/api/file/getPreviewInfo/{projectId}/{repoName}/**" | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...kend/preview/api-preview/src/main/kotlin/com/tencent/bkrepo/preview/constant/Constants.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,41 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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.bkrepo.preview.constant | ||
|
||
const val BKREPO_PREFIX = "X-BKREPO-" | ||
|
||
// 节点详情 | ||
const val PREVIEW_NODE_DETAIL = BKREPO_PREFIX + "PREVIEW_NODE_DETAIL" | ||
// 临时文件保存路径 | ||
const val PREVIEW_TMP_FILE_SAVE_PATH = BKREPO_PREFIX + "PREVIEW_TMP_FILE_SAVE_PATH" | ||
// 是否把制品流保存至文件 | ||
const val PREVIEW_ARTIFACT_TO_FILE = BKREPO_PREFIX + "PREVIEW_ARTIFACT_TO_FILE" |
49 changes: 49 additions & 0 deletions
49
...iew/api-preview/src/main/kotlin/com/tencent/bkrepo/preview/constant/PreviewMessageCode.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,49 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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.bkrepo.preview.constant | ||
|
||
import com.tencent.bkrepo.common.api.message.MessageCode | ||
|
||
enum class PreviewMessageCode(private val key: String) : MessageCode { | ||
PREVIEW_FILE_NOT_FOUND("preview.file.not-found"), | ||
PREVIEW_NODE_NOT_FOUND("preview.node.not-found"), | ||
PREVIEW_REPO_NOT_FOUND("preview.repo.not-found"), | ||
PREVIEW_FIlE_CONVERT_ERROR("preview.file.convert.error"), | ||
PREVIEW_FILE_SIZE_LIMIT_ERROR("preview.file.size.limit.error"), | ||
PREVIEW_FILE_NOT_SUPPORT_ERROR("preview.file.not-support"), | ||
PREVIEW_PARAMETER_INVALID("preview.parameter.invalid") | ||
; | ||
|
||
override fun getBusinessCode() = ordinal + 1 | ||
override fun getKey() = key | ||
override fun getModuleCode() = 26 | ||
} |
48 changes: 48 additions & 0 deletions
48
...end/preview/api-preview/src/main/kotlin/com/tencent/bkrepo/preview/pojo/DownloadResult.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,48 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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.bkrepo.preview.pojo | ||
|
||
/** | ||
* 下载结果 | ||
*/ | ||
data class DownloadResult( | ||
var code: Int = CODE_SUCCESS, | ||
var filePath: String? = null, | ||
var msg: String? = null, | ||
var size: Long = 0, | ||
var md5: String? = null | ||
) { | ||
companion object { | ||
const val CODE_SUCCESS = 0 | ||
const val CODE_FAIL = 1 | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
...kend/preview/api-preview/src/main/kotlin/com/tencent/bkrepo/preview/pojo/FileAttribute.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,83 @@ | ||
/* | ||
* Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available. | ||
* | ||
* Copyright (C) 2020 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.bkrepo.preview.pojo | ||
|
||
import io.swagger.annotations.ApiModel | ||
|
||
@ApiModel("预览文件信息") | ||
data class FileAttribute ( | ||
// 存储类型:0-bkrepo文件,1-远程文件 | ||
var storageType: Int = 0, | ||
|
||
// 项目id,bkrepo文件需要 | ||
var projectId: String? = null, | ||
|
||
// 仓库名称,bkrepo文件需要 | ||
var repoName: String? = null, | ||
|
||
// 文件全路径,bkrepo文件需要 | ||
var artifactUri: String? = null, | ||
|
||
// 文件名称 | ||
var fileName: String? = null, | ||
|
||
// 文件的完整下载地址,远程文件需要 | ||
var url: String? = null, | ||
|
||
// 文件的md5 | ||
var md5: String? = null, | ||
|
||
// 文件大小(byte) | ||
var size: Long = 0, | ||
|
||
// office预览类型(image / pdf) | ||
val officePreviewType: String = "pdf", | ||
|
||
// 转换后的文件路径 | ||
var outFilePath: String? = null, | ||
// 下载文件保存路径 | ||
var originFilePath: String? = null, | ||
// 转换后的文件名 | ||
var convertFileName: String? = null, | ||
|
||
// 最终文件临时路径 | ||
var finalFilePath: String? = null, | ||
|
||
// xlsx是否转成html | ||
var isHtmlView: Boolean = false, | ||
|
||
// 文件类型 | ||
var type: FileType? = null, | ||
|
||
// 文件后缀 | ||
var suffix: String? = null, | ||
) |
Oops, something went wrong.