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