Skip to content

Commit

Permalink
fix merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
edewit committed Nov 7, 2019
1 parent b8b7887 commit ace162d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/io/quarkus/code/CodeQuarkusResource.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import javax.ws.rs.core.Response
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
import java.io.IOException

@Path("/")
class CodeQuarkusResource {
Expand Down Expand Up @@ -72,14 +73,14 @@ class CodeQuarkusResource {
val JSON = "application/json; charset=utf-8".toMediaType()
val body = """
{
"group_guid": "$bitlyGroupId",
"group_guid": "${configManager.bitlyGroupId}",
"long_url": "https://code.quarkus.io/api/download?g=${project.groupId}&a=${project.artifactId}&v=${project.version}&c=${project.className}&e=${project.extensions}"
}
""".toRequestBody(JSON)

val request = Request.Builder()
.url("https://api-ssl.bitly.com/v4/shorten")
.addHeader("Authorization", "Bearer $bitlyAccessToken")
.addHeader("Authorization", "Bearer ${configManager.bitlyAccessToken}")
.post(body)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ open class CodeQuarkusConfigManager {
lateinit var sentryDSN: String
private set

@ConfigProperty(name = "io.quarkus.code.bitly.generic-access-token")
lateinit var bitlyAccessToken: String
private set

@ConfigProperty(name = "io.quarkus.code.bitly.group-id")
lateinit var bitlyGroupId: String
private set

fun getConfig(): Config {
return Config(
environment,
Expand Down

0 comments on commit ace162d

Please sign in to comment.