Commit 17e75b03 authored by Fred's avatar Fred

重大

parent ab02fb41
......@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
......@@ -61,7 +62,7 @@ public class DepartController extends AbstractController{
* 删除或批量删除角色
*/
@DeleteMapping("/delete")
public R deleteDepart(@RequestParam Set<Long> ids) {
public R deleteDepart(@RequestBody Set<Long> ids) {
departService.deleteBatchIds(ids);
return R.ok();
......
package com.govmade.modules.system.controller;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.govmade.common.utils.R;
import com.govmade.modules.basic.controller.AbstractController;
import com.govmade.modules.system.entity.MenuEntity;
import com.govmade.modules.system.service.MenuService;
/**
* 系统管理 - 菜单设置
......@@ -16,5 +24,41 @@ import com.govmade.modules.basic.controller.AbstractController;
@RequestMapping("/system/menu")
public class MenuController extends AbstractController {
@Autowired
private MenuService menuService;
/**
* 菜单列表
*/
@GetMapping("/list")
public R list(Map<String, Object> params) {
menuService.queryPage(params);
return null;
}
/**
* 保存或更新用户
*/
@PostMapping("/save")
public R save(MenuEntity menu) {
if (null == menu.getId()) {
if (this.menuService.checkMenu(menu.getName()) > 0) {
return R.error(menu.getName() + " 已存在!");
}
}
return R.ok();
}
/**
* 根据ID查询菜单
*
* @param id
* @return
*/
@GetMapping("info/{id}")
public R info(@PathVariable("id") Long id) {
return R.ok().put("menu", menuService.queryById(id));
}
}
package com.govmade.modules.system.dao;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.govmade.modules.system.entity.MenuEntity;
/**
* 系统管理 - 菜单设置
*
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月9日
*/
@Mapper
public interface MenuDao extends BaseMapper<MenuEntity> {
}
......@@ -8,10 +8,10 @@ import com.govmade.modules.basic.entity.BaseEntity;
*
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月7
* @date 2018年8月9
*/
@TableName("system_menus")
public class MenuEntiity extends BaseEntity<Long> {
public class MenuEntity extends BaseEntity<Long> {
private static final long serialVersionUID = 1L;
......
package com.govmade.modules.system.service;
import java.util.Map;
import com.baomidou.mybatisplus.service.IService;
import com.govmade.common.utils.PageUtils;
import com.govmade.modules.system.entity.MenuEntity;
/**
* 系统管理 - 菜单设置
*
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月3日
*/
public interface MenuService extends IService<MenuEntity> {
PageUtils queryPage(Map<String, Object> params);
/**
* 保存或修改菜单
*/
void save(MenuEntity menu);
/**
* 检测是否重名
*/
Integer checkMenu(String name);
MenuEntity queryById(Long id);
}
package com.govmade.modules.system.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.govmade.common.utils.PageUtils;
import com.govmade.modules.system.dao.MenuDao;
import com.govmade.modules.system.entity.MenuEntity;
import com.govmade.modules.system.service.MenuService;
/**
* 系统管理 - 菜单设置
*
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月7日
*/
@Service("MenuService")
public class MenuServiceImpl extends ServiceImpl<MenuDao, MenuEntity> implements MenuService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
// TODO Auto-generated method stub
//this.baseMapper.selectPage();
return null;
}
/**
* 获取所有菜单列表
*/
private List<MenuEntity> queryAll(List<Long> menuIdList){
//查询根菜单列表
//List<MenuEntity> menuList = queryListParentId(0L, menuIdList);
//递归获取子菜单
// getMenuTreeList(menuList, menuIdList);
return null;
}
@Override
public void save(MenuEntity menu) {
super.insertOrUpdate(menu);
}
@Override
public Integer checkMenu(String name) {
return super.selectCount(new EntityWrapper<MenuEntity>().eq("name", name));
}
@Override
public MenuEntity queryById(Long id) {
return super.selectById(id);
}
}
......@@ -13,7 +13,6 @@ import com.govmade.modules.system.dao.UserDao;
import com.govmade.modules.system.entity.UserEntity;
import com.govmade.modules.system.service.UserService;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment