package com.zioinfo.signage.service;

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

@Service
@RequiredArgsConstructor
public class SignImageService {
    private final SignImageMapper mapper;

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

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

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

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

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