728x90
반응형
SMALL
  • dto - BlogRequestDto, BlogResponseDto를 만들어준다! 각각 따로 저장하기 이미 BlogRequestDto를 완성했었기 때문에 저장을 따로 해주기 위해 만들었다.
package com.example.myblog.dto;

import lombok.Getter;

@Getter
public class BlogRequestDto {
    private String username;
    private String contents;
    private String titlename;
    private String password;
}
package com.example.myblog.dto;

import com.example.myblog.entity.Blog;
import lombok.Getter;

@Getter
public class BlogResponseDto {
    private String title;
    private String contents;
    private String username;

    public BlogResponseDto(Blog blog) {
        this.title = blog.getTitlename();
        this.contents = blog.getContents();
        this.username = blog.getUsername();
    }
}

BlogRequestDto에서

private String username; 
private String contents;
private String titlename;
private String password;

이걸 받지 못하는데 어떻게 하면 받을 수 있는지 고민을 더 해봐야할거 같다!!

완성은 했는데 정리는 이제 시작 ㅎㅎㅎㅎㅎ

728x90
반응형
LIST

+ Recent posts