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.
|
|
|
|
|
|
|
|
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 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
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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-14 00:06:00 -04: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
|
|
|
}
|