package com.cmvr.web.controller.api;

import com.cmvr.common.core.controller.BaseController;
import com.cmvr.common.core.domain.AjaxResult;
import com.cmvr.edge.client.model.EdgeCommonVO;
import com.cmvr.edge.client.model.biohead.EdgeFacialExpressionVO;
import com.cmvr.edge.client.service.EdgeBioHeadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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;

@Api(tags = "边缘--机器人头部")
@RestController
@RequestMapping("/api/biohead")
@RequiredArgsConstructor
public class EdgeBioHeadController extends BaseController {

    private final EdgeBioHeadService edgeBioHeadService;

    @ApiOperation("设置面部表情")
    @PostMapping("/expression")
    public AjaxResult expression(@RequestBody EdgeFacialExpressionVO facialExpressionVo) {
        return success(edgeBioHeadService.setExpression(facialExpressionVo));
    }

    @ApiOperation("紧急停止")
    @PostMapping("/stop")
    public AjaxResult emergencyStop(@RequestBody EdgeCommonVO edgeCommonVO) {
        return success(edgeBioHeadService.emergencyStop(edgeCommonVO));
    }
}
