package com.ycwl.basic.controller.pc;

import com.github.pagehelper.PageInfo;
import com.ycwl.basic.model.pc.faceSample.entity.FaceSampleEntity;
import com.ycwl.basic.model.pc.faceSample.req.FaceSampleReqQuery;
import com.ycwl.basic.model.pc.faceSample.resp.FaceSampleRespVO;
import com.ycwl.basic.service.pc.FaceSampleService;
import com.ycwl.basic.utils.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author：longbinbin
 * @Date：2024/12/2 16:33
 */
@Deprecated
@RestController
@RequestMapping("/api/faceSample/v1")
@Api(tags = "人脸样本管理")
public class FaceSampleController {
    @Autowired
    private FaceSampleService FaceSampleService;

    @ApiOperation("分页查询人脸样本")
    @PostMapping("/page")
    public ApiResponse<PageInfo<FaceSampleRespVO>> pageQuery(@RequestBody FaceSampleReqQuery FaceSampleReqQuery) {
        return FaceSampleService.pageQuery(FaceSampleReqQuery);
    }
    @ApiOperation("人脸样本列表查询")
    @PostMapping("/list")
    public ApiResponse<List<FaceSampleRespVO>> list(@RequestBody FaceSampleReqQuery FaceSampleReqQuery) {
        return FaceSampleService.list(FaceSampleReqQuery);
    }
    @ApiOperation("人脸样本详情查询")
    @GetMapping("/getDetail/{id}")
    public ApiResponse<FaceSampleRespVO> getDetail(@PathVariable("id") Long id) {
        return FaceSampleService.getById(id);
    }
    @ApiOperation("添加人脸样本")
    @PostMapping("/add")
    public ApiResponse<Integer> add(@RequestBody FaceSampleEntity FaceSample) {
        return FaceSampleService.add(FaceSample);
    }
    @ApiOperation("删除人脸样本")
    @PostMapping("/deleteById/{id}")
    public ApiResponse<Integer> deleteById(@PathVariable Long id) {
        return FaceSampleService.deleteById(id);
    }
    @ApiOperation("批量删除人脸样本")
    @PostMapping("/deleteByIds")
    public ApiResponse<Integer> deleteByIds(@RequestBody List<Long> ids) {
        return FaceSampleService.deleteByIds(ids);
    }
    @ApiOperation("修改人脸样本信息")
    @PostMapping("/update")
    public ApiResponse<Integer> update(@RequestBody FaceSampleEntity FaceSample) {
        return FaceSampleService.update(FaceSample);
    }




}
