1. package com.ruoyi.all.service;
    2. import com.ruoyi.all.domain.Car;
    3. import com.ruoyi.all.dto.CarDto;
    4. import org.mapstruct.Mapper;
    5. import org.mapstruct.Mapping;
    6. import java.util.List;
    7. @Mapper(componentModel = "spring")
    8. public interface CarMapping {
    9. @Mapping(target = "type", source = "car.type")
    10. @Mapping(target = "seatCount", source = "count")
    11. CarDto toCarDto(Car car);
    12. @Mapping(target = "type", source = "car.type")
    13. @Mapping(target = "seatCount", source = "count")
    14. List<CarDto> toList(List<Car> carDtoList);
    15. }