Skip to content

Commit

Permalink
feat : Pagination 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
programmerDH-github committed Jul 25, 2023
1 parent 2964f02 commit 5a8bbf1
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 190 deletions.
14 changes: 2 additions & 12 deletions src/main/java/com/bside/BSIDE/contents/domain/AnswerDto.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
package com.bside.BSIDE.contents.domain;

import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class AnswerDto {
@Schema(hidden = true)
private int aNo;
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/bside/BSIDE/contents/domain/CategoryDto.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class CategoryDto {
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private int categoryId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class CountAnsweredQuestionsByMonthDto {
@Schema(description = "이메일", example = "[email protected]")
private String email;
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/bside/BSIDE/contents/domain/PagedResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.bside.BSIDE.contents.domain;

import java.util.List;

import lombok.Data;

@Data
public class PagedResponse<T> {
private List<T> content;
private int page;
private int size;
private long totalElements;

public PagedResponse(List<T> content, int page, int size, long totalElements) {
this.content = content;
this.page = page;
this.size = size;
this.totalElements = totalElements;
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class QuestionAndAnswerDto {

@Schema(description = "질문 내용", example = "가장 좋아하는 계절은?")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class QuestionCountDto {
@Schema(description = "질문 개수", example = "4")
private int count;
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/bside/BSIDE/contents/domain/QuestionDto.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class QuestionDto {
@Schema(accessMode = Schema.AccessMode.READ_ONLY)
private int qNo;
Expand Down
12 changes: 2 additions & 10 deletions src/main/java/com/bside/BSIDE/contents/domain/UserCategoryDto.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
package com.bside.BSIDE.contents.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.Data;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class UserCategoryDto {
@Schema(description = "유저 이메일", example = "[email protected]")
private String email;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.domain.Page;

import com.bside.BSIDE.contents.domain.CountAnsweredQuestionsByMonthDto;
import com.bside.BSIDE.contents.domain.QuestionAndAnswerDto;
Expand Down
Loading

0 comments on commit 5a8bbf1

Please sign in to comment.