This commit is contained in:
cwchen 2024-02-26 18:14:11 +08:00
parent 2bafddcaa2
commit f255a0144c
8 changed files with 103 additions and 3 deletions

View File

@ -1,8 +1,18 @@
package com.securitycontrol.entity.system.dto; package com.securitycontrol.entity.system.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/** /**
* 菜单查询 * 菜单查询
* @author HeiZi * @author HeiZi
*/ */
@Data
public class MenuDto { public class MenuDto {
@ApiModelProperty(value = "菜单ID")
private Integer menuId;
@ApiModelProperty(value = "菜单名称")
private String menuName;
} }

View File

@ -0,0 +1,46 @@
package com.securitycontrol.entity.system.vo;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @authorcwchen
* @date2024-02-26-17:58
* @version1.0
* @description菜单-vo
*/
@Data
public class MenuVo {
@ApiModelProperty(value = "菜单ID")
private Integer menuId;
@ApiModelProperty(value = "菜单名称")
private String menuName;
@ApiModelProperty(value = "菜单路径")
private String menuUrl;
@ApiModelProperty(value = "菜单类型")
private Integer menuType;
@ApiModelProperty(value = "权限")
private Integer menuAuth;
@ApiModelProperty(value = "父ID")
private Integer parentId;
@ApiModelProperty(value = "菜单排序")
private Integer menuSort;
@ApiModelProperty(value = "图标")
private Integer menuLogo;
@ApiModelProperty(value = "子节点")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<MenuVo> children;
}

View File

@ -1,13 +1,21 @@
package com.securitycontrol.system.controller; package com.securitycontrol.system.controller;
import com.securitycontrol.common.core.web.controller.BaseController;
import com.securitycontrol.system.service.MenuService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/** /**
* 菜单管理层 * 菜单管理层
* @author HeiZi * @author HeiZi
*/ */
@RestController @RestController
@RequestMapping("/sys/menu/") @RequestMapping("/sys/menu/")
public class MenuController { public class MenuController extends BaseController {
@Resource(name = "MenuService")
private MenuService service;
} }

View File

@ -0,0 +1,13 @@
package com.securitycontrol.system.mapper;
import org.springframework.stereotype.Repository;
/**
* @authorcwchen
* @date2024-02-26-18:07
* @version1.0
* @description菜单管理-数据库访问层
*/
@Repository(value = "IMenuMapper")
public interface IMenuMapper {
}

View File

@ -1,4 +1,7 @@
package com.securitycontrol.system.service; package com.securitycontrol.system.service;
/**
* @author 10488
*/
public interface MenuService { public interface MenuService {
} }

View File

@ -1,4 +1,18 @@
package com.securitycontrol.system.service; package com.securitycontrol.system.service;
public class MenuServiceImpl { import com.securitycontrol.system.mapper.IMenuMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author 10488
*/
@Service(value = "MenuService")
@Slf4j
public class MenuServiceImpl implements MenuService{
@Resource(name = "IMenuMapper")
private IMenuMapper mapper;
} }

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.securitycontrol.system.mapper.IMenuMapper">
</mapper>

View File

@ -23,7 +23,7 @@
SELECT menu_id AS id, SELECT menu_id AS id,
p_id AS parentId, p_id AS parentId,
menu_name AS label, menu_name AS label,
menu_url AS level menu_type AS level
FROM sys_menu FROM sys_menu
WHERE del_flag = 0 WHERE del_flag = 0
</select> </select>