start backend
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
package com.krylov.refound.mapper;
|
||||
|
||||
public class PostMapper {
|
||||
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.email", target = "userEmail")
|
||||
PostResponse toResponse(Post post);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user