Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
pan.wl.2
2024-11-06 22:47:45 +08:00
8 changed files with 144 additions and 7 deletions

View File

@@ -45,6 +45,16 @@ public class SystemAuthMenuController {
return AjaxResult.success(result);
}
@NotPower
@GetMapping("/systemMenuLists")
@ApiOperation(value="获取菜单列表")
public AjaxResult<Object> systemMenuLists() {
JSONArray result = iSystemAuthMenuService.systemMenuLists();
return AjaxResult.success(result);
}
@GetMapping("/all")
@ApiOperation(value="获取菜单列表")
public AjaxResult<JSONArray> all() {

View File

@@ -10,6 +10,7 @@ import com.mdd.admin.service.system.ISystemRoleMenuService;
import com.mdd.admin.validate.system.SystemMenuCreateValidate;
import com.mdd.admin.validate.system.SystemMenuUpdateValidate;
import com.mdd.admin.vo.system.SystemAuthMenuVo;
import com.mdd.admin.vo.system.SystemMenuListedVo;
import com.mdd.common.entity.system.SystemMenu;
import com.mdd.common.mapper.system.SystemMenuMapper;
import com.mdd.common.util.ListUtils;
@@ -86,6 +87,28 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
}};
}
@Override
public JSONArray systemMenuLists() {
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();
queryWrapper.orderByDesc("sort");
queryWrapper.orderByAsc("id");
List<SystemMenu> systemAuthMenus = systemAuthMenuMapper.selectList(queryWrapper);
List<SystemMenuListedVo> lists = new ArrayList<>();
for (SystemMenu systemAuthMenu : systemAuthMenus) {
SystemMenuListedVo vo = new SystemMenuListedVo();
BeanUtils.copyProperties(systemAuthMenu, vo);
vo.setCreateTime(TimeUtils.timestampToDate(systemAuthMenu.getCreateTime()));
vo.setUpdateTime(TimeUtils.timestampToDate(systemAuthMenu.getUpdateTime()));
lists.add(vo);
}
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(lists));
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
}
@Override
public JSONArray all() {
QueryWrapper<SystemMenu> queryWrapper = new QueryWrapper<>();

View File

@@ -29,6 +29,14 @@ public interface ISystemMenuService {
*/
JSONObject list();
/**
* 菜单列表
*
* @author fzr
* @return JSONArray
*/
JSONArray systemMenuLists();
/**
* 菜单列表
*

View File

@@ -0,0 +1,68 @@
package com.mdd.admin.vo.system;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("系统菜单Vo")
public class SystemMenuListedVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Integer id;
@ApiModelProperty(value = "上级菜单")
private Integer pid;
@ApiModelProperty(value = "权限类型: [M=目录, C=菜单, A=按钮]")
@JsonProperty("menuType")
private String type;
@ApiModelProperty(value = "菜单名称")
@JsonProperty("menuName")
private String name;
@ApiModelProperty(value = "菜单图标")
@JsonProperty("menuIcon")
private String icon;
@ApiModelProperty(value = "菜单排序")
@JsonProperty("menuSort")
private Integer sort;
@ApiModelProperty(value = "权限标识")
private String perms;
@ApiModelProperty(value = "路由地址")
private String paths;
@ApiModelProperty(value = "前端组件")
private String component;
@ApiModelProperty(value = "选中路径")
private String selected;
@ApiModelProperty(value = "路由参数")
private String params;
@ApiModelProperty(value = "是否缓存: [0=否, 1=是]")
private Integer isCache;
@ApiModelProperty(value = "是否显示: [0=否, 1=是]")
private Integer isShow;
@ApiModelProperty(value = "是否禁用: [0=否, 1=是]")
private Integer isDisable;
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "更新时间")
private String updateTime;
}