Skip to content

Commit

Permalink
refactor: 初始化数据时不触发crud事件
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Dec 21, 2023
1 parent 27ff051 commit a20814b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.hswebframework.web.api.crud.entity.TreeSupportEntity;
import org.hswebframework.web.crud.events.EntityEventHelper;
import org.hswebframework.web.crud.service.GenericReactiveTreeSupportCrudService;
import org.hswebframework.web.id.IDGenerator;
import org.jetlinks.community.device.entity.DeviceCategoryEntity;
Expand Down Expand Up @@ -39,6 +40,7 @@ public void run(String... args) {
.createQuery()
.fetchOne()
.switchIfEmpty(initDefaultData().then(Mono.empty()))
.as(EntityEventHelper::setDoNotFireEvent)
.subscribe(ignore->{},
err -> log.error("init device category error", err));
}
Expand Down

0 comments on commit a20814b

Please sign in to comment.