package com.demo1.board.api.dto;

import com.demo1.board.domain.Board;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BoardRequest {
    private String title;
    private String content;

    public Board toEntity() {
        return Board.builder()
                .title(title)
                .content(content)
                .build();
    }

    public Board toEntity(Long id) {
        return Board.builder()
                .id(id)
                .title(title)
                .content(content)
                .build();
    }
}
