mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 12:32:25 +00:00
Drop view (#1137)
* sys_initdb_mysql/pgsql.go: 优化流程, 创建database前,如果dbname为空直接返回 * 删除视图逻辑 * 摘除视图初始化逻辑 * 移除dialog废弃的title标签修改为header * 解决部分浏览器登录后遮罩不消失的bug * 修复角色菜单逻辑 * element 2.2.2=>2.2.5 * 修复插件模板 * 调整自动插件模板到插件功能下 * 切换角色切换至角色首页 Co-authored-by: Lyon.Nee <lyon.nee@outlook.com>
This commit is contained in:
committed by
GitHub
co-authored by
Lyon.Nee
parent
8504e9bf74
commit
091f83ff59
@@ -1,32 +0,0 @@
|
||||
package example_plugin
|
||||
|
||||
// 我们为您准备了一个需要提供api的插件模板 您只需要按照此模板注册路由即可 插件使用请把此包放置在plugin下
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var ExamplePlugin = new(pluginExample)
|
||||
|
||||
type pluginExample struct{}
|
||||
|
||||
func NewPluginExample() *pluginExample {
|
||||
// 此处为注册生命周期 可以在此处写初始化内容
|
||||
return &pluginExample{}
|
||||
}
|
||||
|
||||
func (*pluginExample) Register(group *gin.RouterGroup) {
|
||||
//如需细分权限 可以在此处use中间件 gva项目包名已改为github模式
|
||||
//所以整个plugin可以直接独立到外层开启为新的项目 然后用包的形式导入也是可以完整运行的
|
||||
|
||||
group.GET("hello",
|
||||
func(context *gin.Context) {
|
||||
// 此处请填写handle函数
|
||||
// 您依然可以模仿gva分层进行插件制作 当然您也可以按照您所习惯的分层模式开发
|
||||
context.JSON(200, "hello world")
|
||||
})
|
||||
}
|
||||
|
||||
func (*pluginExample) RouterPath() string {
|
||||
// 此处为您插件的总路由path 录入本插件安装进入项目后 会自动产生路由 /[主项目跟路由(如果有的话)]/group/xxxx
|
||||
return "group"
|
||||
}
|
||||
@@ -17,11 +17,11 @@ type {{ .PlugName}}Api struct{}
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
|
||||
// @Router /{{ .RouterGroup}}/routerName [post]
|
||||
func (p *{{ .PlugName}}Api) ApiName(c *gin.Context) {
|
||||
{{- if .HasRequest}}
|
||||
{{ if .HasRequest}}
|
||||
var plug model.Request
|
||||
_ = c.ShouldBindJSON(&plug)
|
||||
{{ end -}}
|
||||
if {{- if .HasResponse }} res, {{ end -}} err:= service.ServiceGroupApp.PlugService({{ if .HasRequest }}plug{{ end -}}); err != nil {
|
||||
{{ end }}
|
||||
if {{ if .HasResponse }} res, {{ end }} err:= service.ServiceGroupApp.PlugService({{ if .HasRequest }}plug{{ end -}}); err != nil {
|
||||
global.GVA_LOG.Error("失败!", zap.Error(err))
|
||||
response.FailWithMessage("失败", c)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user