mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 20:07:30 +02:00
Move dataColumnType import statement to the top
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
package gitbucket.core.service
|
||||
|
||||
import org.slf4j.LoggerFactory
|
||||
import gitbucket.core.model.{GroupMember, Account}
|
||||
import gitbucket.core.model.Profile._
|
||||
import gitbucket.core.util.{StringUtil, LDAPUtil}
|
||||
import StringUtil._
|
||||
import gitbucket.core.service.SystemSettingsService.SystemSettings
|
||||
import profile._
|
||||
import profile.api._
|
||||
import StringUtil._
|
||||
import org.slf4j.LoggerFactory
|
||||
// TODO Why is direct import required?
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
trait AccountService {
|
||||
|
||||
@@ -3,13 +3,8 @@ package gitbucket.core.service
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile._
|
||||
import profile.api._
|
||||
|
||||
import gitbucket.core.model.{CommitState, CommitStatus, Account}
|
||||
import gitbucket.core.util.Implicits._
|
||||
import gitbucket.core.util.StringUtil._
|
||||
import gitbucket.core.service.RepositoryService.RepositoryInfo
|
||||
import org.joda.time.LocalDateTime
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
import gitbucket.core.model.{CommitState, CommitStatus, Account}
|
||||
|
||||
trait CommitStatusService {
|
||||
/** insert or update */
|
||||
|
||||
@@ -4,7 +4,7 @@ import gitbucket.core.model.CommitComment
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile._
|
||||
import profile.api._
|
||||
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
trait CommitsService {
|
||||
|
||||
@@ -38,7 +38,6 @@ trait CommitsService {
|
||||
issueId = issueId)
|
||||
|
||||
def updateCommitComment(commentId: Int, content: String)(implicit s: Session) = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
CommitComments
|
||||
.filter (_.byPrimaryKey(commentId))
|
||||
.map { t => (t.content, t.updatedDate) }
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package gitbucket.core.service
|
||||
|
||||
import gitbucket.core.model.Profile._
|
||||
import gitbucket.core.util.JGitUtil.CommitInfo
|
||||
import profile._
|
||||
import profile.api._
|
||||
import gitbucket.core.util.StringUtil._
|
||||
import gitbucket.core.util.Implicits._
|
||||
import gitbucket.core.model.{Account, CommitState, Issue, IssueComment, IssueLabel, Label, PullRequest, Repository}
|
||||
|
||||
//import scala.slick.jdbc.{StaticQuery => Q}
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile._
|
||||
import profile.api._
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
|
||||
trait IssuesService {
|
||||
@@ -277,7 +276,6 @@ trait IssuesService {
|
||||
}
|
||||
|
||||
def updateIssue(owner: String, repository: String, issueId: Int, title: String, content: Option[String])(implicit s: Session) = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
Issues
|
||||
.filter (_.byPrimaryKey(owner, repository, issueId))
|
||||
.map { t => (t.title, t.content.?, t.updatedDate) }
|
||||
@@ -293,7 +291,6 @@ trait IssuesService {
|
||||
Issues.filter (_.byPrimaryKey(owner, repository, issueId)).map(_.milestoneId?).unsafeUpdate (milestoneId)
|
||||
|
||||
def updateComment(commentId: Int, content: String)(implicit s: Session) = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
IssueComments.filter (_.byPrimaryKey(commentId)).map(t => (t.content, t.updatedDate)).unsafeUpdate(content, currentDate)
|
||||
}
|
||||
|
||||
@@ -301,7 +298,6 @@ trait IssuesService {
|
||||
IssueComments filter (_.byPrimaryKey(commentId)) unsafeDelete
|
||||
|
||||
def updateClosed(owner: String, repository: String, issueId: Int, closed: Boolean)(implicit s: Session) = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
(Issues filter (_.byPrimaryKey(owner, repository, issueId)) map(t => (t.closed, t.updatedDate))).unsafeUpdate((closed, currentDate))
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import gitbucket.core.model.Milestone
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile._
|
||||
import profile.api._
|
||||
// TODO Why is direct import required?
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
trait MilestonesService {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package gitbucket.core.service
|
||||
|
||||
import gitbucket.core.controller.Context
|
||||
import gitbucket.core.util.JGitUtil
|
||||
import gitbucket.core.model.{Collaborator, Repository, Account}
|
||||
import gitbucket.core.model.Profile._
|
||||
import gitbucket.core.util.JGitUtil
|
||||
import profile._
|
||||
import profile.api._
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
trait RepositoryService { self: AccountService =>
|
||||
import RepositoryService._
|
||||
@@ -237,8 +238,6 @@ trait RepositoryService { self: AccountService =>
|
||||
* @return the repository information list
|
||||
*/
|
||||
def getAllRepositories(userName: String)(implicit s: Session): List[(String, String)] = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
Repositories.filter { t1 =>
|
||||
(t1.isPrivate === false.bind) ||
|
||||
(t1.userName === userName.bind) ||
|
||||
@@ -249,8 +248,6 @@ trait RepositoryService { self: AccountService =>
|
||||
}
|
||||
|
||||
def getUserRepositories(userName: String, withoutPhysicalInfo: Boolean = false)(implicit s: Session): List[RepositoryInfo] = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
Repositories.filter { t1 =>
|
||||
(t1.userName === userName.bind) ||
|
||||
(Collaborators.filter { t2 => t2.byRepository(t1.userName, t1.repositoryName) && (t2.collaboratorName === userName.bind)} exists)
|
||||
@@ -283,8 +280,6 @@ trait RepositoryService { self: AccountService =>
|
||||
def getVisibleRepositories(loginAccount: Option[Account], repositoryUserName: Option[String] = None,
|
||||
withoutPhysicalInfo: Boolean = false)
|
||||
(implicit s: Session): List[RepositoryInfo] = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
(loginAccount match {
|
||||
// for Administrators
|
||||
case Some(x) if(x.isAdmin) => Repositories
|
||||
@@ -324,7 +319,6 @@ trait RepositoryService { self: AccountService =>
|
||||
* Updates the last activity date of the repository.
|
||||
*/
|
||||
def updateLastActivityDate(userName: String, repositoryName: String)(implicit s: Session): Unit = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
Repositories.filter(_.byRepository(userName, repositoryName)).map(_.lastActivityDate).unsafeUpdate(currentDate)
|
||||
}
|
||||
|
||||
@@ -335,8 +329,6 @@ trait RepositoryService { self: AccountService =>
|
||||
description: Option[String], isPrivate: Boolean,
|
||||
enableIssues: Boolean, externalIssuesUrl: Option[String],
|
||||
enableWiki: Boolean, allowWikiEditing: Boolean, externalWikiUrl: Option[String])(implicit s: Session): Unit = {
|
||||
import gitbucket.core.model.Profile.dateColumnType
|
||||
|
||||
Repositories.filter(_.byRepository(userName, repositoryName))
|
||||
.map { r => (r.description.?, r.isPrivate, r.enableIssues, r.externalIssuesUrl.?, r.enableWiki, r.allowWikiEditing, r.externalWikiUrl.?, r.updatedDate) }
|
||||
.unsafeUpdate (description, isPrivate, enableIssues, externalIssuesUrl, enableWiki, allowWikiEditing, externalWikiUrl, currentDate)
|
||||
|
||||
Reference in New Issue
Block a user