2020-01-23 12:28:15 -05: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 10:25:33 -05:00
|
|
|
package migration
|
2020-01-23 12:28:15 -05: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-26 22:34:19 -05:00
|
|
|
IssueIndex int64 `yaml:"issue_index"`
|
|
|
|
ReviewerID int64 `yaml:"reviewer_id"`
|
|
|
|
ReviewerName string `yaml:"reviewer_name"`
|
2020-01-23 12:28:15 -05:00
|
|
|
Official bool
|
2020-12-26 22:34:19 -05:00
|
|
|
CommitID string `yaml:"commit_id"`
|
2020-01-23 12:28:15 -05:00
|
|
|
Content string
|
2020-12-26 22:34:19 -05:00
|
|
|
CreatedAt time.Time `yaml:"created_at"`
|
|
|
|
State string // PENDING, APPROVED, REQUEST_CHANGES, or COMMENT
|
2020-01-23 12:28:15 -05:00
|
|
|
Comments []*ReviewComment
|
|
|
|
}
|
|
|
|
|
2022-02-01 13:20:28 -05: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-23 12:28:15 -05:00
|
|
|
// ReviewComment represents a review comment
|
|
|
|
type ReviewComment struct {
|
|
|
|
ID int64
|
2020-12-26 22:34:19 -05:00
|
|
|
InReplyTo int64 `yaml:"in_reply_to"`
|
2020-01-23 12:28:15 -05:00
|
|
|
Content string
|
2020-12-26 22:34:19 -05:00
|
|
|
TreePath string `yaml:"tree_path"`
|
|
|
|
DiffHunk string `yaml:"diff_hunk"`
|
2020-01-23 12:28:15 -05:00
|
|
|
Position int
|
2020-10-13 23:06:00 -05:00
|
|
|
Line int
|
2020-12-26 22:34:19 -05:00
|
|
|
CommitID string `yaml:"commit_id"`
|
|
|
|
PosterID int64 `yaml:"poster_id"`
|
2020-01-23 12:28:15 -05:00
|
|
|
Reactions []*Reaction
|
2020-12-26 22:34:19 -05:00
|
|
|
CreatedAt time.Time `yaml:"created_at"`
|
|
|
|
UpdatedAt time.Time `yaml:"updated_at"`
|
2020-01-23 12:28:15 -05:00
|
|
|
}
|