(refs #488)Add service.IssuesService.IssueInfo

This commit is contained in:
Naoki Takezoe
2014-09-21 02:06:38 +09:00
parent 3b1367dd8e
commit 706fa77de3
8 changed files with 20 additions and 15 deletions

View File

@@ -116,7 +116,7 @@ trait IssuesService {
*/
def searchIssue(condition: IssueSearchCondition, filterUser: Map[String, String], onlyPullRequest: Boolean,
offset: Int, limit: Int, repos: (String, String)*)
(implicit s: Session): List[(Issue, List[Label], Option[String], Int)] = {
(implicit s: Session): List[IssueInfo] = {
// get issues and comment count and labels
searchIssueQuery(repos, condition, filterUser, onlyPullRequest)
@@ -148,7 +148,7 @@ trait IssuesService {
}
.map { issues => issues.head match {
case (issue, commentCount, _, _, _, milestone) =>
(issue,
IssueInfo(issue,
issues.flatMap { t => t._3.map (
Label(issue.userName, issue.repositoryName, _, t._4.get, t._5.get)
)} toList,
@@ -385,4 +385,6 @@ object IssuesService {
}
}
case class IssueInfo(issue: Issue, labels: List[Label], milestone: Option[String], commentCount: Int)
}