mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-07-06 16:11:56 +08:00
首次提交APIPark代码,面向开源
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package plugin_cluster
|
||||
|
||||
import (
|
||||
"github.com/APIParkLab/APIPark/model/plugin_model"
|
||||
"github.com/APIParkLab/APIPark/module/plugin-cluster"
|
||||
"github.com/APIParkLab/APIPark/module/plugin-cluster/dto"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var (
|
||||
_ IPluginClusterController = (*imlPluginClusterController)(nil)
|
||||
)
|
||||
|
||||
type imlPluginClusterController struct {
|
||||
module plugin_cluster.IPluginClusterModule `autowired:""`
|
||||
}
|
||||
|
||||
func (i *imlPluginClusterController) Info(ctx *gin.Context, name string) (*dto.Define, error) {
|
||||
return i.module.GetDefine(ctx, name)
|
||||
}
|
||||
|
||||
func (i *imlPluginClusterController) Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error) {
|
||||
return i.module.Options(ctx)
|
||||
}
|
||||
|
||||
func (i *imlPluginClusterController) List(ctx *gin.Context, clusterId string) ([]*dto.Item, error) {
|
||||
return i.module.List(ctx, clusterId)
|
||||
}
|
||||
|
||||
func (i *imlPluginClusterController) Get(ctx *gin.Context, clusterId string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error) {
|
||||
return i.module.Get(ctx, clusterId, name)
|
||||
}
|
||||
|
||||
func (i *imlPluginClusterController) Set(ctx *gin.Context, clusterId string, name string, config *dto.PluginSetting) error {
|
||||
return i.module.Set(ctx, clusterId, name, config)
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package plugin_cluster
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/APIParkLab/APIPark/model/plugin_model"
|
||||
"github.com/APIParkLab/APIPark/module/plugin-cluster/dto"
|
||||
"github.com/eolinker/go-common/autowire"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type IPluginClusterController interface {
|
||||
List(ctx *gin.Context, clusterId string) ([]*dto.Item, error)
|
||||
Get(ctx *gin.Context, clusterId string, name string) (config *dto.PluginOutput, render plugin_model.Render, er error)
|
||||
Set(ctx *gin.Context, clusterId string, name string, config *dto.PluginSetting) error
|
||||
Option(ctx *gin.Context, project string) ([]*dto.PluginOption, error)
|
||||
Info(ctx *gin.Context, name string) (*dto.Define, error)
|
||||
}
|
||||
|
||||
func init() {
|
||||
autowire.Auto[IPluginClusterController](func() reflect.Value {
|
||||
return reflect.ValueOf(new(imlPluginClusterController))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user