diff --git a/cmd/issue/list.go b/cmd/issue/list.go index a59a19e..1a99598 100644 --- a/cmd/issue/list.go +++ b/cmd/issue/list.go @@ -47,13 +47,19 @@ var ListCmd = &cobra.Command{ columns := []table.Column{ {Title: "Ident", Width: 8}, {Title: "Title", Width: 50}, + {Title: "Assignee", Width: 12}, + {Title: "Type", Width: 12}, {Title: "State", Width: 10}, } rows := make([]table.Row, 0) for _, issue := range _issues { - rows = append(rows, table.Row{issue.Ident, issue.Title, issue.IssueState.Title}) + userName := issue.Assignee.Remark + if userName == "" { + userName = issue.Assignee.UserName + } + rows = append(rows, table.Row{issue.Ident, issue.Title, userName, issue.IssueType.Title, issue.IssueState.Title}) } issueTable := tui.NewTable(enterprise, tui.Issue, columns, rows) diff --git a/internal/api/issue/issue.go b/internal/api/issue/issue.go index 5ebb7da..baddbba 100644 --- a/internal/api/issue/issue.go +++ b/internal/api/issue/issue.go @@ -5,6 +5,8 @@ import ( "errors" "fmt" "gitee_cli/internal/api/issue_state" + "gitee_cli/internal/api/issue_type" + "gitee_cli/internal/api/user" "gitee_cli/utils/http_utils" ) @@ -17,6 +19,8 @@ type Issue struct { Url string `json:"issue_url"` Description string `json:"description"` IssueState issue_state.IssueState `json:"issue_state"` + Assignee user.Member `json:"assignee"` + IssueType issue_type.IssueType `json:"issue_type"` } func Find(enterpriseId int, params map[string]string) ([]Issue, error) {