package com.ycwl.basic.controller.pc;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ycwl.basic.model.common.BaseQueryParameterReq;
import com.ycwl.basic.model.pc.faceDetectLog.entity.FaceDetectLog;
import com.ycwl.basic.model.pc.faceDetectLog.req.FaceDetectLogReqQuery;
import com.ycwl.basic.service.pc.FaceDetectLogService;
import com.ycwl.basic.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Deprecated
@RestController
@RequestMapping("/api/face/detect_log/v1")
public class FaceDetectLogController {
    @Autowired
    private FaceDetectLogService service;

    @PostMapping("/page")
    public ApiResponse<PageInfo<FaceDetectLog>> pageQuery(@RequestBody FaceDetectLogReqQuery req) {
        PageHelper.startPage(req.getPageNum(), req.getPageSize());
        List<FaceDetectLog> list = service.listByTimeDesc(req);
        PageInfo<FaceDetectLog> pageInfo = new PageInfo<>(list);
        return ApiResponse.success(pageInfo);
    }
}
