| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.*; |
| | | import io.seata.core.exception.TransactionException; |
| | | import io.seata.tm.api.GlobalTransactionContext; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Override |
| | | public R<Boolean> updateSysUser(SysUser sysUser) { |
| | | // 手动进行全局事务回滚 |
| | | try { |
| | | GlobalTransactionContext.getCurrent().rollback(); |
| | | } catch (TransactionException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.fail("更新用户失败:" + cause.getMessage()); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public R resetPassword(SysUser user) { |
| | | // 手动进行全局事务回滚 |
| | | try { |
| | | GlobalTransactionContext.getCurrent().rollback(); |
| | | } catch (TransactionException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.fail("重置用户密码失败:" + cause.getMessage()); |
| | | } |
| | | }; |