2020-01-24 01:28:15 +08:00
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2021-11-16 23:25:33 +08:00
|
|
|
package migration
|
2020-01-24 01:28:15 +08:00
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
// enumerate all review states
|
|
|
|
const (
|
|
|
|
ReviewStatePending = "PENDING"
|
|
|
|
ReviewStateApproved = "APPROVED"
|
|
|
|
ReviewStateChangesRequested = "CHANGES_REQUESTED"
|
|
|
|
ReviewStateCommented = "COMMENTED"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Review is a standard review information
|
|
|
|
type Review struct {
|
|
|
|
ID int64
|
2020-12-27 11:34:19 +08:00
|
|
|
IssueIndex int64 `yaml:"issue_index"`
|
|
|
|
ReviewerID int64 `yaml:"reviewer_id"`
|
|
|
|
ReviewerName string `yaml:"reviewer_name"`
|
2020-01-24 01:28:15 +08:00
|
|
|
Official bool
|
2020-12-27 11:34:19 +08:00
|
|
|
CommitID string `yaml:"commit_id"`
|
2020-01-24 01:28:15 +08:00
|
|
|
Content string
|
2020-12-27 11:34:19 +08:00
|
|
|
CreatedAt time.Time `yaml:"created_at"`
|
|
|
|
State string // PENDING, APPROVED, REQUEST_CHANGES, or COMMENT
|
2020-01-24 01:28:15 +08:00
|
|
|
Comments []*ReviewComment
|
|
|
|
}
|
|
|
|
|
2022-02-02 02:20:28 +08:00
|
|
|
// GetExternalName ExternalUserMigrated interface
|
|
|
|
func (r *Review) GetExternalName() string { return r.ReviewerName }
|
|
|
|
|
|
|
|
// ExternalID ExternalUserMigrated interface
|
|
|
|
func (r *Review) GetExternalID() int64 { return r.ReviewerID }
|
|
|
|
|
2020-01-24 01:28:15 +08:00
|
|
|
// ReviewComment represents a review comment
|
|
|
|
type ReviewComment struct {
|
|
|
|
ID int64
|
2020-12-27 11:34:19 +08:00
|
|
|
InReplyTo int64 `yaml:"in_reply_to"`
|
2020-01-24 01:28:15 +08:00
|
|
|
Content string
|
2020-12-27 11:34:19 +08:00
|
|
|
TreePath string `yaml:"tree_path"`
|
|
|
|
DiffHunk string `yaml:"diff_hunk"`
|
2020-01-24 01:28:15 +08:00
|
|
|
Position int
|
2020-10-14 12:06:00 +08:00
|
|
|
Line int
|
2020-12-27 11:34:19 +08:00
|
|
|
CommitID string `yaml:"commit_id"`
|
|
|
|
PosterID int64 `yaml:"poster_id"`
|
2020-01-24 01:28:15 +08:00
|
|
|
Reactions []*Reaction
|
2020-12-27 11:34:19 +08:00
|
|
|
CreatedAt time.Time `yaml:"created_at"`
|
|
|
|
UpdatedAt time.Time `yaml:"updated_at"`
|
2020-01-24 01:28:15 +08:00
|
|
|
}
|