package cn.iocoder.yudao.module.inspection.controller;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.inspection.entity.InspectionMeetCarOrder;
import cn.iocoder.yudao.module.inspection.service.InspectionMeetCarOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 接车订单
 * @Author: 86187
 * @Date: 2025/04/11 11:20
 * @Version: 1.0
 */
@RestController
@RequestMapping("/admin-api/inspection-meet-car-order")
@RequiredArgsConstructor
public class InspectionMeetCarOrderController {

    private final InspectionMeetCarOrderService inspectionMeetCarOrderService;

    /**
     * 新增接车订单
     *
     * @param order 接车订单
     * @return
     */
    @PostMapping("/add")
    public CommonResult<?> add(@RequestBody InspectionMeetCarOrder order) {
        inspectionMeetCarOrderService.add(order);
        return CommonResult.ok();
    }

    @GetMapping("/get")
    public CommonResult<?> get(Long id) {
        return CommonResult.success(inspectionMeetCarOrderService.getById(id));
    }

    @DeleteMapping("/delete")
    public CommonResult<?> delete(Long id) {
        return CommonResult.success(inspectionMeetCarOrderService.removeById(id));
    }
}
