code.gitea.io/gitea@v1.19.3/modules/structs/issue_comment.go (about)

     1  // Copyright 2016 The Gogs Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package structs
     5  
     6  import (
     7  	"time"
     8  )
     9  
    10  // Comment represents a comment on a commit or issue
    11  type Comment struct {
    12  	ID               int64         `json:"id"`
    13  	HTMLURL          string        `json:"html_url"`
    14  	PRURL            string        `json:"pull_request_url"`
    15  	IssueURL         string        `json:"issue_url"`
    16  	Poster           *User         `json:"user"`
    17  	OriginalAuthor   string        `json:"original_author"`
    18  	OriginalAuthorID int64         `json:"original_author_id"`
    19  	Body             string        `json:"body"`
    20  	Attachments      []*Attachment `json:"assets"`
    21  	// swagger:strfmt date-time
    22  	Created time.Time `json:"created_at"`
    23  	// swagger:strfmt date-time
    24  	Updated time.Time `json:"updated_at"`
    25  }
    26  
    27  // CreateIssueCommentOption options for creating a comment on an issue
    28  type CreateIssueCommentOption struct {
    29  	// required:true
    30  	Body string `json:"body" binding:"Required"`
    31  }
    32  
    33  // EditIssueCommentOption options for editing a comment
    34  type EditIssueCommentOption struct {
    35  	// required: true
    36  	Body string `json:"body" binding:"Required"`
    37  }
    38  
    39  // TimelineComment represents a timeline comment (comment of any type) on a commit or issue
    40  type TimelineComment struct {
    41  	ID   int64  `json:"id"`
    42  	Type string `json:"type"`
    43  
    44  	HTMLURL  string `json:"html_url"`
    45  	PRURL    string `json:"pull_request_url"`
    46  	IssueURL string `json:"issue_url"`
    47  	Poster   *User  `json:"user"`
    48  	Body     string `json:"body"`
    49  	// swagger:strfmt date-time
    50  	Created time.Time `json:"created_at"`
    51  	// swagger:strfmt date-time
    52  	Updated time.Time `json:"updated_at"`
    53  
    54  	OldProjectID int64        `json:"old_project_id"`
    55  	ProjectID    int64        `json:"project_id"`
    56  	OldMilestone *Milestone   `json:"old_milestone"`
    57  	Milestone    *Milestone   `json:"milestone"`
    58  	TrackedTime  *TrackedTime `json:"tracked_time"`
    59  	OldTitle     string       `json:"old_title"`
    60  	NewTitle     string       `json:"new_title"`
    61  	OldRef       string       `json:"old_ref"`
    62  	NewRef       string       `json:"new_ref"`
    63  
    64  	RefIssue   *Issue   `json:"ref_issue"`
    65  	RefComment *Comment `json:"ref_comment"`
    66  	RefAction  string   `json:"ref_action"`
    67  	// commit SHA where issue/PR was referenced
    68  	RefCommitSHA string `json:"ref_commit_sha"`
    69  
    70  	ReviewID int64 `json:"review_id"`
    71  
    72  	Label *Label `json:"label"`
    73  
    74  	Assignee     *User `json:"assignee"`
    75  	AssigneeTeam *Team `json:"assignee_team"`
    76  	// whether the assignees were removed or added
    77  	RemovedAssignee bool `json:"removed_assignee"`
    78  
    79  	ResolveDoer *User `json:"resolve_doer"`
    80  
    81  	DependentIssue *Issue `json:"dependent_issue"`
    82  }