feat;增加角色模块
This commit is contained in:
7
pom.xml
7
pom.xml
@@ -28,6 +28,7 @@
|
||||
<module>springboot-message</module>
|
||||
<module>springboot-encrypt</module>
|
||||
<module>springboot-annotation</module>
|
||||
<module>springboot-role</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@@ -96,6 +97,12 @@
|
||||
<version>1.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-role</artifactId>
|
||||
<version>1.1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
<artifactId>springboot-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-role</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.tiesheng.demo;
|
||||
|
||||
import com.tiesheng.core.EnableTieshengWeb;
|
||||
import com.tiesheng.demo.config.DemoWebConfigurer;
|
||||
import com.tiesheng.role.RoleAutoConfigurer;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
@@ -13,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
@EnableTieshengWeb(webConfigurer = DemoWebConfigurer.class)
|
||||
//@EnableEncryptConfig
|
||||
@Import(RoleAutoConfigurer.class)
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -26,4 +26,4 @@ tiesheng:
|
||||
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
|
||||
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
|
||||
encrypt:
|
||||
body: true
|
||||
body: false
|
||||
|
||||
34
springboot-role/pom.xml
Normal file
34
springboot-role/pom.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>1.1.5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-role</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>2.0.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.tiesheng.role;
|
||||
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@ComponentScan({
|
||||
"com.tiesheng.role.**.*",
|
||||
})
|
||||
@MapperScan("com.tiesheng.role.mapper")
|
||||
public class RoleAutoConfigurer {
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package com.tiesheng.role.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleServer;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleUser;
|
||||
import com.tiesheng.role.pojos.dto.ServiceDTO;
|
||||
import com.tiesheng.role.pojos.vo.GroupTypeDTO;
|
||||
import com.tiesheng.role.pojos.vo.RoleUserPageVO;
|
||||
import com.tiesheng.role.pojos.vo.ServiceMenuVO;
|
||||
import com.tiesheng.role.service.CoreRoleService;
|
||||
import com.tiesheng.role.service.CoreServerService;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
|
||||
@Resource
|
||||
CoreServerService coreServerService;
|
||||
@Resource
|
||||
CoreRoleService coreRoleService;
|
||||
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public ApiResp<List<CoreRoleGroup>> groupList(@Valid GroupTypeDTO dto) {
|
||||
return ApiResp.respOK(coreRoleService.list(
|
||||
new QueryWrapper<CoreRoleGroup>()
|
||||
.eq("type", dto.getType())
|
||||
.orderByAsc("sort")
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色编辑
|
||||
*
|
||||
* @param roleGroup
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/group/update")
|
||||
public ApiResp<String> groupUpdate(@RequestBody CoreRoleGroup roleGroup) {
|
||||
|
||||
if (StrUtil.isNotEmpty(roleGroup.getId())) {
|
||||
roleGroup.setType(null);
|
||||
roleGroup.setIsSystem(null);
|
||||
}
|
||||
|
||||
coreRoleService.saveOrUpdate(roleGroup);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色-删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/group/deleted")
|
||||
public ApiResp<String> groupDeleted(@RequestBody @Valid IdDTO dto) {
|
||||
|
||||
CoreRoleGroup byId = coreRoleService.getById(dto.getId());
|
||||
if (byId == null || byId.getIsDeleted() != 0) {
|
||||
throw new ApiException("角色不存在或已删除");
|
||||
}
|
||||
|
||||
if (byId.getIsSystem() == 1) {
|
||||
throw new ApiException(StrUtil.format("该{}无法删除",
|
||||
Objects.equals(byId.getType(), "role") ? "角色" : "职位"));
|
||||
}
|
||||
|
||||
CoreRoleGroup coreServiceMenu = new CoreRoleGroup();
|
||||
coreServiceMenu.setId(dto.getId());
|
||||
coreServiceMenu.setIsDeleted(1);
|
||||
coreRoleService.updateById(coreServiceMenu);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/page")
|
||||
public ApiResp<List<RoleUserPageVO>> userPage(PageDTO dto) {
|
||||
|
||||
QueryWrapper<CoreRoleUser> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("cru.is_deleted", 0);
|
||||
dto.likeColumns(queryWrapper, "cru.ext1", "cru.ext2", "cru.ext3");
|
||||
queryWrapper.orderByAsc("cru.user_id");
|
||||
|
||||
Page<RoleUserPageVO> page = dto.pageObj();
|
||||
coreRoleService.getUserMapper().page(page, queryWrapper);
|
||||
|
||||
return ApiResp.respOK(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权调整
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/update")
|
||||
public ApiResp<String> userUpdate(@RequestBody CoreRoleUser roleUser) {
|
||||
if (StrUtil.isNotEmpty(roleUser.getId())) {
|
||||
coreRoleService.getUserMapper().updateById(roleUser);
|
||||
} else {
|
||||
coreRoleService.getUserMapper().insert(roleUser);
|
||||
}
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权-删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/user/deleted")
|
||||
public ApiResp<String> userDeleted(@RequestBody @Valid IdDTO dto) {
|
||||
CoreRoleUser coreRoleUser = new CoreRoleUser();
|
||||
coreRoleUser.setId(dto.getId());
|
||||
coreRoleUser.setIsDeleted(1);
|
||||
coreRoleService.getUserMapper().updateById(coreRoleUser);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取服务列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/server/list")
|
||||
public ApiResp<List<CoreRoleServer>> list() {
|
||||
return ApiResp.respOK(coreServerService.list());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改服务
|
||||
*
|
||||
* @param coreService
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/server/update")
|
||||
public ApiResp<String> update(@RequestBody CoreRoleServer coreService) {
|
||||
coreServerService.saveOrUpdate(coreService);
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限-列出
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/authority/list")
|
||||
public ApiResp<List<ServiceMenuVO>> menuList(@Valid ServiceDTO dto) {
|
||||
|
||||
List<CoreRoleAuthority> list = coreServerService.getAuthorityMapper().selectList(new QueryWrapper<CoreRoleAuthority>()
|
||||
.eq(CoreRoleAuthority.IS_DELETED, 0)
|
||||
.eq("service", dto.getService())
|
||||
.orderByAsc("sort")
|
||||
);
|
||||
|
||||
List<ServiceMenuVO> collect = coreServerService.menuWrap(list, null);
|
||||
|
||||
return ApiResp.respOK(collect);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限-编辑
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/authority/update")
|
||||
public ApiResp<String> menuUpdate(@RequestBody CoreRoleAuthority serviceMenu) {
|
||||
if (StrUtil.isEmpty(serviceMenu.getId())) {
|
||||
coreServerService.getAuthorityMapper().insert(serviceMenu);
|
||||
} else {
|
||||
serviceMenu.setNo(null);
|
||||
coreServerService.getAuthorityMapper().updateById(serviceMenu);
|
||||
}
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
|
||||
public interface CoreRoleAuthorityMapper extends BaseMapper<CoreRoleAuthority> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||
|
||||
public interface CoreRoleGroupMapper extends BaseMapper<CoreRoleGroup> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleServer;
|
||||
|
||||
public interface CoreRoleServerMapper extends BaseMapper<CoreRoleServer> {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleUser;
|
||||
import com.tiesheng.role.pojos.vo.RoleUserPageVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface CoreRoleUserMapper extends BaseMapper<CoreRoleUser> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param wrapper
|
||||
* @return
|
||||
*/
|
||||
Page<RoleUserPageVO> page(Page<RoleUserPageVO> page, @Param("ew") QueryWrapper<CoreRoleUser> wrapper);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-权限
|
||||
*/
|
||||
@TableName(value = "core_role_authority")
|
||||
public class CoreRoleAuthority extends DaoBase {
|
||||
/**
|
||||
* 服务
|
||||
*/
|
||||
@TableField(value = "service")
|
||||
private String service;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableField(value = "`no`")
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 层级
|
||||
*/
|
||||
@TableField(value = "`level`")
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 父类ID
|
||||
*/
|
||||
@TableField(value = "parent")
|
||||
private String parent;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_open")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 跳转地址
|
||||
*/
|
||||
@TableField(value = "link")
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 平台:ding、web、mobile等
|
||||
*/
|
||||
@TableField(value = "platform")
|
||||
private String platform;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取服务
|
||||
*
|
||||
* @return service - 服务
|
||||
*/
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置服务
|
||||
*
|
||||
* @param service 服务
|
||||
*/
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取编号
|
||||
*
|
||||
* @return no - 编号
|
||||
*/
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置编号
|
||||
*
|
||||
* @param no 编号
|
||||
*/
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取层级
|
||||
*
|
||||
* @return level - 层级
|
||||
*/
|
||||
public Integer getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置层级
|
||||
*
|
||||
* @param level 层级
|
||||
*/
|
||||
public void setLevel(Integer level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取父类ID
|
||||
*
|
||||
* @return parent - 父类ID
|
||||
*/
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置父类ID
|
||||
*
|
||||
* @param parent 父类ID
|
||||
*/
|
||||
public void setParent(String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_open - 是否启用
|
||||
*/
|
||||
public Integer getIsOpen() {
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isOpen 是否启用
|
||||
*/
|
||||
public void setIsOpen(Integer isOpen) {
|
||||
this.isOpen = isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型:group-分组,menu-菜单项,point-点
|
||||
*
|
||||
* @return type - 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型:group-分组,menu-菜单项,point-点
|
||||
*
|
||||
* @param type 类型:group-分组,menu-菜单项,point-点
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跳转地址
|
||||
*
|
||||
* @return link - 跳转地址
|
||||
*/
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置跳转地址
|
||||
*
|
||||
* @param link 跳转地址
|
||||
*/
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台:ding、web、mobile等
|
||||
*
|
||||
* @return platform - 平台:ding、web、mobile等
|
||||
*/
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置平台:ding、web、mobile等
|
||||
*
|
||||
* @param platform 平台:ding、web、mobile等
|
||||
*/
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-分组
|
||||
*/
|
||||
@TableName(value = "core_role_group")
|
||||
public class CoreRoleGroup extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 类型:role-角色,job-职位
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 是否系统
|
||||
*/
|
||||
@TableField(value = "is_system")
|
||||
private Integer isSystem;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型:role-角色,job-职位
|
||||
*
|
||||
* @return type - 类型:role-角色,job-职位
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型:role-角色,job-职位
|
||||
*
|
||||
* @param type 类型:role-角色,job-职位
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 是否系统
|
||||
*
|
||||
* @return is_system - 是否系统
|
||||
*/
|
||||
public Integer getIsSystem() {
|
||||
return isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 是否系统
|
||||
*
|
||||
* @param isSystem 是否系统
|
||||
*/
|
||||
public void setIsSystem(Integer isSystem) {
|
||||
this.isSystem = isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-服务
|
||||
*/
|
||||
@TableName(value = "core_role_server")
|
||||
public class CoreRoleServer extends DaoBase {
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "`name`")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
@TableField(value = "logo")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@TableField(value = "is_open")
|
||||
private Integer isOpen;
|
||||
|
||||
/**
|
||||
* 跳转地址
|
||||
*/
|
||||
@TableField(value = "link")
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取名称
|
||||
*
|
||||
* @return name - 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取说明
|
||||
*
|
||||
* @return remark - 说明
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置说明
|
||||
*
|
||||
* @param remark 说明
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取logo
|
||||
*
|
||||
* @return logo - logo
|
||||
*/
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置logo
|
||||
*
|
||||
* @param logo logo
|
||||
*/
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取排序
|
||||
*
|
||||
* @return sort - 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置排序
|
||||
*
|
||||
* @param sort 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否启用
|
||||
*
|
||||
* @return is_open - 是否启用
|
||||
*/
|
||||
public Integer getIsOpen() {
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否启用
|
||||
*
|
||||
* @param isOpen 是否启用
|
||||
*/
|
||||
public void setIsOpen(Integer isOpen) {
|
||||
this.isOpen = isOpen;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取跳转地址
|
||||
*
|
||||
* @return link - 跳转地址
|
||||
*/
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置跳转地址
|
||||
*
|
||||
* @param link 跳转地址
|
||||
*/
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-用户
|
||||
*/
|
||||
@TableName(value = "core_role_user")
|
||||
public class CoreRoleUser extends DaoBase {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 类型:menu-菜单,group-分组
|
||||
*/
|
||||
@TableField(value = "`type`")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 类型关联的记录ID
|
||||
*/
|
||||
@TableField(value = "type_id")
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 过期时间,无则不过期
|
||||
*/
|
||||
@TableField(value = "expire_time")
|
||||
private Date expireTime;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@TableField(value = "ext1")
|
||||
private String ext1;
|
||||
|
||||
/**
|
||||
* 扩展2
|
||||
*/
|
||||
@TableField(value = "ext2")
|
||||
private String ext2;
|
||||
|
||||
/**
|
||||
* 扩展3
|
||||
*/
|
||||
@TableField(value = "ext3")
|
||||
private String ext3;
|
||||
|
||||
/**
|
||||
* 获取用户ID
|
||||
*
|
||||
* @return user_id - 用户ID
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户ID
|
||||
*
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型:menu-菜单,group-分组
|
||||
*
|
||||
* @return type - 类型:menu-菜单,group-分组
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型:menu-菜单,group-分组
|
||||
*
|
||||
* @param type 类型:menu-菜单,group-分组
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型关联的记录ID
|
||||
*
|
||||
* @return type_id - 类型关联的记录ID
|
||||
*/
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置类型关联的记录ID
|
||||
*
|
||||
* @param typeId 类型关联的记录ID
|
||||
*/
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取过期时间,无则不过期
|
||||
*
|
||||
* @return expire_time - 过期时间,无则不过期
|
||||
*/
|
||||
public Date getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置过期时间,无则不过期
|
||||
*
|
||||
* @param expireTime 过期时间,无则不过期
|
||||
*/
|
||||
public void setExpireTime(Date expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
* @return ext1 - 扩展1
|
||||
*/
|
||||
public String getExt1() {
|
||||
return ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展1
|
||||
*
|
||||
* @param ext1 扩展1
|
||||
*/
|
||||
public void setExt1(String ext1) {
|
||||
this.ext1 = ext1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展2
|
||||
*
|
||||
* @return ext2 - 扩展2
|
||||
*/
|
||||
public String getExt2() {
|
||||
return ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展2
|
||||
*
|
||||
* @param ext2 扩展2
|
||||
*/
|
||||
public void setExt2(String ext2) {
|
||||
this.ext2 = ext2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展3
|
||||
*
|
||||
* @return ext3 - 扩展3
|
||||
*/
|
||||
public String getExt3() {
|
||||
return ext3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扩展3
|
||||
*
|
||||
* @param ext3 扩展3
|
||||
*/
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
public class MenuListDTO extends ServiceDTO {
|
||||
|
||||
private String parent;
|
||||
private Integer childSize = 0;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(String parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public Integer getChildSize() {
|
||||
return childSize;
|
||||
}
|
||||
|
||||
public void setChildSize(Integer childSize) {
|
||||
this.childSize = childSize;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.dto;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class ServiceDTO {
|
||||
|
||||
@NotEmpty(message = "请选择一个服务")
|
||||
private String service;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
public void setService(String service) {
|
||||
this.service = service;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public class GroupTypeDTO {
|
||||
|
||||
@NotEmpty(message = "请选择一个类型")
|
||||
private String type;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleUser;
|
||||
|
||||
public class RoleUserPageVO extends CoreRoleUser {
|
||||
|
||||
private String typeName;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getTypeName() {
|
||||
return typeName;
|
||||
}
|
||||
|
||||
public void setTypeName(String typeName) {
|
||||
this.typeName = typeName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tiesheng.role.pojos.vo;
|
||||
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ServiceMenuVO extends CoreRoleAuthority {
|
||||
|
||||
private List<ServiceMenuVO> children;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public List<ServiceMenuVO> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ServiceMenuVO> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.tiesheng.role.service;
|
||||
|
||||
import com.tiesheng.role.mapper.CoreRoleGroupMapper;
|
||||
import com.tiesheng.role.mapper.CoreRoleUserMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleGroup;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRoleGroup> {
|
||||
|
||||
|
||||
@Resource
|
||||
CoreRoleUserMapper coreRoleUserMapper;
|
||||
|
||||
public CoreRoleUserMapper getUserMapper() {
|
||||
return coreRoleUserMapper;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tiesheng.role.service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tiesheng.role.mapper.CoreRoleAuthorityMapper;
|
||||
import com.tiesheng.role.mapper.CoreRoleServerMapper;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleAuthority;
|
||||
import com.tiesheng.role.pojos.dao.CoreRoleServer;
|
||||
import com.tiesheng.role.pojos.vo.ServiceMenuVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CoreServerService extends ServiceImpl<CoreRoleServerMapper, CoreRoleServer> {
|
||||
|
||||
@Resource
|
||||
CoreRoleAuthorityMapper coreRoleAuthorityMapper;
|
||||
|
||||
public CoreRoleAuthorityMapper getAuthorityMapper() {
|
||||
return coreRoleAuthorityMapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 菜单封装
|
||||
*
|
||||
* @param coreServiceMenuList
|
||||
* @param level
|
||||
* @return
|
||||
*/
|
||||
public List<ServiceMenuVO> menuWrap(List<CoreRoleAuthority> coreServiceMenuList, String parent) {
|
||||
List<ServiceMenuVO> list = new ArrayList<>();
|
||||
|
||||
for (CoreRoleAuthority coreServiceMenu : coreServiceMenuList) {
|
||||
if (!StrUtil.equals(parent, coreServiceMenu.getParent())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ServiceMenuVO menuVO = BeanUtil.copyProperties(coreServiceMenu, ServiceMenuVO.class);
|
||||
menuVO.setChildren(menuWrap(coreServiceMenuList, coreServiceMenu.getId()));
|
||||
list.add(menuVO);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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.tiesheng.role.mapper.CoreRoleAuthorityMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleAuthority">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_authority-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="service" jdbcType="VARCHAR" property="service" />
|
||||
<result column="no" jdbcType="VARCHAR" property="no" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="parent" jdbcType="VARCHAR" property="parent" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="link" jdbcType="LONGVARCHAR" property="link" />
|
||||
<result column="platform" jdbcType="VARCHAR" property="platform" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, service, `no`, `name`, sort, `level`, parent,
|
||||
remark, is_open, `type`, link, platform, ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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.tiesheng.role.mapper.CoreRoleGroupMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleGroup">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_group-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="is_system" jdbcType="INTEGER" property="isSystem" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `name`, remark, `type`, is_system, sort,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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.tiesheng.role.mapper.CoreRoleServerMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleServer">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_server-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="logo" jdbcType="VARCHAR" property="logo" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="link" jdbcType="VARCHAR" property="link" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, `name`, remark, logo, sort, is_open, link,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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.tiesheng.role.mapper.CoreRoleUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.role.pojos.dao.CoreRoleUser">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_role_user-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted" />
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="type_id" jdbcType="VARCHAR" property="typeId" />
|
||||
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
|
||||
<result column="ext1" jdbcType="VARCHAR" property="ext1" />
|
||||
<result column="ext2" jdbcType="VARCHAR" property="ext2" />
|
||||
<result column="ext3" jdbcType="VARCHAR" property="ext3" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, create_time, update_time, is_deleted, user_id, `type`, type_id, expire_time,
|
||||
ext1, ext2, ext3
|
||||
</sql>
|
||||
|
||||
<select id="page" resultType="com.tiesheng.role.pojos.vo.RoleUserPageVO">
|
||||
select *,
|
||||
(case cru.type
|
||||
when 'menu' then (select name from core_role_authority where id = cru.type_id and is_deleted = 0)
|
||||
when 'job' then (select name from core_role_group where id = cru.type_id and is_deleted = 0)
|
||||
else '' end) type_name
|
||||
from core_role_user cru
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -36,6 +36,24 @@
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MySql驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.30</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- fastJson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.pojos.dto;
|
||||
package com.tiesheng.util.pojos;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.core.service;
|
||||
package com.tiesheng.util.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -39,24 +39,6 @@
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MySql驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.30</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
@@ -85,7 +67,7 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
</dependency><dependency><groupId>org.apache.xmlbeans</groupId><artifactId>xmlbeans</artifactId><version>3.1.0</version><scope>compile</scope></dependency>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.lang.annotation.*;
|
||||
CoreAutoConfigurer.class,
|
||||
LoginAutoConfigurer.class,
|
||||
DatabaseAutoConfigurer.class,
|
||||
EncryptAutoConfigurer.class
|
||||
EncryptAutoConfigurer.class,
|
||||
})
|
||||
public @interface EnableTieshengWeb {
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigEnum;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigFuncDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.ConfigSystemDTO;
|
||||
import com.tiesheng.core.pojos.dto.config.EnumTypeDTO;
|
||||
|
||||
@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dto.IdDTO;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.IdDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUpdateRxDTO;
|
||||
import com.tiesheng.core.pojos.dto.job.JobUserAssignDTO;
|
||||
|
||||
@@ -3,12 +3,11 @@ package com.tiesheng.core.controller;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogMessage;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogOperation;
|
||||
import com.tiesheng.core.pojos.dao.CoreLogProcess;
|
||||
import com.tiesheng.core.pojos.dto.PageDTO;
|
||||
import com.tiesheng.util.pojos.PageDTO;
|
||||
import com.tiesheng.core.pojos.vo.ProcessDetailVo;
|
||||
import com.tiesheng.core.service.CoreLogService;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-枚举
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位-功能点
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 配置-系统
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 职位-用户
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-登录
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-消息
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-操作
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 日志-过程
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.tiesheng.core.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.core.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
|
||||
/**
|
||||
* 平台-唯一值
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.tiesheng.core.mapper.CoreConfigFuncMapper;
|
||||
import com.tiesheng.core.mapper.CoreConfigSystemMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigFunc;
|
||||
import com.tiesheng.core.pojos.dao.CoreConfigSystem;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.tiesheng.core.mapper.CoreJobUserMapper;
|
||||
import com.tiesheng.core.pojos.dao.CoreJob;
|
||||
import com.tiesheng.core.pojos.dao.CoreJobUser;
|
||||
import com.tiesheng.util.pojos.IdName;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.tiesheng.core.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.config.token.bean.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
Reference in New Issue
Block a user