Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
L-U-Ready committed Nov 28, 2024
2 parents 8853c13 + f9e9db9 commit fcc2548
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ArticleGoogleDto {
private String publisherName;
private String publishDate;
private String reporterName;
private boolean scrapped;

@Builder
public ArticleGoogleDto(Long articleId,
Expand All @@ -27,7 +28,9 @@ public ArticleGoogleDto(Long articleId,
String imageUrl,
String publisherName,
String publishDate,
String reporterName) {
String reporterName,
boolean scrapped) {

this.articleId = articleId;
this.title = title;
this.body = body;
Expand All @@ -36,6 +39,7 @@ public ArticleGoogleDto(Long articleId,
this.publisherName = publisherName;
this.publishDate = publishDate;
this.reporterName = reporterName;
this.scrapped = scrapped;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
@NoArgsConstructor
public class ReportArticleUpdateOptionsRequest {

@JsonProperty("isMedia")
private boolean isMedia;
@JsonProperty("isReporter")
private boolean isReporter;
private boolean media;
private boolean reporter;

@Builder
public ReportArticleUpdateOptionsRequest(boolean isMedia,
boolean isReporter) {
this.isMedia = isMedia;
this.isReporter = isReporter;
public ReportArticleUpdateOptionsRequest(boolean media,
boolean reporter) {
this.media = media;
this.reporter = reporter;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ public class ReportCreateRequest {

private String reportTitle;
private String color;

@JsonProperty("isMedia")
private boolean isMedia;

@JsonProperty("isReporter")
private boolean isReporter;
private boolean media;
private boolean reporter;

@JsonProperty("articles")
private ReportCategoryTypeRequest reportCategoryTypeRequest;
Expand All @@ -31,14 +27,14 @@ public class ReportCreateRequest {
public ReportCreateRequest(String reportTitle,
String color,
ReportCategoryTypeRequest reportCategoryTypeRequest,
boolean isMedia,
boolean isReporter) {
boolean media,
boolean reporter) {

this.reportTitle = reportTitle;
this.color = color;
this.reportCategoryTypeRequest = reportCategoryTypeRequest;
this.isMedia = isMedia;
this.isReporter = isReporter;
this.media = media;
this.reporter = reporter;

}

Expand All @@ -48,8 +44,8 @@ public Report toEntity(Client client, String logoUrl) {
.title(reportTitle)
.color(color)
.logo(logoUrl)
.isMedia(isMedia)
.isReporter(isReporter)
.media(media)
.reporter(reporter)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
@NoArgsConstructor
public class ReportOptionsResponse {

@JsonProperty("isMedia")
private boolean isMedia;
@JsonProperty("isReporter")
private boolean isReporter;
private boolean media;
private boolean reporter;

@Builder
public ReportOptionsResponse(boolean isMedia,
boolean isReporter) {
public ReportOptionsResponse(boolean media,
boolean reporter) {

this.isMedia = isMedia;
this.isReporter = isReporter;
this.media = media;
this.reporter = reporter;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private void saveArticlesFromGoogle(Keyword keyword) {

}

// 클라이언트가 선택한 카테고리의 기사들을 조회
@Override
public PageResponse<ArticleResponse> getArticlesByClientAndCategoryType(CategoryType categoryType, int page) {

Expand All @@ -93,7 +94,7 @@ public PageResponse<ArticleResponse> getArticlesByClientAndCategoryType(Category

}


// 클라이언트가 선택한 키워드의 기사들을 조회
@Override
public PageResponse<ArticleResponse> getArticlesByKeyword(CategoryType categoryType, Long keywordId, int page) {

Expand Down Expand Up @@ -124,6 +125,7 @@ private PageResponse<ArticleResponse> getArticleResponsePageResponse(Page<Articl
.publisherName(article.getPublisherName())
.publishDate(article.getPublishDate())
.reporterName(article.getReporterName())
.scrapped(article.isScrapped())
.build())
.toList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ public ReportOptionsResponse getReportOptions(Long reportId) {
validIsAccountAuthorizedForReport(getAccountFromId(getAccountId()), report);

return ReportOptionsResponse.builder()
.isMedia(report.isMedia())
.isReporter(report.isReporter())
.media(report.isMedia())
.reporter(report.isReporter())
.build();

}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/the_monitor/domain/model/Article.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Article extends BaseTimeEntity {
private boolean isAdded = false;

@Column(name = "article_is_scraped", nullable = false)
private boolean isScraped = false;
private boolean isScrapped = false;

@ManyToOne
@JoinColumn(name = "keyword_id")
Expand All @@ -61,7 +61,7 @@ public Article(String title,
String reporterName,
boolean isRead,
boolean isAdded,
boolean isScraped,
boolean isScrapped,
Keyword keyword) {

this.title = title;
Expand All @@ -73,11 +73,11 @@ public Article(String title,
this.reporterName = reporterName;
this.isRead = isRead;
this.isAdded = isAdded;
this.isScraped = isScraped;
this.isScrapped = isScrapped;
this.keyword = keyword;

}
public void setScrapStatus(boolean isScraped) {
this.isScraped = isScraped;
this.isScrapped = isScraped;
}
}
18 changes: 9 additions & 9 deletions src/main/java/the_monitor/domain/model/Report.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public class Report extends BaseTimeEntity {
private String color;

@Column(name = "report_is_media", nullable = false)
private boolean isMedia;
private boolean media;

@Column(name = "report_is_reporter", nullable = false)
private boolean isReporter;
private boolean reporter;

@ManyToOne
@JoinColumn(name = "client_id", nullable = false)
Expand All @@ -49,16 +49,16 @@ public Report(String title,
String logo,
String color,
List<ReportCategory> reportCategories,
boolean isMedia,
boolean isReporter) {
boolean media,
boolean reporter) {

this.title = title;
this.client = client;
this.logo = logo;
this.color = color;
this.reportCategories = reportCategories;
this.isMedia = isMedia;
this.isReporter = isReporter;
this.media = media;
this.reporter = reporter;

}

Expand All @@ -74,9 +74,9 @@ public void updateColor(String color) {
this.color = color;
}

public void updateReportOptions(boolean isMedia, boolean isReporter) {
this.isMedia = isMedia;
this.isReporter = isReporter;
public void updateReportOptions(boolean media, boolean reporter) {
this.media = media;
this.reporter = reporter;
}

public void addReportCategories(List<ReportCategory> reportCategories) {
Expand Down

0 comments on commit fcc2548

Please sign in to comment.