package com.zioinfo.signage.service;

import com.zioinfo.signage.domain.BackupVo;
import com.zioinfo.signage.mapper.BackupMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
@RequiredArgsConstructor
public class BackupService {
    private final BackupMapper mapper;

    public List<BackupVo> list(String tenantCode, String status, String keyword) {
        return mapper.findAll(tenantCode, status, keyword);
    }

    public BackupVo get(Long id) { return mapper.findById(id); }

    public BackupVo create(BackupVo v) {
        mapper.insert(v);
        return mapper.findById(v.getId());
    }

    public BackupVo update(Long id, BackupVo v) {
        v.setId(id);
        mapper.update(v);
        return mapper.findById(id);
    }

    public void delete(Long id) { mapper.delete(id); }
}
