package com.jiayue.ipfcst.console.controller;

import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
import com.jiayue.ipfcst.common.data.entity.DataLimitationLog;
import com.jiayue.ipfcst.console.service.DataLimitationLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/dataLimitationLogController/")
@Slf4j
public class DataLimitationLogController {
  @Autowired
  private DataLimitationLogService dataLimitationLogService;


  @GetMapping(value = "queryDataLimitationLog/{startTime}/{endTime}")
  public ResponseVO queryManualInterventionLog(@PathVariable Long startTime,
                                               @PathVariable Long endTime){
    List<DataLimitationLog> dataLimitationLogList= new ArrayList<>();
    try {
      dataLimitationLogList = dataLimitationLogService.queryDataLimitationLog(startTime,endTime);
    }catch (Exception e) {
      log.error("系统错误：", e);
    } finally {
      return ResponseVO.success(dataLimitationLogList);
    }
  }

}
