mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Change action(IssueComment) to String type.
This commit is contained in:
@@ -9,9 +9,9 @@ object IssueComments extends Table[IssueComment]("ISSUE_COMMENT") with IssueTemp
|
|||||||
def content = column[String]("CONTENT")
|
def content = column[String]("CONTENT")
|
||||||
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
|
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
|
||||||
def updatedDate = column[java.util.Date]("UPDATED_DATE")
|
def updatedDate = column[java.util.Date]("UPDATED_DATE")
|
||||||
def * = userName ~ repositoryName ~ issueId ~ commentId ~ action.? ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
|
def * = userName ~ repositoryName ~ issueId ~ commentId ~ action ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
|
||||||
|
|
||||||
def autoInc = userName ~ repositoryName ~ issueId ~ action.? ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
|
def autoInc = userName ~ repositoryName ~ issueId ~ action ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
|
||||||
def byPrimaryKey(commentId: Int) = this.commentId is commentId.bind
|
def byPrimaryKey(commentId: Int) = this.commentId is commentId.bind
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ case class IssueComment(
|
|||||||
repositoryName: String,
|
repositoryName: String,
|
||||||
issueId: Int,
|
issueId: Int,
|
||||||
commentId: Int,
|
commentId: Int,
|
||||||
action: Option[String],
|
action: String,
|
||||||
commentedUserName: String,
|
commentedUserName: String,
|
||||||
content: String,
|
content: String,
|
||||||
registeredDate: java.util.Date,
|
registeredDate: java.util.Date,
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ trait IssuesService {
|
|||||||
IssueLabels filter(_.byPrimaryKey(owner, repository, issueId, labelId)) delete
|
IssueLabels filter(_.byPrimaryKey(owner, repository, issueId, labelId)) delete
|
||||||
|
|
||||||
def createComment(owner: String, repository: String, loginUser: String,
|
def createComment(owner: String, repository: String, loginUser: String,
|
||||||
issueId: Int, content: String, action: Option[String]) =
|
issueId: Int, content: String, action: String) =
|
||||||
IssueComments.autoInc insert (
|
IssueComments.autoInc insert (
|
||||||
owner,
|
owner,
|
||||||
repository,
|
repository,
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class CommitLogHook(owner: String, repository: String, userName: String) extends
|
|||||||
"(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData =>
|
"(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData =>
|
||||||
val issueId = matchData.group(2)
|
val issueId = matchData.group(2)
|
||||||
if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){
|
if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){
|
||||||
createComment(owner, repository, commit.committer, issueId.toInt, commit.fullMessage, Some("commit"))
|
createComment(owner, repository, commit.committer, issueId.toInt, commit.fullMessage, "commit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(commit)
|
Some(commit)
|
||||||
|
|||||||
Reference in New Issue
Block a user