package com.example.survey.vo; import com.example.survey.entity.Role; import com.example.survey.enumeration.AuthEnum; import lombok.*; import java.util.ArrayList; import java.util.List; /** * @author Pope */ @Getter @Setter @ToString @NoArgsConstructor @AllArgsConstructor public class RoleVo { private String roleName; private List authorityList; public RoleVo(Role role) { roleName = role.getName(); authorityList = new ArrayList<>(); for (AuthEnum authEnum : role.getAuthoritySet()) { authorityList.add(authEnum.getName()); } } }