mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #464)Add PLUGIN table for plugin management
This commit is contained in:
19
src/main/scala/service/PluginService.scala
Normal file
19
src/main/scala/service/PluginService.scala
Normal file
@@ -0,0 +1,19 @@
|
||||
package service
|
||||
|
||||
import model.Profile._
|
||||
import profile.simple._
|
||||
import model.Plugin
|
||||
|
||||
trait PluginService {
|
||||
|
||||
def getPlugins()(implicit s: Session): List[Plugin] = Plugins.sortBy(_.pluginId).list
|
||||
|
||||
def registerPlugin(plugin: Plugin)(implicit s: Session): Unit = Plugins.insert(plugin)
|
||||
|
||||
def updatePlugin(plugin: Plugin)(implicit s: Session): Unit = Plugins.update(plugin)
|
||||
|
||||
def deletePlugin(pluginId: String)(implicit s: Session): Unit = Plugins.filter(_.pluginId === pluginId.bind).delete
|
||||
|
||||
def getPlugin(pluginId: String): Option[Plugin] = Plugins.filter(_.pluginId === pluginId.bind).firstOption
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user