fix(backend_plugin): plugin common header and parameter default value (#181)

This commit is contained in:
mrh997
2025-07-29 19:29:36 +08:00
committed by GitHub
parent 8137b0aee5
commit 53345f58c2
7 changed files with 204 additions and 80 deletions

View File

@@ -46,6 +46,7 @@ import (
func (p *pluginServiceImpl) CreateDraftPlugin(ctx context.Context, req *CreateDraftPluginRequest) (pluginID int64, err error) {
mf := entity.NewDefaultPluginManifest()
mf.CommonParams = map[model.HTTPParamLocation][]*plugin_develop_common.CommonParamSchema{}
mf.NameForHuman = req.Name
mf.NameForModel = req.Name
mf.DescriptionForHuman = req.Desc
@@ -65,11 +66,11 @@ func (p *pluginServiceImpl) CreateDraftPlugin(ctx context.Context, req *CreateDr
return 0, fmt.Errorf("invalid location '%s'", loc.String())
}
for _, param := range params {
mParams := mf.CommonParams[location]
mParams = append(mParams, &plugin_develop_common.CommonParamSchema{
Name: param.Name,
Value: param.Value,
})
mf.CommonParams[location] = append(mf.CommonParams[location],
&plugin_develop_common.CommonParamSchema{
Name: param.Name,
Value: param.Value,
})
}
}