Skip to content

Commit

Permalink
feat-IDeleteAbility-增加删除前校验方法beforeDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Oct 21, 2024
1 parent f55c471 commit a1c7eaf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
*/
public interface IDeleteAbility extends IDatabaseAbilityStd, IMetadataAbility {

default void beforeDelete(String id) {

}

default void afterDelete(String id) {

}
Expand All @@ -32,6 +36,7 @@ default void afterDelete(String id) {
@Transactional
@Operation(summary = "删除数据", description = "返回被删除数据的数量,正常为1")
default Integer delete(@PathParam("id") String id) {
this.beforeDelete(id);
int result;

if (this instanceof IChildrenAbility ability) { // 如果带子表,考虑级联删除
Expand Down

0 comments on commit a1c7eaf

Please sign in to comment.