package com.ningdatech.carapi.open.controller;

import com.ningdatech.carapi.car.equipment.manage.VehicleEquipmentManage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-09
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/archives/equipment")
@Api(value = "archives", tags = "车辆管理-档案管理")
@RequiredArgsConstructor
public class OpenApiEquipmentController {
    private final VehicleEquipmentManage equipmentManage;

    @ApiOperation(value = "测试加一个车辆的设备", notes = "测试加一个车辆的设备")
    @GetMapping("/test-add-equipment")
    public Boolean testAddEquipment(@RequestParam String car_plate) {
        return equipmentManage.initEquipmentFromSip(car_plate);
    }

    @ApiOperation(value = "批量添加所有车辆", notes = "批量添加所有车辆")
    @GetMapping("/test-add-equipment-all")
    public Boolean testAddEquipmentAll() {
        return equipmentManage.initEquipmentFromSipAll();
    }

    @GetMapping("/get-equip-no")
    public void getEquipNo(){
        equipmentManage.getEquipNo();
    }
}
