Vue
let one = new FormData()
for (var i = 0; i < this.checkFileimageObj.length; i++) {
one.set('annexList[' + i + '].file', this.checkFileimageObj[i].raw)
one.set('annexList[' + i + '].annexType', '1')
}
addcultural(one).then(res => {
if (res.code == 200) {
console.log(res)
}
})
export function addcultural(data){
return request({
url:'/business/relciOperation/insertSaveRelicMess',
method:'post',
data:data
})
}
Java:
public class Annex extends BaseEntity {
private static final Long serialVersionUID = 1l;
public List<QjRelicImgAnnex> getAnnexList() {
return annexList;
}
public void setAnnexList(List<QjRelicImgAnnex> annexList) {
this.annexList = annexList;
}
private List<QjRelicImgAnnex> annexList;
}
public class QjRelicImgAnnex extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 图片Id
*/
@ApiModelProperty(value = "图片Id")
private Long id;
/**
* 文物Id
*/
@ApiModelProperty(value = "文物Id")
private String relicImgdataid;
/**
* 附件类型
*/
@ApiModelProperty(value = "附件类型")
private String annexType;
@ApiModelProperty(value = "文物附件", example = "上传文件流信息MultipartFile")
MultipartFile[] file;
get/set
}
public AjaxResult insertSaveRelicMess(Annex annex) {}