Merge remote-tracking branch 'origin/master'

This commit is contained in:
takezoe
2013-06-27 15:55:40 +09:00
3 changed files with 45 additions and 15 deletions

View File

@@ -169,7 +169,7 @@ trait IssuesService {
} exists, condition.labels.nonEmpty)
}
def saveIssue(owner: String, repository: String, loginUser: String,
def createIssue(owner: String, repository: String, loginUser: String,
title: String, content: Option[String]) =
// next id number
sql"SELECT ISSUE_ID + 1 FROM ISSUE_ID WHERE USER_NAME = $owner AND REPOSITORY_NAME = $repository FOR UPDATE".as[Int]
@@ -193,7 +193,7 @@ trait IssuesService {
}.map(_.issueId).update(id) > 0
} get
def saveComment(owner: String, repository: String, loginUser: String,
def createComment(owner: String, repository: String, loginUser: String,
issueId: Int, content: String) =
IssueComments.autoInc insert (
owner,
@@ -204,6 +204,23 @@ trait IssuesService {
currentDate,
currentDate)
def updateIssue(owner: String, repository: String, issueId: Int,
title: String, content: Option[String]) =
Issues filter { t =>
(t.userName is owner.bind) &&
(t.repositoryName is repository.bind) &&
(t.issueId is issueId.bind)
} map { t =>
t.title ~ t.content.? ~ t.updatedDate
} update (title, content, currentDate)
def updateComment(commentId: Int, content: String) =
IssueComments filter {
_.commentId is commentId.bind
} map { t =>
t.content ~ t.updatedDate
} update (content, currentDate)
}
object IssuesService {