package cn.reghao.tnb.content.app.disk.db.repository;

import cn.reghao.tnb.content.app.disk.db.mapper.DiskAlbumMapper;
import cn.reghao.tnb.content.app.disk.db.mapper.DiskShareMapper;
import cn.reghao.tnb.content.app.util.IdService;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author reghao
 * @date 2025-09-06 15:52:24
 */
@Repository
public class DiskShareRepository {
    private final DiskShareMapper diskShareMapper;

    public DiskShareRepository(DiskShareMapper diskShareMapper) {
        this.diskShareMapper = diskShareMapper;
    }

    @Transactional(rollbackFor = Exception.class)
    public void deleteShare(long shareId) {
        diskShareMapper.updateSetDelete(shareId);
        diskShareMapper.deleteShareToList(shareId);
    }
}
