Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package com.kustacks.kuring.message.application.port.out.dto;

import com.kustacks.kuring.notice.domain.*;
import lombok.*;
import com.kustacks.kuring.notice.domain.DepartmentNotice;
import com.kustacks.kuring.notice.domain.Notice;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.util.Assert;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class NoticeMessageDto {

private Long id;
private String id;

private String type;

Expand All @@ -25,7 +29,7 @@ public class NoticeMessageDto {
private String baseUrl;

@Builder
private NoticeMessageDto(Long id, String articleId, String postedDate, String subject, String category, String categoryKorName, String baseUrl) {
private NoticeMessageDto(String id, String articleId, String postedDate, String subject, String category, String categoryKorName, String baseUrl) {
Assert.notNull(id, "id must not be empty");
Assert.notNull(articleId, "articleId must not be null");
Assert.notNull(postedDate, "postedDate must not be null");
Expand All @@ -46,7 +50,7 @@ private NoticeMessageDto(Long id, String articleId, String postedDate, String su

public static NoticeMessageDto from(Notice notice) {
return NoticeMessageDto.builder()
.id(notice.getId())
.id(String.valueOf(notice.getId()))
.articleId(notice.getArticleId())
.postedDate(notice.getPostedDate())
.subject(notice.getSubject())
Expand All @@ -58,7 +62,7 @@ public static NoticeMessageDto from(Notice notice) {

public static NoticeMessageDto from(DepartmentNotice departmentNotice) {
return NoticeMessageDto.builder()
.id(departmentNotice.getId())
.id(String.valueOf(departmentNotice.getId()))
.articleId(departmentNotice.getArticleId())
.postedDate(departmentNotice.getPostedDate())
.subject(departmentNotice.getSubject())
Expand Down
Loading