All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fr.pacifista.api.web.news.service.mappers.PacifistaNewsMapper Maven / Gradle / Ivy

package fr.pacifista.api.web.news.service.mappers;

import com.funixproductions.core.crud.mappers.ApiMapper;
import fr.pacifista.api.web.news.client.dtos.PacifistaNewsDTO;
import fr.pacifista.api.web.news.service.entities.PacifistaNews;
import org.mapstruct.*;

@Mapper(componentModel = "spring")
public interface PacifistaNewsMapper extends ApiMapper {

    @Override
    @Mapping(target = "uuid", source = "id")
    @Mapping(target = "id", ignore = true)
    PacifistaNews toEntity(PacifistaNewsDTO dto);

    @Override
    @Mapping(target = "id", source = "uuid")
    @Mapping(target = "likesAmount", ignore = true)
    @Mapping(target = "commentsAmount", ignore = true)
    PacifistaNewsDTO toDto(PacifistaNews entity);

    @Override
    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    void patch(PacifistaNews request, @MappingTarget PacifistaNews toPatch);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy