查询所有部门

This commit is contained in:
wangliwen 2022-07-07 18:57:09 +08:00
parent 4cc31af90e
commit 213f25085e
1 changed files with 80 additions and 74 deletions

View File

@ -7,26 +7,22 @@ import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.service.SysDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* 部门管理
*
*/
@RestController
@RequestMapping("/sys/dept")
@ -47,6 +43,16 @@ public class SysDeptController {
return new Result<List<SysDeptDTO>>().ok(list);
}
@GetMapping("all")
@ApiOperation("查询所有部门列表")
@LogOperation("查询所有部门列表")
// @RequiresPermissions("sys:dept:list")
public Result<List<Map<String, Object>>> all() {
List<Map<String, Object>> list = jdbcTemplate.queryForList("SELECT id,`name` FROM sys_dept;");
return new Result<List<Map<String, Object>>>().ok(list);
}
@GetMapping("{id}")
@ApiOperation("查询部门详细信息")
@LogOperation("查询部门详细信息")