package com.tuoheng.admin.service.iotequipment;

import com.tuoheng.admin.request.iotequipment.AddIotEquipmentRequest;
import com.tuoheng.admin.request.iotequipment.EditIotEquipmentRequest;
import com.tuoheng.admin.request.iotequipment.QueryIotEquipmentListRequest;
import com.tuoheng.admin.request.iotequipment.QueryIotEquipmentPageListRequest;
import com.tuoheng.admin.service.iotequipment.add.AddIotEquipmentService;
import com.tuoheng.admin.service.iotequipment.delete.DeleteEditIotEquipmentByIdService;
import com.tuoheng.admin.service.iotequipment.edit.EditIotEquipmentService;
import com.tuoheng.admin.service.iotequipment.query.QueryEditIotEquipmentByIdService;
import com.tuoheng.admin.service.iotequipment.query.QueryEditIotEquipmentListService;
import com.tuoheng.admin.service.iotequipment.query.QueryEditIotEquipmentPageListService;
import com.tuoheng.common.core.utils.JsonResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class IotEquipmentServiceImpl implements IotEquipmentService {

    private final QueryEditIotEquipmentPageListService queryEditIotEquipmentPageListService;

    private final QueryEditIotEquipmentListService queryEditIotEquipmentListService;

    private final QueryEditIotEquipmentByIdService queryEditIotEquipmentByIdService;

    private final AddIotEquipmentService addIotEquipmentService;

    private final EditIotEquipmentService editIotEquipmentService;

    private final DeleteEditIotEquipmentByIdService deleteEditIotEquipmentByIdService;

    /**
     * 查询物联设备分页列表
     */
    @Override
    public JsonResult getPageList(QueryIotEquipmentPageListRequest request) {
        return queryEditIotEquipmentPageListService.getPageList(request);
    }

    /**
     * 查询物联设备列表
     */
    @Override
    public JsonResult getList(QueryIotEquipmentListRequest request) {
        return queryEditIotEquipmentListService.getList(request);
    }

    /**
     * 获取物联设备信息
     */
    @Override
    public JsonResult getInfo(String id) {
        return queryEditIotEquipmentByIdService.getInfoById(id);
    }

    /**
     * 新增获取物联设备
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult add(AddIotEquipmentRequest request) {
        return addIotEquipmentService.add(request);
    }

    /**
     * 修改获取物联设备
     *
     * @param request
     * @return
     */
    @Override
    public JsonResult edit(EditIotEquipmentRequest request) {
        return editIotEquipmentService.edit(request);
    }

    /**
     * 删除获取物联设备
     */
    @Override
    public JsonResult deletedById(String id) {
        return deleteEditIotEquipmentByIdService.deletedById(id);
    }

    /**
     * 启用、禁用
     * @param id
     * @param status
     * @return
     */
    @Override
    public JsonResult isEnabled(String id, int status) {
        return editIotEquipmentService.isEnabled(id,status);
    }

}
