From 8065a8d04880b83527bd1dd1f593bda2142eeb0b Mon Sep 17 00:00:00 2001 From: Ziin Date: Tue, 24 Jun 2025 19:09:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=A4=A7=E5=93=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=85=A5=E5=BA=93=E8=8A=B1=E8=B4=B9=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ServerBigBrotherServiceImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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