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


import com.red.circle.console.app.service.app.sys.SysArchiveDeviceService;
import com.red.circle.console.infra.annotations.OpsOperationReqLog;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.web.controller.BaseController;
import com.red.circle.other.inner.model.cmd.user.device.ArchiveDeviceQryCmd;
import com.red.circle.other.inner.model.dto.user.device.ArchiveDeviceDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 封禁设备 前端控制器
 *
 * @author pengliang
 * @since 2021-03-29
 */
@RestController
@RequestMapping("/sys/archive/device")
@RequiredArgsConstructor
public class SysArchiveDeviceRestController extends BaseController {

  private final SysArchiveDeviceService sysArchiveDeviceService;

  /**
   * 列表.
   */
  @GetMapping("/page")
  public PageResult<ArchiveDeviceDTO> pageList(ArchiveDeviceQryCmd query) {
    return sysArchiveDeviceService.pageList(query);
  }


  @OpsOperationReqLog(value = "删除-封禁设备列表")
  @GetMapping("/del/{id}")
  public void del(@PathVariable("id") Long id) {
    sysArchiveDeviceService.delByDeviceNo(id);
  }
}
