李林
2023-12-23 ca4e829a60e74774f6ef87fc62d23094aadb9859
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
package com.yuanchu.mom.service.imp;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanchu.mom.common.PrintChina;
import com.yuanchu.mom.dto.UserPageDto;
import com.yuanchu.mom.mapper.RoleMapper;
import com.yuanchu.mom.mapper.UserMapper;
import com.yuanchu.mom.pojo.Role;
import com.yuanchu.mom.pojo.User;
import com.yuanchu.mom.service.RoleService;
import com.yuanchu.mom.service.UserService;
import com.yuanchu.mom.utils.Jwt;
import com.yuanchu.mom.utils.QueryWrappers;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
@AllArgsConstructor
public class RoleServiceImp implements RoleService {
 
    private RoleMapper roleMapper;
 
    @Override
    public List<Role> selectList() {
        return roleMapper.selectList(null);
    }
 
    @Override
    public Map<String, Object> selectUserList(IPage<Role> page, Role role) {
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(Role.class));
        map.put("body", roleMapper.selectPage(page, QueryWrappers.queryWrappers(role)));
        return map;
    }
 
    @Override
    public int delRole(Integer id) {
        return roleMapper.deleteById(id);
    }
}