当用get请求,接到前端传的字符串数组列表的时候,用split 分割的方式

if(!StringUtils.isBlank(resident.getTagsId())){
    List tagsIdList = new ArrayList<>();
    for (String tagsId : resident.getTagsId.split(",")){
        tagsIdList.add(Integer.parseInt(tagsId))
    }
    resident.setTagsIdList(tagsIdList)
}

ResidentController 层

你可能感兴趣的:(前端)