package cn.superdesk.uniorder.service.sys.role.impl;

import cn.superdesk.uniorder.dao.entity.sys.role.SysMenu;
import cn.superdesk.uniorder.dao.mapper.sys.role.SysMenuMapper;
import cn.superdesk.uniorder.dao.mapper.sys.role.SysMenuMapperEx;
import cn.superdesk.uniorder.dao.mapper.sys.role.SysRoleMenuMapperEx;
import cn.superdesk.uniorder.dto.vo.sys.role.ViewMenuTree;
import cn.superdesk.uniorder.dto.vo.sys.role.ViewRoleMenu;
import cn.superdesk.uniorder.service.sys.role.SysMenuService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * @Description: 整理
 * @Author: linjinyu
 * @CreateDate: 2021/5/20 上午10:21
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/5/20 上午10:21
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service
public class SysMenuServiceImpl implements SysMenuService {


    @Autowired
    private SysMenuMapper   sysMenuMapper;
    @Autowired
    private SysMenuMapperEx sysMenuMapperEx;

    @Autowired
    private SysRoleMenuMapperEx sysRoleMenuMapper;


    @Deprecated
    @Override
    public PageInfo<SysMenu> findByPaging(Map<String, Object> params, Integer pageNo, Integer pageSize) {

        return null;
    }

    @Deprecated
    @Override
    public void deleteObj(Long id) {


    }

    @Deprecated
    @Override
    public int updateByPrimaryKeySelective(SysMenu t) {
        return 0;

    }

    @Deprecated
    @Override
    public SysMenu findById(Long id) {

        return null;
    }

    @Deprecated
    @Override
    public int insertSelective(SysMenu t) {

        return 0;
    }

    @Override
    public List<SysMenu> findAll(Map<String, Object> queryMap) {

        return null;
    }

    /****************************************** 菜单 start ******************************************/

    @Override
    public List<ViewMenuTree> getTreeById(Long id) {

        return sysMenuMapperEx.getTreeById(id);
    }

    @Override
    public List<ViewMenuTree> getTreeByIdNew(Long id) {
        return sysMenuMapperEx.getTreeByIdNew(id);
    }

    /****************************************** 菜单   end ******************************************/

    /****************************************** 角色 X 菜单 start ******************************************/

    @Override
    public List<ViewMenuTree> getTreeByRoleId(Long roleId) {

        return sysRoleMenuMapper.getTreeByRoleIdNew(roleId);
    }

    @Override
    public List<ViewRoleMenu> getDataByRoleId(Long roleId) {

        return sysRoleMenuMapper.getDataByRoleId(roleId);
    }

    /****************************************** 角色 X 菜单   end ******************************************/


}
