package com.jiayue.ipfcst.console.controller;

import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
import com.jiayue.ipfcst.common.data.entity.FileAnalysisRecord;
import com.jiayue.ipfcst.console.service.FileAnalysisRecordService;
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.RestController;

import java.util.Date;
import java.util.List;

@RestController
public class FileAnalysisRecordController {
  @Autowired
  FileAnalysisRecordService fileAnalysisRecordService;

  @GetMapping("/FileAnalysisRecord/{startTime}")
  public ResponseVO findByCreateTimeBetween(@PathVariable Long startTime) {
    List<FileAnalysisRecord> fileAnalysisRecords = fileAnalysisRecordService.findByCreateTimeBetween(new Date(startTime), new Date(startTime + 86400000l));
    return ResponseVO.success(fileAnalysisRecords);
  }
}
