lckt-server/resource/plugin/server/plugin.go.template
2025-04-09 12:17:33 +08:00

27 lines
802 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package {{ .Package }}
import (
"context"
"{{.Module}}/plugin/{{ .Package }}/initialize"
interfaces "{{.Module}}/utils/plugin/v2"
"github.com/gin-gonic/gin"
)
var _ interfaces.Plugin = (*plugin)(nil)
var Plugin = new(plugin)
type plugin struct{}
// 如果需要配置文件请到config.Config中填充配置结构且到下方发放中填入其在config.yaml中的key并添加如下方法
// initialize.Viper()
// 安装插件时候自动注册的api数据请到下方法.Api方法中实现并添加如下方法
// initialize.Api(ctx)
// 安装插件时候自动注册的api数据请到下方法.Menu方法中实现并添加如下方法
// initialize.Menu(ctx)
func (p *plugin) Register(group *gin.Engine) {
ctx := context.Background()
initialize.Gorm(ctx)
initialize.Router(group)
}