|
@@ -55,7 +55,7 @@ func GetMenuList(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func AddBaseMenu(c *gin.Context) {
|
|
@@ -86,21 +86,16 @@ func GetBaseMenuTree(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-type AddMenuAuthorityInfo struct {
|
|
|
- Menus []model.SysBaseMenu
|
|
|
- AuthorityId string
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func AddMenuAuthority(c *gin.Context) {
|
|
|
- var addMenuAuthorityInfo AddMenuAuthorityInfo
|
|
|
+ var addMenuAuthorityInfo model.AddMenuAuthorityInfo
|
|
|
_ = c.ShouldBindJSON(&addMenuAuthorityInfo)
|
|
|
|
|
|
err := new(model.SysMenu).AddMenuAuthority(addMenuAuthorityInfo.Menus, addMenuAuthorityInfo.AuthorityId)
|
|
@@ -111,20 +106,16 @@ func AddMenuAuthority(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-type AuthorityIdInfo struct {
|
|
|
- AuthorityId string
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func GetMenuAuthority(c *gin.Context) {
|
|
|
- var authorityIdInfo AuthorityIdInfo
|
|
|
+ var authorityIdInfo model.AuthorityIdInfo
|
|
|
_ = c.ShouldBindJSON(&authorityIdInfo)
|
|
|
err, menus := new(model.SysMenu).GetMenuAuthority(authorityIdInfo.AuthorityId)
|
|
|
if err != nil {
|
|
@@ -134,20 +125,16 @@ func GetMenuAuthority(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-type IdInfo struct {
|
|
|
- Id float64
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func DeleteBaseMenu(c *gin.Context) {
|
|
|
- var idInfo IdInfo
|
|
|
+ var idInfo model.GetById
|
|
|
_ = c.ShouldBindJSON(&idInfo)
|
|
|
err := new(model.SysBaseMenu).DeleteBaseMenu(idInfo.Id)
|
|
|
if err != nil {
|
|
@@ -163,7 +150,7 @@ func DeleteBaseMenu(c *gin.Context) {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func UpdateBaseMenu(c *gin.Context) {
|
|
@@ -177,20 +164,16 @@ func UpdateBaseMenu(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-type GetById struct {
|
|
|
- Id float64 `json:"id"`
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
func GetBaseMenuById(c *gin.Context) {
|
|
|
- var idInfo GetById
|
|
|
+ var idInfo model.GetById
|
|
|
_ = c.ShouldBindJSON(&idInfo)
|
|
|
err, menu := new(model.SysBaseMenu).GetBaseMenuById(idInfo.Id)
|
|
|
if err != nil {
|