Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#59 from yjieliang/feat-7556
Browse files Browse the repository at this point in the history
Feat 7556
  • Loading branch information
yjieliang committed Sep 23, 2022
2 parents ab4e4b4 + ada207d commit cf3a225
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ import com.tencent.devops.store.pojo.common.enums.ReleaseTypeEnum
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import java.io.File
import org.glassfish.jersey.media.multipart.FormDataContentDisposition
import org.glassfish.jersey.media.multipart.FormDataParam
import java.io.InputStream
import javax.ws.rs.Consumes
import javax.ws.rs.DELETE
import javax.ws.rs.GET
Expand Down Expand Up @@ -99,7 +101,10 @@ interface ServiceArchiveAtomResource {
@QueryParam("releaseType")
releaseType: ReleaseTypeEnum,
@ApiParam("文件", required = true)
file: File,
@FormDataParam("file")
inputStream: InputStream,
@FormDataParam("file")
disposition: FormDataContentDisposition,
@ApiParam("支持的操作系统", required = true)
@QueryParam("os")
os: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.tencent.devops.common.web.RestResource
import com.tencent.devops.store.pojo.common.enums.ReleaseTypeEnum
import org.glassfish.jersey.media.multipart.FormDataContentDisposition
import org.springframework.beans.factory.annotation.Autowired
import java.io.File
import java.io.InputStream

@RestResource
Expand All @@ -60,13 +59,14 @@ class ServiceArchiveAtomResourceImpl @Autowired constructor(
atomCode: String,
version: String,
releaseType: ReleaseTypeEnum,
file: File,
inputStream: InputStream,
disposition: FormDataContentDisposition,
os: String
): Result<ArchiveAtomResponse?> {
return archiveAtomService.archiveAtom(
userId = userId,
inputStream = file.inputStream(),
disposition = FormDataContentDisposition("form-data; name=\"logo\"; filename=\"${file.name}\""),
inputStream = inputStream,
disposition = disposition,
atomId = atomId,
archiveAtomRequest = ArchiveAtomRequest(
projectCode = projectCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ object CommonUtils {
os: String
): Result<String?> {
val serviceUrl = "$serviceUrlPrefix/service/artifactories/archiveAtom" +
"??userId=$userId&projectCode=$projectCode&atomId=$atomId&atomCode=$atomCode" +
"?userId=$userId&projectCode=$projectCode&atomId=$atomId&atomCode=$atomCode" +
"&version=$version&releaseType=$releaseType&os=$os"

logger.info("the serviceUrl is:$serviceUrl")
Expand Down

0 comments on commit cf3a225

Please sign in to comment.