mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 15:05:50 +01:00
Remove unused model and service for PLUGIN table
This commit is contained in:
@@ -55,12 +55,6 @@ trait SystemSettingsControllerBase extends ControllerBase {
|
||||
} else Nil
|
||||
}
|
||||
|
||||
private val pluginForm = mapping(
|
||||
"pluginId" -> list(trim(label("", text())))
|
||||
)(PluginForm.apply)
|
||||
|
||||
case class PluginForm(pluginIds: List[String])
|
||||
|
||||
get("/admin/system")(adminOnly {
|
||||
html.system(flash.get("info"))
|
||||
})
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package gitbucket.core.model
|
||||
|
||||
trait PluginComponent extends TemplateComponent { self: Profile =>
|
||||
import profile.simple._
|
||||
import self._
|
||||
|
||||
lazy val Plugins = TableQuery[Plugins]
|
||||
|
||||
class Plugins(tag: Tag) extends Table[Plugin](tag, "PLUGIN"){
|
||||
val pluginId = column[String]("PLUGIN_ID", O PrimaryKey)
|
||||
val version = column[String]("VERSION")
|
||||
def * = (pluginId, version) <> (Plugin.tupled, Plugin.unapply)
|
||||
}
|
||||
}
|
||||
|
||||
case class Plugin(
|
||||
pluginId: String,
|
||||
version: String
|
||||
)
|
||||
@@ -49,6 +49,5 @@ trait CoreProfile extends ProfileProvider with Profile
|
||||
with SshKeyComponent
|
||||
with WebHookComponent
|
||||
with WebHookEventComponent
|
||||
with PluginComponent
|
||||
|
||||
object Profile extends CoreProfile
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package gitbucket.core.service
|
||||
|
||||
import gitbucket.core.model.Plugin
|
||||
import gitbucket.core.model.Profile._
|
||||
import profile.simple._
|
||||
|
||||
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.filter(_.pluginId === plugin.pluginId.bind).map(_.version).update(plugin.version)
|
||||
|
||||
def deletePlugin(pluginId: String)(implicit s: Session): Unit =
|
||||
Plugins.filter(_.pluginId === pluginId.bind).delete
|
||||
|
||||
def getPlugin(pluginId: String)(implicit s: Session): Option[Plugin] =
|
||||
Plugins.filter(_.pluginId === pluginId.bind).firstOption
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user