fangyuan
2022-11-17 059eebfe1c54750e74e290ed7503e2cbf3f2f740
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.ycl.service.user;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.dto.UmsMenuNode;
import com.ycl.entity.user.UmsMenu;
import com.ycl.entity.user.UmsResource;
import com.ycl.entity.user.UmsRole;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.List;
 
/**
 * 后台角色管理Service
 * Created by macro on 2018/9/30.
 */
public interface UmsRoleService extends IService<UmsRole> {
    /**
     * 添加角色
     */
    boolean create(UmsRole role);
 
    /**
     * 批量删除角色
     */
    boolean delete(List<Long> ids);
 
    /**
     * 分页获取角色列表
     */
    Page<UmsRole> list(String keyword, Integer pageSize, Integer pageNum);
 
    /**
     * 根据管理员ID获取对应菜单
     */
    List<UmsMenuNode> getMenuList(Long adminId);
 
    /**
     * 获取角色相关菜单
     */
    List<UmsMenu> listMenu(Long roleId);
 
    /**
     * 获取角色相关资源
     */
    List<UmsResource> listResource(Long roleId);
 
    /**
     * 给角色分配菜单
     */
    @Transactional
    int allocMenu(Long roleId, List<Long> menuIds);
 
    /**
     * 给角色分配资源
     */
    @Transactional
    int allocResource(Long roleId, List<Long> resourceIds);
 
    Boolean updateStatusBatch(List<Long> ids, Integer status);
}