Skip to content

Commit 27a0cc1

Browse files
committed
fix
1 parent e1fc6d7 commit 27a0cc1

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

backend/biz/project/repo/project.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func (r *ProjectRepo) List(ctx context.Context, uid uuid.UUID, cursor domain.Cur
9090
Where(projecttask.HasTaskWith(task.DeletedAtIsNil())).
9191
Order(projecttask.ByCreatedAt(sql.OrderDesc()))
9292
}).
93+
WithGitBots().
9394
After(ctx, cursor.Cursor, cursor.Limit)
9495
if err != nil {
9596
return nil, nil, err

backend/domain/project.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,22 @@ func (c *Collaborator) From(src *db.ProjectCollaborator) *Collaborator {
166166

167167
// Project 项目
168168
type 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

186187
func (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

Comments
 (0)