package com.nokia.vo; import java.util.ArrayList; import java.util.List; import com.nokia.pojo.City; import com.nokia.pojo.Role; import lombok.Data; @Data public class FlowRoleCityVo { // 角色id private Integer roleId; // 角色名 private String roleName; // 赋权地市 private List cities; public FlowRoleCityVo(Role role) { this.roleId = role.getRoleId(); this.roleName = role.getRoleName(); this.cities = new ArrayList<>(); for (City city : role.getCities()) { this.cities.add(city.getCityId()); } } }