diff --git a/src/main/java/com/yupi/springbootinit/service/impl/ServerBigBrotherServiceImpl.java b/src/main/java/com/yupi/springbootinit/service/impl/ServerBigBrotherServiceImpl.java index def0bb4..8ea19e0 100644 --- a/src/main/java/com/yupi/springbootinit/service/impl/ServerBigBrotherServiceImpl.java +++ b/src/main/java/com/yupi/springbootinit/service/impl/ServerBigBrotherServiceImpl.java @@ -2,6 +2,8 @@ package com.yupi.springbootinit.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; @@ -10,18 +12,22 @@ import com.yupi.springbootinit.mapper.ServerBigBrotherMapper; import com.yupi.springbootinit.model.entity.ServerBigBrother; import com.yupi.springbootinit.service.ServerBigBrotherService; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StopWatch; /* * @author: ziin * @date: 2025/6/24 16:19 */ @Service +@Slf4j public class ServerBigBrotherServiceImpl extends ServiceImpl implements ServerBigBrotherService{ @Override @Transactional(rollbackFor = Exception.class) + @Async("taskExecutor") public void saveData(ServerBigBrother bigBrother) { - + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); ServerBigBrother serverBigBrother = baseMapper.selectOne(Wrappers.lambdaQuery() .eq(ServerBigBrother::getDisplayId, bigBrother.getDisplayId()) .eq(ServerBigBrother::getTenantId, bigBrother.getTenantId())); @@ -30,6 +36,9 @@ public class ServerBigBrotherServiceImpl extends ServiceImpl