|
|
|
@ -16,6 +16,7 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.POST("/AddMenuInfo", AddMenuInfo)
|
|
|
|
|
rr.POST("/DeleteMenuInfo", DeleteMenuInfo)
|
|
|
|
|
rr.POST("/UpdateMenuInfo", UpdateMenuInfo)
|
|
|
|
|
rr.POST("/SetMenuSortInfo", SetMenuSortInfo)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -26,7 +27,7 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Param appId query string true "系统ID"
|
|
|
|
|
// @Param identityId query string true "身份ID"
|
|
|
|
|
// @Param identityId query int true "身份ID"
|
|
|
|
|
// @Success 200 {object} Model.Res
|
|
|
|
|
// @Router /base/menu/PageMenuInfo [get]
|
|
|
|
|
// @X-EmptyLimit ["appId","identityId"]
|
|
|
|
@ -51,8 +52,7 @@ func PageMenuInfo(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: r.Success,
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
List: CommonUtil.ConvertStringArrayToArray(r.List),
|
|
|
|
|
Count: r.Count,
|
|
|
|
|
List: CommonUtil.ConvertJsonStringToMapArray("[" + r.List + "]"),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -83,7 +83,7 @@ func GetMenuInfo(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: r.Success,
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
List: CommonUtil.ConvertStringArrayToArray(r.List),
|
|
|
|
|
List: CommonUtil.ConvertJsonStringToMapArray(r.List),
|
|
|
|
|
Count: r.Count,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -95,6 +95,7 @@ func GetMenuInfo(c *gin.Context) {
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Param appId formData string true "系统ID"
|
|
|
|
|
// @Param parentId formData string true "父节点ID"
|
|
|
|
|
// @Param identityId formData int true "身份ID"
|
|
|
|
|
// @Param menuName formData string true "菜单名称"
|
|
|
|
|
// @Param menuCode formData string true "菜单编码"
|
|
|
|
|
// @Param menuUrl formData string true "菜单的URL"
|
|
|
|
@ -102,7 +103,8 @@ func GetMenuInfo(c *gin.Context) {
|
|
|
|
|
// @Success 200 {object} Model.Res
|
|
|
|
|
// @Router /base/menu/AddMenuInfo [post]
|
|
|
|
|
// @X-EmptyLimit ["appId","parentId","menuName","menuCode","menuUrl","menuIcon"]
|
|
|
|
|
// @X-LengthLimit [{"appId":"36,36"},{"parentId":"36,36"},{"menuName":"2,50"},{"menuCode":"2,20"},{"menuUrl":"1,500"}]
|
|
|
|
|
// @X-IntRangeLimit [{"identityId":"1,4"}]
|
|
|
|
|
// @X-LengthLimit [{"appId":"36,36"},{"parentId":"36,36"},{"menuName":"2,50"},{"menuCode":"1,6"},{"menuUrl":"1,500"}]
|
|
|
|
|
// @X-RoleLimit ["1"]
|
|
|
|
|
// @X-Sort [3]
|
|
|
|
|
func AddMenuInfo(c *gin.Context) {
|
|
|
|
@ -110,6 +112,8 @@ func AddMenuInfo(c *gin.Context) {
|
|
|
|
|
appId := c.PostForm("appId")
|
|
|
|
|
//父节点ID
|
|
|
|
|
parentId := c.PostForm("parentId")
|
|
|
|
|
//身份ID
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identityId"))
|
|
|
|
|
//菜单名称
|
|
|
|
|
menuName := c.PostForm("menuName")
|
|
|
|
|
//菜单编码
|
|
|
|
@ -119,7 +123,7 @@ func AddMenuInfo(c *gin.Context) {
|
|
|
|
|
//菜单图标
|
|
|
|
|
menuIcon := c.PostForm("menuIcon")
|
|
|
|
|
|
|
|
|
|
r, err := BaseMenuService.AddBaseMenuInfo(appId,parentId,menuName, menuCode, menuUrl, menuIcon)
|
|
|
|
|
r, err := BaseMenuService.AddBaseMenuInfo(appId, parentId, identityId, menuName, menuCode, menuUrl, menuIcon)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
@ -180,7 +184,7 @@ func DeleteMenuInfo(c *gin.Context) {
|
|
|
|
|
// @X-Sort [5]
|
|
|
|
|
func UpdateMenuInfo(c *gin.Context) {
|
|
|
|
|
//菜单ID
|
|
|
|
|
menuId := c.PostForm("menuName")
|
|
|
|
|
menuId := c.PostForm("menuId")
|
|
|
|
|
//菜单名称
|
|
|
|
|
menuName := c.PostForm("menuName")
|
|
|
|
|
//菜单编码
|
|
|
|
|