Add HTML URL to API Issues (#9654) (#9661)

* Add HTML URL to API Issues

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Swagger

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
John Olheiser 2020-01-09 00:07:21 -06:00 committed by Lauris BH
parent f523372d07
commit 04a77b1f42
7 changed files with 10 additions and 4 deletions

View file

@ -381,6 +381,7 @@ func (issue *Issue) apiFormat(e Engine) *api.Issue {
apiIssue := &api.Issue{ apiIssue := &api.Issue{
ID: issue.ID, ID: issue.ID,
URL: issue.APIURL(), URL: issue.APIURL(),
HTMLURL: issue.HTMLURL(),
Index: issue.Index, Index: issue.Index,
Poster: issue.Poster.APIFormat(), Poster: issue.Poster.APIFormat(),
Title: issue.Title, Title: issue.Title,

View file

@ -38,6 +38,7 @@ type RepositoryMeta struct {
type Issue struct { type Issue struct {
ID int64 `json:"id"` ID int64 `json:"id"`
URL string `json:"url"` URL string `json:"url"`
HTMLURL string `json:"html_url"`
Index int64 `json:"number"` Index int64 `json:"number"`
Poster *User `json:"user"` Poster *User `json:"user"`
OriginalAuthor string `json:"original_author"` OriginalAuthor string `json:"original_author"`

View file

@ -142,7 +142,7 @@ func getDingtalkIssuesPayload(p *api.IssuePayload) (*DingtalkPayload, error) {
Title: issueTitle, Title: issueTitle,
HideAvatar: "0", HideAvatar: "0",
SingleTitle: "view issue", SingleTitle: "view issue",
SingleURL: p.Issue.URL, SingleURL: p.Issue.HTMLURL,
}, },
}, nil }, nil
} }

View file

@ -236,7 +236,7 @@ func getDiscordIssuesPayload(p *api.IssuePayload, meta *DiscordMeta) (*DiscordPa
{ {
Title: text, Title: text,
Description: attachmentText, Description: attachmentText,
URL: p.Issue.URL, URL: p.Issue.HTMLURL,
Color: color, Color: color,
Author: DiscordEmbedAuthor{ Author: DiscordEmbedAuthor{
Name: p.Sender.UserName, Name: p.Sender.UserName,

View file

@ -299,7 +299,7 @@ func getMSTeamsIssuesPayload(p *api.IssuePayload) (*MSTeamsPayload, error) {
Targets: []MSTeamsActionTarget{ Targets: []MSTeamsActionTarget{
{ {
Os: "default", Os: "default",
URI: p.Issue.URL, URI: p.Issue.HTMLURL,
}, },
}, },
}, },

View file

@ -158,7 +158,7 @@ func getSlackIssuesPayload(p *api.IssuePayload, slack *SlackMeta) (*SlackPayload
pl.Attachments = []SlackAttachment{{ pl.Attachments = []SlackAttachment{{
Color: fmt.Sprintf("%x", color), Color: fmt.Sprintf("%x", color),
Title: issueTitle, Title: issueTitle,
TitleLink: p.Issue.URL, TitleLink: p.Issue.HTMLURL,
Text: attachmentText, Text: attachmentText,
}} }}
} }

View file

@ -10179,6 +10179,10 @@
"format": "date-time", "format": "date-time",
"x-go-name": "Deadline" "x-go-name": "Deadline"
}, },
"html_url": {
"type": "string",
"x-go-name": "HTMLURL"
},
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64", "format": "int64",