(e Engine, repoID, since int64)
| 445 | } |
| 446 | |
| 447 | func getCommentsByRepoIDSince(e Engine, repoID, since int64) ([]*Comment, error) { |
| 448 | comments := make([]*Comment, 0, 10) |
| 449 | sess := e.Where("issue.repo_id = ?", repoID).Join("INNER", "issue", "issue.id = comment.issue_id").Asc("comment.created_unix") |
| 450 | if since > 0 { |
| 451 | sess.And("comment.updated_unix >= ?", since) |
| 452 | } |
| 453 | if err := sess.Find(&comments); err != nil { |
| 454 | return nil, err |
| 455 | } |
| 456 | return comments, loadCommentsAttributes(e, comments) |
| 457 | } |
| 458 | |
| 459 | func getCommentsByIssueID(e Engine, issueID int64) ([]*Comment, error) { |
| 460 | return getCommentsByIssueIDSince(e, issueID, -1) |
no test coverage detected