feat✨ 添加api管理
This commit is contained in:
1 parent
c13d13ccf4
commit
0a3e3be12c
2 files changed
+5
-6
No files matched your search
@@ -3,7 +3,6 @@ package router
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
jwt "github.com/go-admin-team/go-admin-core/sdk/pkg/jwtauth"
|
||||
|
||||
"go-admin/app/admin/models"
|
||||
"go-admin/app/admin/service/dto"
|
||||
"go-admin/common/actions"
|
||||
@@ -24,8 +23,8 @@ func registerSysApiRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlew
|
||||
return &list
|
||||
}))
|
||||
r.GET("/:id", actions.PermissionAction(), actions.ViewAction(new(dto.SysApiById), nil))
|
||||
r.POST("", actions.CreateAction(new(dto.SysApiControl)))
|
||||
//r.POST("", actions.CreateAction(new(dto.SysApiControl)))
|
||||
r.PUT("/:id", actions.PermissionAction(), actions.UpdateAction(new(dto.SysApiControl)))
|
||||
r.DELETE("", actions.PermissionAction(), actions.DeleteAction(new(dto.SysApiById)))
|
||||
//r.DELETE("", actions.PermissionAction(), actions.DeleteAction(new(dto.SysApiById)))
|
||||
}
|
||||
}
|
||||
@@ -44,8 +44,8 @@ type SysApiControl struct {
|
||||
Path string `json:"path" comment:"地址"`
|
||||
Paths string `json:"paths" comment:""`
|
||||
Action string `json:"action" comment:"类型"`
|
||||
ParentId string `json:"parentId" comment:"按钮id"`
|
||||
Sort string `json:"sort" comment:"排序"`
|
||||
ParentId int `json:"parentId" comment:"按钮id"`
|
||||
Sort int `json:"sort" comment:"排序"`
|
||||
}
|
||||
|
||||
func (s *SysApiControl) Generate() dto.Control {
|
||||
@@ -70,7 +70,7 @@ func (s *SysApiControl) Bind(ctx *gin.Context) error {
|
||||
|
||||
func (s *SysApiControl) GenerateM() (common.ActiveRecord, error) {
|
||||
return &models.SysApi{
|
||||
Model: common.Model{Id: s.Id},
|
||||
Id: s.Id,
|
||||
Name: s.Name,
|
||||
Title: s.Title,
|
||||
Path: s.Path,
|
||||
Reference in new issue
Block a user