package vip.xiaonuo.biz.api.cloud.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import vip.xiaonuo.biz.api.cloud.entity.CloudTruckIdentifyNotify;
import vip.xiaonuo.biz.api.cloud.service.CloudTruckIdentifyNotifyService;
import vip.xiaonuo.common.pojo.CommonResult;

import javax.annotation.Resource;

@Api(tags = "云端车辆识别控制器")
@ApiSupport(author = "SNOWY_TEAM", order = 1)
@RestController
@Validated
public class CloudTruckIdentifyNotifyController {

    @Resource
    private CloudTruckIdentifyNotifyService cloudTruckIdentifyNotifyService;

    /**
     * 添加车辆身份数据
     *
     * @author xiang
     * @date 2023/10/23 16:28
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("添加车辆身份数据")
    @PostMapping("/api/cloud/truckIdentify/notify")
    public CommonResult<Object> notify(@RequestBody CloudTruckIdentifyNotify param) {
        cloudTruckIdentifyNotifyService.notify(param);
        return CommonResult.ok();
    }

    /**
     * 获取车辆预约名单
     *
     * @author xiang
     * @date 2023/10/23 16:28
     */
    @ApiOperationSupport(order = 2)
    @ApiOperation("获取车辆预约名单")
    @RequestMapping("/api/cloud/truckIdentify/plateWhiteList")
    public Object plateWhiteList(CloudTruckIdentifyNotify param) {
        return cloudTruckIdentifyNotifyService.plateWhiteList(param.getDepotId());
    }

}
