17 lines
423 B
Java
17 lines
423 B
Java
package com.krylov.refound.mapper;
|
|
|
|
import com.krylov.refound.dto.PostRequest;
|
|
import com.krylov.refound.dto.PostResponse;
|
|
import com.krylov.refound.entity.Post;
|
|
import org.mapstruct.Mapper;
|
|
import org.mapstruct.Mapping;
|
|
|
|
@Mapper(componentModel = "spring")
|
|
public interface PostMapper {
|
|
|
|
Post toEntity(PostRequest request);
|
|
|
|
@Mapping(source = "user.login", target = "userEmail")
|
|
PostResponse toResponse(Post post);
|
|
}
|