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