package com.muyu.controller; import com.muyu.common.Result; import com.muyu.domain.resp.UnifiedTaskResp; import com.muyu.service.VehicleUnifiedService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author DongZeLiang * @version 1.0 * @description 车辆一键操作控制层 * @date 2023/12/6 */ @Log4j2 @RestController @RequestMapping("/vehicle/unified") public class VehicleUnifiedController { @Autowired private VehicleUnifiedService vehicleUnifiedService; /** * 一键上线 */ @PostMapping("/online") public Result unifiedOnline(){ this.vehicleUnifiedService.unifiedOnline(); return Result.success(null,"已成功发布一键上线任务"); } /** * 一键离线 */ @PostMapping("/offline") public Result unifiedOffline(){ this.vehicleUnifiedService.unifiedOffline(); return Result.success(null,"已成功发布一键离线任务"); } /** * 一键上报 */ @PostMapping("/send") public Result unifiedSend(){ this.vehicleUnifiedService.unifiedSend(); return Result.success(null,"已成功发布一键上报任务"); } /** * 一键重置路径 */ @PostMapping("/position") public Result unifiedPosition(){ this.vehicleUnifiedService.unifiedPosition(); return Result.success(null,"已成功发布一键上报任务"); } /** * 一键取消上报 */ @PostMapping("/stop") public Result unifiedStop(){ this.vehicleUnifiedService.unifiedStop(); return Result.success(null,"已成功发布取消上报任务"); } /** * 获取一键执行状态 * @return 执行结果 */ @GetMapping("/status") public Result unifiedStatus(){ return Result.success(this.vehicleUnifiedService.unifiedStatus()); } }