Skip to content

Commit a61a926

Browse files
committed
fix main page project list : dto add List<ProjectStatus> column
1 parent 167e247 commit a61a926

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/main/java/NextLevel/demo/project/project/dto/request/RequestMainPageProjectListDto.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package NextLevel.demo.project.project.dto.request;
22

33
import java.util.List;
4+
5+
import NextLevel.demo.project.ProjectStatus;
46
import lombok.AllArgsConstructor;
57
import lombok.Builder;
68
import lombok.Getter;
@@ -23,6 +25,8 @@ public class RequestMainPageProjectListDto {
2325
private Integer page = 0;
2426
private Long pageCount = 8L; // default 8
2527

28+
private List<ProjectStatus> status;
29+
2630
public List<Long> getTagIds() {
2731
return tag;
2832
}

src/main/java/NextLevel/demo/project/project/repository/ProjectDslRepository.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ public ResponseProjectListDto selectProjectDsl(RequestMainPageProjectListDto dto
3838
builder.where(null, (entity) -> projectTagEntity.tag.id.in(dto.getTagIds()));
3939
}
4040

41-
builder.where(QProjectEntity.class, (projectEntity) -> projectEntity.projectStatus.in(ProjectStatus.PROGRESS, ProjectStatus.STOPPED));
41+
builder.where(QProjectEntity.class, (projectEntity) ->
42+
{
43+
if(dto.getStatus() == null || dto.getStatus().isEmpty())
44+
return projectEntity.projectStatus.in(ProjectStatus.PROGRESS, ProjectStatus.STOPPED);
45+
else
46+
return projectEntity.projectStatus.in(dto.getStatus());
47+
}
48+
);
4249

4350
orderByType(builder, ProjectOrderType.getType(dto.getOrder()), dto.getDesc());
4451

0 commit comments

Comments
 (0)