Skip to content

Commit

Permalink
feat: Filter Entity 내부 필드 member 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
capDoYeonLee committed Oct 13, 2024
1 parent 41e7308 commit 445a905
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.demo.filter.application.dto;


import com.example.demo.auth.persistence.MemberEntity;
import com.example.demo.auth.persistence.MemberModel;
import com.example.demo.common.support.dto.AbstractDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -14,4 +16,5 @@
public class CreateFilterRequest implements AbstractDto {
private String filterName;
private String filterColor;
private MemberEntity member;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example.demo.filter.application.model;

import com.example.demo.auth.persistence.MemberEntity;
import com.example.demo.auth.persistence.MemberModel;
import com.example.demo.common.support.AbstractModel;
import lombok.*;

Expand All @@ -12,6 +14,7 @@ public class FilterModel implements AbstractModel {
private Long filterId;
private String filterName;
private String filterColor;
private MemberEntity member;

public FilterModel update(FilterModel requestModel) {
filterName = requestModel.getFilterName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public FilterEntity toEntity(FilterModel source) {
//.filterId(source.getFilterId())
.filterName(source.getFilterName())
.filterColor(source.getFilterColor())
.member(source.getMember())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public FilterModel from(CreateFilterRequest source) {
//.filterId(source.getFilterId())
.filterName(source.getFilterName())
.filterColor(source.getFilterColor())
.member(source.getMember())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.example.demo.filter.persistence;

import com.example.demo.auth.persistence.MemberEntity;
import com.example.demo.auth.persistence.MemberModel;
import com.example.demo.common.persistence.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
Expand Down Expand Up @@ -27,4 +29,8 @@ public class FilterEntity extends BaseEntity {

@Column(nullable = false)
private String filterColor;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private MemberEntity member;
}

0 comments on commit 445a905

Please sign in to comment.