code.gitea.io/gitea@v1.19.3/modules/migration/comment.go (about)

     1  // Copyright 2019 The Gitea Authors. All rights reserved.
     2  // Copyright 2018 Jonas Franz. All rights reserved.
     3  // SPDX-License-Identifier: MIT
     4  
     5  package migration
     6  
     7  import "time"
     8  
     9  // Commentable can be commented upon
    10  type Commentable interface {
    11  	Reviewable
    12  	GetContext() DownloaderContext
    13  }
    14  
    15  // Comment is a standard comment information
    16  type Comment struct {
    17  	IssueIndex  int64 `yaml:"issue_index"`
    18  	Index       int64
    19  	CommentType string `yaml:"comment_type"` // see `commentStrings` in models/issues/comment.go
    20  	PosterID    int64  `yaml:"poster_id"`
    21  	PosterName  string `yaml:"poster_name"`
    22  	PosterEmail string `yaml:"poster_email"`
    23  	Created     time.Time
    24  	Updated     time.Time
    25  	Content     string
    26  	Reactions   []*Reaction
    27  	Meta        map[string]interface{} `yaml:"meta,omitempty"` // see models/issues/comment.go for fields in Comment struct
    28  }
    29  
    30  // GetExternalName ExternalUserMigrated interface
    31  func (c *Comment) GetExternalName() string { return c.PosterName }
    32  
    33  // ExternalID ExternalUserMigrated interface
    34  func (c *Comment) GetExternalID() int64 { return c.PosterID }