mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Add Scaladoc for models.
This commit is contained in:
@@ -15,10 +15,37 @@ import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
|||||||
import org.eclipse.jgit.revwalk.RevWalk
|
import org.eclipse.jgit.revwalk.RevWalk
|
||||||
|
|
||||||
// TODO Should models move to other package?
|
// TODO Should models move to other package?
|
||||||
|
/**
|
||||||
|
* The repository data.
|
||||||
|
*
|
||||||
|
* @param owner the user name of the repository owner
|
||||||
|
* @param repository the repository name
|
||||||
|
* @param url the repository URL
|
||||||
|
* @param branchList the list of branch names
|
||||||
|
* @param tags the list of tags
|
||||||
|
*/
|
||||||
case class RepositoryInfo(owner: String, name: String, url: String, branchList: List[String], tags: List[String])
|
case class RepositoryInfo(owner: String, name: String, url: String, branchList: List[String], tags: List[String])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file data for the file list of the repository viewer.
|
||||||
|
*
|
||||||
|
* @param id the object id
|
||||||
|
* @param isDirectory whether is it directory
|
||||||
|
* @param name the file (or directory) name
|
||||||
|
* @param time the last modified time
|
||||||
|
* @param message the last commit message
|
||||||
|
* @param committer the last committer name
|
||||||
|
*/
|
||||||
case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, time: Date, message: String, committer: String)
|
case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, time: Date, message: String, committer: String)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The commit data.
|
||||||
|
*
|
||||||
|
* @param id the commit id
|
||||||
|
* @param time the commit time
|
||||||
|
* @param committer the commiter name
|
||||||
|
* @param message the commit message
|
||||||
|
*/
|
||||||
case class CommitInfo(id: String, time: Date, committer: String, message: String){
|
case class CommitInfo(id: String, time: Date, committer: String, message: String){
|
||||||
def this(rev: org.eclipse.jgit.revwalk.RevCommit) =
|
def this(rev: org.eclipse.jgit.revwalk.RevCommit) =
|
||||||
this(rev.getName, rev.getCommitterIdent.getWhen, rev.getCommitterIdent.getName, rev.getFullMessage)
|
this(rev.getName, rev.getCommitterIdent.getWhen, rev.getCommitterIdent.getName, rev.getFullMessage)
|
||||||
@@ -26,6 +53,12 @@ case class CommitInfo(id: String, time: Date, committer: String, message: String
|
|||||||
|
|
||||||
case class DiffInfo(changeType: ChangeType, oldPath: String, newPath: String, oldContent: Option[String], newContent: Option[String])
|
case class DiffInfo(changeType: ChangeType, oldPath: String, newPath: String, oldContent: Option[String], newContent: Option[String])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The file content data for the file content view of the repository viewer.
|
||||||
|
*
|
||||||
|
* @param viewType "image", "large" or "other"
|
||||||
|
* @param content the string content
|
||||||
|
*/
|
||||||
case class ContentInfo(viewType: String, content: Option[String])
|
case class ContentInfo(viewType: String, content: Option[String])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +71,7 @@ class RepositoryViewerServlet extends ServletBase {
|
|||||||
*/
|
*/
|
||||||
get("/:owner") {
|
get("/:owner") {
|
||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
|
|
||||||
html.user(owner, getRepositories(owner).map(JGitUtil.getRepositoryInfo(owner, _, servletContext)))
|
html.user(owner, getRepositories(owner).map(JGitUtil.getRepositoryInfo(owner, _, servletContext)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user