package com.bohuikeji.delivery.backstage.controller.api.customer;

import com.bohuikeji.delivery.backstage.entity.TRentalCar;
import com.bohuikeji.delivery.backstage.service.ITRentalCarService;
import com.bohuikeji.frame.module.admin.entity.back.APIEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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;

/**
 * 租车接口
 */
@Slf4j
@Api(tags = {"租车相关接口"})
@RestController
@RequestMapping("/api/v2/rental")
@RequiredArgsConstructor
public class RentalCarV2Api {

    @Autowired
    ITRentalCarService rentalCarService;

    @ApiOperation("租车相关接口")
    @PostMapping("/save/car/info")
    public APIEntity saveRental(@RequestBody TRentalCar rentalCar) {
        return APIEntity.success(rentalCarService.save(rentalCar));
    }
}
