1
// Copyright 2019 The Gitea Authors. All rights reserved.
2
// Copyright 2018 Jonas Franz. All rights reserved.
3
// SPDX-License-Identifier: MIT
9
// Issue is a standard issue information
11
Number int64 `json:"number"`
12
PosterID int64 `yaml:"poster_id" json:"poster_id"`
13
PosterName string `yaml:"poster_name" json:"poster_name"`
14
PosterEmail string `yaml:"poster_email" json:"poster_email"`
15
Title string `json:"title"`
16
Content string `json:"content"`
17
Ref string `json:"ref"`
18
Milestone string `json:"milestone"`
19
State string `json:"state"` // closed, open
20
IsLocked bool `yaml:"is_locked" json:"is_locked"`
21
Created time.Time `json:"created"`
22
Updated time.Time `json:"updated"`
23
Closed *time.Time `json:"closed"`
24
Labels []*Label `json:"labels"`
25
Reactions []*Reaction `json:"reactions"`
26
Assignees []string `json:"assignees"`
27
ForeignIndex int64 `json:"foreign_id"`
28
Context DownloaderContext `yaml:"-"`
31
// GetExternalName ExternalUserMigrated interface
32
func (issue *Issue) GetExternalName() string { return issue.PosterName }
34
// GetExternalID ExternalUserMigrated interface
35
func (issue *Issue) GetExternalID() int64 { return issue.PosterID }
37
func (issue *Issue) GetLocalIndex() int64 { return issue.Number }
39
func (issue *Issue) GetForeignIndex() int64 {
40
// see the comment of Reviewable.GetForeignIndex
41
// if there is no ForeignIndex, then use LocalIndex
42
if issue.ForeignIndex == 0 {
45
return issue.ForeignIndex
48
func (issue *Issue) GetContext() DownloaderContext { return issue.Context }