This is an automated email from the ASF dual-hosted git repository.

kumfo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git


The following commit(s) were added to refs/heads/main by this push:
     new 223be5a  fix(embed):Fixed #189, Closes #189. add GetEmbedConfigs to 
fixed type conflict. It will be resolved when Answer v1.4.0 release.
223be5a is described below

commit 223be5ae9760304455c481f88e989036604abe91
Author: kumfo <[email protected]>
AuthorDate: Mon Aug 19 16:20:35 2024 +0800

    fix(embed):Fixed #189, Closes #189. add GetEmbedConfigs to fixed type 
conflict. It will be resolved when Answer v1.4.0 release.
---
 embed-basic/basic.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/embed-basic/basic.go b/embed-basic/basic.go
index 624be07..3d81378 100644
--- a/embed-basic/basic.go
+++ b/embed-basic/basic.go
@@ -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"
@@ -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
+}

Reply via email to