package cn.iocoder.yudao.module.system.api.rental;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.rental.dto.RentalItemsRecordDTO;
import cn.iocoder.yudao.module.system.controller.admin.rental.vo.itemsrecord.RentalItemsRecordSaveReqVO;
import cn.iocoder.yudao.module.system.service.rental.RentalItemsRecordService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

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

@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class RentalItemsRecordApiImpl implements RentalItemsRecordApi {

    @Resource
    private RentalItemsRecordService rentalItemsRecordService;

    @Override
    public CommonResult<Boolean> create(List<RentalItemsRecordDTO> createReqVO) {
        rentalItemsRecordService.createRentalItemsRecordBath(BeanUtils.toBean(createReqVO, RentalItemsRecordSaveReqVO.class));
        return success(true);
    }
}
