Yeuoly 10 月之前
父節點
當前提交
08f2c50b49

+ 1 - 1
internal/core/plugin_manager/install.go

@@ -102,7 +102,7 @@ func (p *PluginManager) InstallToAWSFromPkg(tenant_id string, decoder decoder.Pl
 					return
 				}
 
-				_, _, err = curd.CreatePlugin(
+				_, _, err = curd.InstallPlugin(
 					tenant_id,
 					unique_identity,
 					plugin_entities.PLUGIN_RUNTIME_TYPE_AWS,

+ 2 - 2
internal/server/http_server.go

@@ -47,7 +47,7 @@ func (app *App) pluginGroup(group *gin.RouterGroup, config *app.Config) {
 	app.remoteDebuggingGroup(group.Group("/debugging"), config)
 	app.pluginDispatchGroup(group.Group("/dispatch"), config)
 	app.pluginManagementGroup(group.Group("/management"), config)
-	app.pluginAssetGroup(group.Group("/asset"), config)
+	app.pluginAssetGroup(group.Group("/asset"))
 }
 
 func (app *App) pluginDispatchGroup(group *gin.RouterGroup, config *app.Config) {
@@ -113,6 +113,6 @@ func (app *App) pluginManagementGroup(group *gin.RouterGroup, config *app.Config
 	group.GET("/tools", controllers.ListTools)
 }
 
-func (app *App) pluginAssetGroup(group *gin.RouterGroup, config *app.Config) {
+func (app *App) pluginAssetGroup(group *gin.RouterGroup) {
 	group.GET("/:id", controllers.GetAsset)
 }

+ 2 - 2
internal/service/install_plugin.go

@@ -57,7 +57,7 @@ func InstallPluginFromIdentifier(
 
 	declaration := plugin.Declaration
 	// install to this workspace
-	if _, _, err := curd.CreatePlugin(tenant_id, plugin_unique_identifier, plugin.InstallType, &declaration); err != nil {
+	if _, _, err := curd.InstallPlugin(tenant_id, plugin_unique_identifier, plugin.InstallType, &declaration); err != nil {
 		return entities.NewErrorResponse(-500, err.Error())
 	}
 
@@ -97,7 +97,7 @@ func UninstallPlugin(
 	}
 
 	// Uninstall the plugin
-	_, err = curd.DeletePlugin(tenant_id, plugin_unique_identifier, installation.ID)
+	_, err = curd.UninstallPlugin(tenant_id, plugin_unique_identifier, installation.ID)
 	if err != nil {
 		return entities.NewErrorResponse(-500, fmt.Sprintf("Failed to uninstall plugin: %s", err.Error()))
 	}

+ 2 - 2
internal/service/install_service/state.go

@@ -22,7 +22,7 @@ func InstallPlugin(
 	}
 
 	configuration := runtime.Configuration()
-	plugin, installation, err := curd.CreatePlugin(
+	plugin, installation, err := curd.InstallPlugin(
 		tenant_id,
 		identity,
 		runtime.Type(),
@@ -43,7 +43,7 @@ func UninstallPlugin(
 	install_type plugin_entities.PluginRuntimeType,
 ) error {
 	// delete the plugin from db
-	_, err := curd.DeletePlugin(tenant_id, plugin_unique_identifier, installation_id)
+	_, err := curd.UninstallPlugin(tenant_id, plugin_unique_identifier, installation_id)
 	if err != nil {
 		return err
 	}

+ 2 - 2
internal/types/models/curd/atomic.go

@@ -12,7 +12,7 @@ import (
 // Create plugin for a tenant, create plugin if it has never been created before
 // and install it to the tenant, return the plugin and the installation
 // if the plugin has been created before, return the plugin which has been created before
-func CreatePlugin(
+func InstallPlugin(
 	tenant_id string,
 	plugin_unique_identifier plugin_entities.PluginUniqueIdentifier,
 	install_type plugin_entities.PluginRuntimeType,
@@ -150,7 +150,7 @@ type DeletePluginResponse struct {
 // Delete plugin for a tenant, delete the plugin if it has never been created before
 // and uninstall it from the tenant, return the plugin and the installation
 // if the plugin has been created before, return the plugin which has been created before
-func DeletePlugin(tenant_id string, plugin_unique_identifier plugin_entities.PluginUniqueIdentifier, installation_id string) (*DeletePluginResponse, error) {
+func UninstallPlugin(tenant_id string, plugin_unique_identifier plugin_entities.PluginUniqueIdentifier, installation_id string) (*DeletePluginResponse, error) {
 	var plugin_to_be_returns *models.Plugin
 	var installation_to_be_returns *models.PluginInstallation