mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Define session keys.
This commit is contained in:
47
src/main/scala/util/Keys.scala
Normal file
47
src/main/scala/util/Keys.scala
Normal file
@@ -0,0 +1,47 @@
|
||||
package util
|
||||
|
||||
/**
|
||||
* Define key strings for request attributes, session attributes or flash attributes..
|
||||
*/
|
||||
object Keys {
|
||||
|
||||
object Session {
|
||||
|
||||
/**
|
||||
* Session key for the logged in account information.
|
||||
*/
|
||||
val LoginAccount = "LOGIN_ACCOUNT"
|
||||
|
||||
/**
|
||||
* Session key for the redirect URL.
|
||||
*/
|
||||
val Redirect = "REDIRECT"
|
||||
|
||||
/**
|
||||
* Session key for the issue search condition in dashboard.
|
||||
*/
|
||||
val DashboardIssues = "dashboard/issues"
|
||||
|
||||
/**
|
||||
* Session key for the pull request search condition in dashboard.
|
||||
*/
|
||||
val DashboardPulls = "dashboard/pulls"
|
||||
|
||||
/**
|
||||
* Generate session key for the issue search condition.
|
||||
*/
|
||||
def Issues(owner: String, name: String) = s"${owner}/${name}/issues"
|
||||
|
||||
/**
|
||||
* Generate session key for the pull request search condition.
|
||||
*/
|
||||
def Pulls(owner: String, name: String) = s"${owner}/${name}/pulls"
|
||||
|
||||
/**
|
||||
* Generate session key for the upload filename.
|
||||
*/
|
||||
def Upload(fileId: String) = s"upload_${fileId}"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user