This commit is contained in:
@@ -14,4 +14,5 @@ public interface CommonRelationMapper {
|
||||
List<String> getStoryItemsByImageInstanceId(String imageInstanceId);
|
||||
|
||||
void deleteImageStoryItemRelation(String imageInstanceId, String storyItemId);
|
||||
void deleteRelationByRelaId(String instanceId);
|
||||
}
|
||||
|
||||
@@ -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, "删除图片失败");
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user