| |
---|
| | |
---|
| | def getComments(owner: String, repository: String, issueId: Int)(implicit s: Session) = |
---|
| | IssueComments filter (_.byIssue(owner, repository, issueId)) list |
---|
| | |
---|
| | def getCommentsForApi(owner: String, repository: String, issueId: Int)(implicit s: Session) = |
---|
| | /** @return IssueComment and commentedUser */ |
---|
| | def getCommentsForApi(owner: String, repository: String, issueId: Int)(implicit s: Session): List[(IssueComment, Account)] = |
---|
| | IssueComments.filter(_.byIssue(owner, repository, issueId)) |
---|
| | .filter(_.action inSetBind Set("comment" , "close_comment", "reopen_comment")) |
---|
| | .innerJoin(Accounts).on( (t1, t2) => t1.userName === t2.userName ) |
---|
| | .innerJoin(Accounts).on( (t1, t2) => t1.commentedUserName === t2.userName ) |
---|
| | .list |
---|
| | |
---|
| | def getComment(owner: String, repository: String, commentId: String)(implicit s: Session) = |
---|
| | if (commentId forall (_.isDigit)) |
---|
| |
---|
| | }} toList |
---|
| | } |
---|
| | |
---|
| | /** for api |
---|
| | * @return (issue, commentCount, pullRequest, headRepository, headOwner) |
---|
| | * @return (issue, issueUser, commentCount, pullRequest, headRepo, headOwner) |
---|
| | */ |
---|
| | def searchPullRequestByApi(condition: IssueSearchCondition, offset: Int, limit: Int, repos: (String, String)*) |
---|
| | (implicit s: Session): List[(Issue, Account, Int, PullRequest, Repository, Account)] = { |
---|
| | // get issues and comment count and labels |
---|
| | searchIssueQueryBase(condition, true, offset, limit, repos) |
---|
| | .innerJoin(PullRequests).on { case ((t1, t2), t3) => t3.byPrimaryKey(t1.userName, t1.repositoryName, t1.issueId) } |
---|
| | .innerJoin(Repositories).on { case (((t1, t2), t3), t4) => t4.byRepository(t1.userName, t1.repositoryName) } |
---|
| | .innerJoin(Accounts).on { case ((((t1, t2), t3), t4), t5) => t5.userName === t1.userName } |
---|
| | .innerJoin(Accounts).on { case ((((t1, t2), t3), t4), t5) => t5.userName === t1.openedUserName } |
---|
| | .innerJoin(Accounts).on { case (((((t1, t2), t3), t4), t5), t6) => t6.userName === t4.userName } |
---|
| | .map { case (((((t1, t2), t3), t4), t5), t6) => |
---|
| | (t1, t5, t2.commentCount, t3, t4, t6) |
---|
| | } |
---|
| |
---|
| | |
|