Define session keys.

This commit is contained in:
takezoe
2013-09-23 00:51:57 +09:00
parent 296fc9a3df
commit c57bc487a3
7 changed files with 68 additions and 26 deletions

View 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}"
}
}