Skip to content

Commit

Permalink
πŸ”— :: (#444) μ½”λ“œ μ‚¬μš©μ—¬λΆ€ μΆ”κ°€
Browse files Browse the repository at this point in the history
πŸ”— :: (#444) μ½”λ“œ μ‚¬μš©μ—¬λΆ€ μΆ”κ°€
  • Loading branch information
geunoo authored Nov 15, 2023
2 parents 4eaa116 + e243cc4 commit 89dc010
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ public class Code {
private final String keyword;

private final Long parentCodeId;

private final boolean isUsed;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import lombok.RequiredArgsConstructor;
import team.retum.jobis.common.annotation.Service;
import team.retum.jobis.domain.code.model.RecruitAreaCode;
import team.retum.jobis.domain.code.spi.QueryCodePort;
import team.retum.jobis.domain.recruitment.dto.request.CreateRecruitAreaRequest;
import team.retum.jobis.domain.recruitment.model.RecruitArea;
import team.retum.jobis.domain.recruitment.spi.CommandRecruitmentPort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public List<Code> queryCodesByKeywordAndType(String keyword, CodeType codeType,
.selectFrom(codeEntity)
.where(
codeEntity.codeType.eq(codeType),
codeEntity.isUsed.eq(true),
containsKeyword(keyword),
eqParentCode(parentCode)
).fetch().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ public class CodeEntity {
@JoinColumn(name = "parent_code_id")
private CodeEntity parentCode;

@NotNull
@Column(columnDefinition = "BIT(1)")
private boolean isUsed;

@Builder
public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity) {
public CodeEntity(Long id, CodeType codeType, JobType jobType, String keyword, CodeEntity parentCodeEntity, boolean isUsed) {
this.id = id;
this.codeType = codeType;
this.jobType = jobType;
this.keyword = keyword;
this.parentCode = parentCodeEntity;
this.isUsed = isUsed;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public CodeEntity toEntity(Code domain) {
.keyword(domain.getKeyword())
.jobType(domain.getJobType())
.parentCodeEntity(code)
.isUsed(domain.isUsed())
.build();
}

Expand All @@ -34,6 +35,7 @@ public Code toDomain(CodeEntity entity) {
.jobType(entity.getJobType())
.keyword(entity.getKeyword())
.parentCodeId(entity.getParentCode() == null ? null : entity.getParentCode().getId())
.isUsed(entity.isUsed())
.build();
}
}

0 comments on commit 89dc010

Please sign in to comment.