package cn.iocoder.yudao.module.shop.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
import cn.iocoder.yudao.module.shop.service.IShopUserCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("/smallApp-inspection")
public class SmallAppShopController {

    @Autowired
    private IShopUserCarService shopUserCarService;

    @Autowired
    private IInspectionAppointmentService appointmentService;
    /**
     * 预约功能
     */
    @PostMapping("/appointmentInspection")
    @TenantIgnore
    @PreAuthenticated
    public CommonResult appointmentInspection(@RequestBody InspectionAppointment appointment) throws ParseException {
        return success(appointmentService.appointmentInspection(appointment));
    }
}
