bug fix
All checks were successful
test/timeline-server/pipeline/head This commit looks good

This commit is contained in:
jiangh277
2025-12-26 18:27:22 +08:00
parent 17af33b098
commit e7fe90464d
11 changed files with 86 additions and 25 deletions

View File

@@ -14,4 +14,5 @@ public interface CommonRelationMapper {
List<String> getStoryItemsByImageInstanceId(String imageInstanceId);
void deleteImageStoryItemRelation(String imageInstanceId, String storyItemId);
void deleteRelationByRelaId(String instanceId);
}

View File

@@ -166,6 +166,9 @@ public class FileServiceImpl implements FileService {
imageInfo.setIsDeleted(CommonConstants.DELETED);
imageInfo.setUpdateTime(LocalDateTime.now());
imageInfoMapper.update(imageInfo);
// 删除关联关系
commonRelationMapper.deleteRelationByRelaId(instanceId);
} catch (Exception e) {
log.error("删除图片失败", e);
throw new CustomException(500, "删除图片失败");

View File

@@ -30,4 +30,12 @@
INSERT INTO common_relation (rela_id, sub_rela_id, rela_type, user_id)
VALUES (#{relaId}, #{subRelaId}, #{relationType}, #{userId})
</insert>
<delete id="deleteRelationByRelaId">
UPDATE common_relation
SET is_delete = 1,
update_time = NOW()
WHERE rela_id = #{imageInstanceId}
</delete>
</mapper>