Przeglądaj źródła

feat: 添加事务注解

xdd 4 tygodni temu
rodzic
commit
0d324eec10

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -72,6 +72,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
@@ -918,6 +919,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     }
 
     @Override
+    @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
     public R sendRewardByFsUser(FsCourseSendRewardUParam param) {
         FsUser user = fsUserMapper.selectFsUserByUserId(param.getUserId());
         if (user == null){