Add access token table and manage ui.

This commit is contained in:
nazoking
2015-01-28 14:44:45 +09:00
parent 20217058fe
commit d6946b93c3
8 changed files with 180 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
package model
trait AccessTokenComponent { self: Profile =>
import profile.simple._
lazy val AccessTokens = TableQuery[AccessTokens]
class AccessTokens(tag: Tag) extends Table[AccessToken](tag, "ACCESS_TOKEN") {
val accessTokenId = column[Int]("ACCESS_TOKEN_ID", O AutoInc)
val userName = column[String]("USER_NAME")
val tokenHash = column[String]("TOKEN_HASH")
val note = column[String]("NOTE")
def * = (accessTokenId, userName, tokenHash, note) <> (AccessToken.tupled, AccessToken.unapply)
}
}
case class AccessToken(
accessTokenId: Int = 0,
userName: String,
tokenHash: String,
note: String
)

View File

@@ -19,7 +19,8 @@ trait Profile {
object Profile extends {
val profile = slick.driver.H2Driver
} with AccountComponent
} with AccessTokenComponent
with AccountComponent
with ActivityComponent
with CollaboratorComponent
with CommitCommentComponent