package com.yida.data.user.controller;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.user.dto.StrategySaveDTO;
import com.yida.data.user.service.EduFaceGroupStrategyService;
import com.yida.data.user.vo.StrategyInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * 人脸组-策略Controller
 *
 * @author ZYJ
 * @date 2022-12-12 11:04:39
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("eduFaceGroupStrategy")
@Api(tags = "人脸组-策略api")
public class EduFaceGroupStrategyController {

    private final EduFaceGroupStrategyService eduFaceGroupStrategyService;

    @GetMapping(value = "getStrategyInfo")
    @ApiOperation(value = "获取人脸组策略信息")
    public ResultBean<StrategyInfoVO> getStrategyInfo(@ApiParam(value = "人脸组id", required = true) @RequestParam Long faceGroupId) {
        return ResultBean.buildSuccess(eduFaceGroupStrategyService.getStrategyInfo(faceGroupId));
    }

    @PostMapping(value = "saveStrategyInfo")
    @ApiOperation(value = "保存人脸组策略信息")
    public ResultBean<String> saveStrategyInfo(@RequestBody StrategySaveDTO strategySaveDTO) {
        eduFaceGroupStrategyService.saveStrategyInfo(strategySaveDTO);
        return ResultBean.buildSuccess();
    }
}
