package com.cd.detection.domain.zoo.service;

import com.cd.detection.db.core.AnimalCoreService;
import com.cd.detection.domain.zoo.dto.AnimalDto;
import com.cd.detection.domain.zoo.dto.AnimalDto.Basic;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class AnimalService {

  private final AnimalCoreService animalCoreService;

  public Page<Basic> getAnimals(AnimalDto.SearchListRequest searchListRequest) {
    return animalCoreService.getAnimals(searchListRequest);
  }

  public void saveAnimal(AnimalDto.AddRequest dto) {
    animalCoreService.saveZoo(dto);
  }

  public void updateAnimal(AnimalDto.ModifyRequest dto) {
    animalCoreService.updateZoo(dto);
  }

  public void deleteAnimal(AnimalDto.ModifyRequest dto) {
    animalCoreService.deleteZoo(dto);
  }

}
