-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: telegram chat authorization via jira
Showing
14 changed files
with
81 additions
and
11 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
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
25 changes: 25 additions & 0 deletions
25
src/main/kotlin/com/github/mikesafonov/jira/telegram/service/jira/MySelfRestClient.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,25 @@ | ||
package com.github.mikesafonov.jira.telegram.service.jira | ||
|
||
import com.atlassian.httpclient.api.HttpClient | ||
import com.atlassian.jira.rest.client.api.domain.User | ||
import com.atlassian.jira.rest.client.internal.async.AbstractAsynchronousRestClient | ||
import com.atlassian.jira.rest.client.internal.json.UserJsonParser | ||
import io.atlassian.util.concurrent.Promise | ||
import java.net.URI | ||
import javax.ws.rs.core.UriBuilder | ||
|
||
|
||
class MySelfRestClient(httpClient: HttpClient, serverUri: URI) : AbstractAsynchronousRestClient(httpClient) { | ||
|
||
private val baseUri: URI | ||
private val userJsonParser = UserJsonParser() | ||
|
||
init { | ||
baseUri = UriBuilder.fromUri(serverUri).path("/rest/api/latest").build() | ||
} | ||
|
||
fun getMySelf(): Promise<User> { | ||
val userUri = UriBuilder.fromUri(baseUri).path("myself").build() | ||
return getAndParse(userUri, userJsonParser) | ||
} | ||
} |
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
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 @@ | ||
ALTER TABLE chats ALTER COLUMN jira_id DROP NOT NULL; |
1 change: 1 addition & 0 deletions
1
src/main/resources/db/migration/mysql/V1_0_6__nullableJiraId.sql
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 @@ | ||
ALTER TABLE chats MODIFY COLUMN jira_id varchar(100); |
1 change: 1 addition & 0 deletions
1
src/main/resources/db/migration/postgresql/V1_0_6__nullableJiraId.sql
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 @@ | ||
ALTER TABLE chats ALTER COLUMN jira_id DROP NOT NULL; |