package com.lz.modules.flow.model;

import com.alibaba.fastjson.JSON;

import java.util.*;

public class StaffRoles {

    private Long staffId;
    private List<Long> roleIds;

    public StaffRoles(Long staffId, List<Long> roleIds) {
        this.staffId = staffId;
        this.roleIds = roleIds;
    }


    public static String getStaffRole(Long staffId, List<Long> roloIds) {
        Set<Long> set = new HashSet<>();
        for (Long roleId : roloIds) {
            set.add(roleId);
        }

        List<Long> list = new ArrayList<>();
        list.addAll(set);
        Map<String, List<Long>> map = new HashMap<>();
        map.put(staffId + "", list );
        return JSON.toJSONString(map);
    }
}
