mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
Add access token table and manage ui.
This commit is contained in:
20
src/main/scala/model/AccessToken.scala
Normal file
20
src/main/scala/model/AccessToken.scala
Normal 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
|
||||
)
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user