package com.tuoheng.admin.service.cycle;

import com.tuoheng.admin.request.cycle.AddInspectionCycleRequest;
import com.tuoheng.admin.request.cycle.EditInspectionCycleRequest;
import com.tuoheng.admin.request.cycle.QueryInspectionCyclePageListRequest;
import com.tuoheng.admin.service.cycle.add.AddInspectionCycleService;
import com.tuoheng.admin.service.cycle.delete.DeleteInspectionCycleService;
import com.tuoheng.admin.service.cycle.query.list.QueryInspectionCyclePageListService;
import com.tuoheng.admin.service.cycle.query.one.QueryInspectionCycleService;
import com.tuoheng.admin.service.cycle.update.UpdateInspectionCycleEnableService;
import com.tuoheng.admin.service.cycle.update.UpdateInspectionCycleService;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class InspectionCycleServiceImpl implements InspectionCycleService {

    @Autowired
    private QueryInspectionCyclePageListService queryInspectionCyclePageListService;

    @Autowired
    private QueryInspectionCycleService queryInspectionCycleService;

    @Autowired
    private AddInspectionCycleService addInspectionCycleService;

    @Autowired
    private UpdateInspectionCycleService updateInspectionCycleService;

    @Autowired
    private DeleteInspectionCycleService deleteInspectionCycleService;

    @Autowired
    private UpdateInspectionCycleEnableService updateInspectionCycleEnableService;

    @Override
    public JsonResult selectPageList(QueryInspectionCyclePageListRequest request) {
        return queryInspectionCyclePageListService.getPageList(request);
    }

    @Override
    public JsonResult getInfo(String id) {
        return queryInspectionCycleService.get(id);
    }

    @Override
    public JsonResult insert(AddInspectionCycleRequest request) {
        return addInspectionCycleService.add(request);
    }

    @Override
    public JsonResult update(EditInspectionCycleRequest request) {
        return updateInspectionCycleService.edit(request);
    }

    @Override
    public JsonResult deleteByIdList(List<String> idList) {
        return deleteInspectionCycleService.deleteByIdList(idList);
    }

    @Override
    public JsonResult updateEnable(String id, Integer isEnable) {
        return updateInspectionCycleEnableService.updateEnable(id, isEnable);
    }

}
