@@ -166,21 +166,22 @@ func (c *Collaborator) From(src *db.ProjectCollaborator) *Collaborator {
166166
167167// Project 项目
168168type Project struct {
169- ID uuid.UUID `json:"id"`
170- Name string `json:"name"`
171- RepoURL string `json:"repo_url"`
172- FullName string `json:"full_name"`
173- Description string `json:"description"`
174- Platform consts.GitPlatform `json:"platform"`
175- CreatedAt int64 `json:"created_at"`
176- UpdatedAt int64 `json:"updated_at"`
177- User * User `json:"user"`
178- Issues []* ProjectIssue `json:"issues"`
179- Collaborators []* Collaborator `json:"collaborators"`
180- ImageID uuid.UUID `json:"image_id"`
181- GitIdentityID uuid.UUID `json:"git_identity_id"`
182- EnvVariables map [string ]any `json:"env_variables"`
183- Tasks []* ProjectTask `json:"tasks"`
169+ ID uuid.UUID `json:"id"`
170+ Name string `json:"name"`
171+ RepoURL string `json:"repo_url"`
172+ FullName string `json:"full_name"`
173+ Description string `json:"description"`
174+ Platform consts.GitPlatform `json:"platform"`
175+ CreatedAt int64 `json:"created_at"`
176+ UpdatedAt int64 `json:"updated_at"`
177+ User * User `json:"user"`
178+ Issues []* ProjectIssue `json:"issues"`
179+ Collaborators []* Collaborator `json:"collaborators"`
180+ ImageID uuid.UUID `json:"image_id"`
181+ GitIdentityID uuid.UUID `json:"git_identity_id"`
182+ EnvVariables map [string ]any `json:"env_variables"`
183+ Tasks []* ProjectTask `json:"tasks"`
184+ AutoReviewEnabled bool `json:"auto_review_enabled"` // 是否开启自动审查
184185}
185186
186187func (p * Project ) From (src * db.Project ) * Project {
@@ -208,6 +209,7 @@ func (p *Project) From(src *db.Project) *Project {
208209 p .Tasks = cvt .Iter (src .Edges .ProjectTasks , func (_ int , pt * db.ProjectTask ) * ProjectTask {
209210 return cvt .From (pt , & ProjectTask {})
210211 })
212+ p .AutoReviewEnabled = len (src .Edges .GitBots ) > 0
211213 return p
212214}
213215
0 commit comments