package com.ruoyi.web.controller.tool;


import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.utils.R;
import com.ruoyi.system.dto.ManualMeasureDTO;
import com.ruoyi.system.service.DirectiveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * Create By Spring-2022/10/29
 */
@RestController
@RequestMapping(value = "/directive")
@Api(tags = "指令控制")
@Slf4j
@Anonymous
public class DirectiveController {

    @Resource
    private DirectiveService directiveService;


    @PostMapping(value = "/manualMeasure")
    @ApiOperation("手动开始测量")
    public R<Boolean> manualMeasure(@Valid @RequestBody ManualMeasureDTO manualMeasureDTO)  {
        return R.ok(directiveService.manualMeasure(manualMeasureDTO));
    }

    @PostMapping(value = "/taskStop")
    @ApiOperation("更改任务状态")
    public R<Boolean> taskStop(Long siteId, Long action)  {
        return R.ok(directiveService.taskStop(siteId,action));
    }




}
