package com.xindazhou.vehicle.api;

import com.xindazhou.framework.common.pojo.CommonResult;
import com.xindazhou.vehicle.service.impl.VehicleControlServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

import static com.xindazhou.framework.common.pojo.CommonResult.success;

/**
 * 车辆报警 API 实现类
 *
 * @author xindazhou
 */
@RestController
@Validated
public class VehicleAlarmApiImpl implements VehicleAlarmApi {

    @Resource
    private VehicleControlServiceImpl vehicleControlService;

    @Override
    public CommonResult<Boolean> pushAlarm(Long userId, Long vehicleId, String alarmType, Map<String, Object> alarmData) {
        vehicleControlService.sendAlarmMessage(userId, vehicleId, alarmType, alarmData);
        return success(true);
    }

}

