init
This commit is contained in:
24
services/types/review.go
Normal file
24
services/types/review.go
Normal file
@ -0,0 +1,24 @@
|
||||
package types
|
||||
|
||||
// ReviewResult 代表代码审查结果
|
||||
type ReviewResult struct {
|
||||
Comments []Comment
|
||||
Summary string
|
||||
}
|
||||
|
||||
// Comment 代表代码审查评论
|
||||
type Comment struct {
|
||||
Path string
|
||||
Line int
|
||||
Content string
|
||||
Severity Severity
|
||||
}
|
||||
|
||||
// Severity 代表问题严重程度
|
||||
type Severity string
|
||||
|
||||
const (
|
||||
Error Severity = "error"
|
||||
Warning Severity = "warning"
|
||||
Info Severity = "info"
|
||||
)
|
37
services/types/webhook.go
Normal file
37
services/types/webhook.go
Normal file
@ -0,0 +1,37 @@
|
||||
package types
|
||||
|
||||
// CodeChanges 代表代码变更信息
|
||||
type CodeChanges struct {
|
||||
Repository string
|
||||
Branch string
|
||||
CommitID string
|
||||
Files []FileChange
|
||||
PullRequest *PullRequest
|
||||
}
|
||||
|
||||
// FileChange 代表单个文件的变更
|
||||
type FileChange struct {
|
||||
Path string
|
||||
Content string
|
||||
OldPath string // 用于重命名场景
|
||||
Type ChangeType
|
||||
}
|
||||
|
||||
// ChangeType 代表变更类型
|
||||
type ChangeType string
|
||||
|
||||
const (
|
||||
Added ChangeType = "added"
|
||||
Modified ChangeType = "modified"
|
||||
Deleted ChangeType = "deleted"
|
||||
Renamed ChangeType = "renamed"
|
||||
)
|
||||
|
||||
// PullRequest 代表 PR/MR 信息
|
||||
type PullRequest struct {
|
||||
ID int
|
||||
Title string
|
||||
Description string
|
||||
SourceBranch string
|
||||
TargetBranch string
|
||||
}
|
Reference in New Issue
Block a user