fix(app): db transactional

This commit is contained in:
Timi
2026-11-18 00:10:01 +08:00
parent 8954902994
commit 6feaad4b33
@@ -3,6 +3,7 @@ package com.imyeyu.api.modules.app.service;
import com.imyeyu.api.modules.app.entity.AppChannel; import com.imyeyu.api.modules.app.entity.AppChannel;
import com.imyeyu.api.modules.app.entity.AppProduct; import com.imyeyu.api.modules.app.entity.AppProduct;
import com.imyeyu.api.modules.app.entity.AppRelease; import com.imyeyu.api.modules.app.entity.AppRelease;
import com.imyeyu.api.config.dbsource.TimiServerDBConfig;
import com.imyeyu.api.modules.app.mapper.AppChannelMapper; import com.imyeyu.api.modules.app.mapper.AppChannelMapper;
import com.imyeyu.api.modules.app.mapper.AppProductMapper; import com.imyeyu.api.modules.app.mapper.AppProductMapper;
import com.imyeyu.api.modules.app.mapper.AppReleaseMapper; import com.imyeyu.api.modules.app.mapper.AppReleaseMapper;
@@ -359,7 +360,7 @@ public class AppVersionService {
/// @param grayPermille 灰度比例,为空时保持原值 /// @param grayPermille 灰度比例,为空时保持原值
/// @param operatorId 操作人用户 ID /// @param operatorId 操作人用户 ID
/// @param note 变更说明 /// @param note 变更说明
@Transactional @Transactional(TimiServerDBConfig.ROLLBACKER)
public void publish(String releaseId, String channelCode, Integer grayPermille, String operatorId, String note) { public void publish(String releaseId, String channelCode, Integer grayPermille, String operatorId, String note) {
AppRelease release = releaseMapper.select(releaseId); AppRelease release = releaseMapper.select(releaseId);
if (release == null) { if (release == null) {
@@ -392,7 +393,7 @@ public class AppVersionService {
/// @param channelCode 通道代码 /// @param channelCode 通道代码
/// @param targetReleaseId 目标发布 ID /// @param targetReleaseId 目标发布 ID
/// @param operatorId 操作人用户 ID /// @param operatorId 操作人用户 ID
@Transactional @Transactional(TimiServerDBConfig.ROLLBACKER)
public void rollback(String productId, String channelCode, String targetReleaseId, String operatorId) { public void rollback(String productId, String channelCode, String targetReleaseId, String operatorId) {
AppChannel channel = channelMapper.selectByProductAndCode(productId, channelCode); AppChannel channel = channelMapper.selectByProductAndCode(productId, channelCode);
if (channel == null) { if (channel == null) {
@@ -415,7 +416,7 @@ public class AppVersionService {
/// ///
/// @param releaseId 发布 ID /// @param releaseId 发布 ID
/// @param operatorId 操作人用户 ID /// @param operatorId 操作人用户 ID
@Transactional @Transactional(TimiServerDBConfig.ROLLBACKER)
public void revoke(String releaseId, String operatorId) { public void revoke(String releaseId, String operatorId) {
AppRelease release = releaseMapper.select(releaseId); AppRelease release = releaseMapper.select(releaseId);
if (release == null) { if (release == null) {