Skip to content

Commit

Permalink
fix(embed):Fixed #189, Closes #189. add GetEmbedConfigs to fixed type…
Browse files Browse the repository at this point in the history
… conflict. It will be resolved when Answer v1.4.0 release.
  • Loading branch information
kumfo committed Aug 21, 2024
1 parent 052c38e commit 223be5a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions embed-basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"embed"
"encoding/json"
"github.com/apache/incubator-answer-plugins/util"
"github.com/gin-gonic/gin"

"github.com/apache/incubator-answer-plugins/embed-basic/i18n"
"github.com/apache/incubator-answer/plugin"
Expand Down Expand Up @@ -163,3 +164,15 @@ func (e *Embed) ConfigReceiver(config []byte) error {
e.Config = c
return nil
}

// GetEmbedConfigs get embed configs
func (e *Embed) GetEmbedConfigs(ctx *gin.Context) (embedConfigs []*plugin.EmbedConfig, err error) {
embedConfigs = make([]*plugin.EmbedConfig, 0)
for _, field := range e.ConfigFields() {
embedConfigs = append(embedConfigs, &plugin.EmbedConfig{
Platform: field.Name,
Enable: field.Value.(bool),
})
}
return
}

0 comments on commit 223be5a

Please sign in to comment.