package com.red.circle.console.app.service.app.sys;

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.other.inner.model.cmd.user.device.ArchiveDeviceQryCmd;
import com.red.circle.other.inner.model.dto.user.device.ArchiveDeviceDTO;
import com.red.circle.other.inner.endpoint.user.device.RegisterDeviceClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 封禁设备 服务实现类
 * </p>
 *
 * @author pengliang
 * @since 2021-03-29
 */
@Service
@RequiredArgsConstructor
public class SysArchiveDeviceServiceImpl implements SysArchiveDeviceService {

  private final RegisterDeviceClient registerDeviceClient;

  @Override
  public PageResult<ArchiveDeviceDTO> pageList(ArchiveDeviceQryCmd query) {

    return ResponseAssert.requiredSuccess(registerDeviceClient.pageList(query));
  }

  @Override
  public void delByDeviceNo(Long id) {
    registerDeviceClient.delByDeviceNo(id);
  }
}
