图库新增删除功能
This commit is contained in:
parent
080778a62e
commit
2885f477dd
@ -65,4 +65,17 @@ public class LibraryProductController {
|
|||||||
return libraryProductService.shopImportToLib(storeId);
|
return libraryProductService.shopImportToLib(storeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除图库图", notes = "根据主图id删除图库图")
|
||||||
|
@RequestMapping(value = "/delByLibraryProductId", method = RequestMethod.DELETE)
|
||||||
|
public CommonResult delByLibraryProductId(@RequestParam("libraryProductId") long libraryProductId) {
|
||||||
|
return libraryProductService.delLibraryProductById(libraryProductId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,4 +41,6 @@ public interface LibraryProductService extends IBaseService<LibraryProduct> {
|
|||||||
|
|
||||||
|
|
||||||
CommonResult shopImportToLib(Integer storeId);
|
CommonResult shopImportToLib(Integer storeId);
|
||||||
|
|
||||||
|
CommonResult delLibraryProductById(long storeId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -333,6 +333,19 @@ public class LibraryProductImpl extends BaseServiceImpl<LibraryProductMapper, Li
|
|||||||
return CommonResult.success("导入成功:路径复制中...");
|
return CommonResult.success("导入成功:路径复制中...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult delLibraryProductById(long libraryProductId) {
|
||||||
|
this.remove(libraryProductId);
|
||||||
|
QueryWrapper<LibraryProductImage> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("product_id",libraryProductId);
|
||||||
|
List<LibraryProductImage> libraryProductImageList= libraryProductImageService.list(queryWrapper);
|
||||||
|
if(!libraryProductImageList.isEmpty()){
|
||||||
|
List<Long> LibraryProductImageIds=libraryProductImageList.stream().map(LibraryProductImage::getId).collect(Collectors.toList());
|
||||||
|
libraryProductImageService.removeBatchByIds(LibraryProductImageIds);
|
||||||
|
}
|
||||||
|
return CommonResult.success("操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量保存到图库
|
* 批量保存到图库
|
||||||
* @param shopProductImageList
|
* @param shopProductImageList
|
||||||
@ -483,6 +496,8 @@ public class LibraryProductImpl extends BaseServiceImpl<LibraryProductMapper, Li
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验是否存在,存在则去除
|
* 校验是否存在,存在则去除
|
||||||
* @param shopProductBaseMap
|
* @param shopProductBaseMap
|
||||||
|
|||||||
1
sql/shop/dev/20260112_dml.sql
Normal file
1
sql/shop/dev/20260112_dml.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
INSERT INTO `admin_base_protocol` (`ctl`, `met`, `db`, `rights_id`, `log`, `path`,`comment`) VALUES ('/admin/shop/libraryProduct/delByLibraryProductId', 'index', 'master', '', '0', '/admin/shop/libraryProduct/delByLibraryProductId','图库图片删除');
|
||||||
Loading…
Reference in New Issue
Block a user