bright-life
@Override
public String deleteAlbum(String[] ids) {
StringBuilder deleteNames = new StringBuilder();
if (ids == null || ids.length == 0) {
return deleteNames.toString();
}
for (String id : ids) {
PhotoAlbum bean = this.loadAlbum(id);
//删除相册
this.photoAlbumDao.delete(bean);
// 删除图片
// 获取相册下的图片附件
List<SysAttach> attaches = this.attachService.selectAttachList("com.operate.entity.PhotoAlbum", id);
// 获取附件ids
String[] attachIds = new String[attaches.size()];
int i = 0;
for(SysAttach arr: attaches) {
attachIds[i++] = arr.getAttachId();
}
// 删除图片附件
this.attachService.deleteAttach(attachIds);
//返回删除的相册名称
deleteNames.append(bean.getTitle()).append(" 、");
}
if (deleteNames.length() > 0) {
deleteNames.deleteCharAt(deleteNames.length() - 1);
}
return deleteNames.toString();
}

分类:

技术点:

相关文章:

  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2021-09-08
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案