From a3c27b321d1f2222e5befeba1e70bb419e4e3aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B8=B8=EA=B7=BC=EC=9A=B0?= Date: Fri, 8 Mar 2024 22:56:11 +0900 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20fc?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/retum/jobis/thirdparty/fcm/FCMUtil.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/fcm/FCMUtil.java b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/fcm/FCMUtil.java index e449ea643..6c8affa66 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/fcm/FCMUtil.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/fcm/FCMUtil.java @@ -1,5 +1,6 @@ package team.retum.jobis.thirdparty.fcm; +import com.google.firebase.messaging.AndroidConfig; import com.google.firebase.messaging.ApnsConfig; import com.google.firebase.messaging.Aps; import com.google.firebase.messaging.FirebaseMessaging; @@ -23,13 +24,19 @@ public void sendMessages(Notification notification, List tokens) { .setBody(notification.getContent()) .build() ) - .putData("detail_id", notification.getDetailId().toString()) - .putData("topic", notification.getTopic().toString()) + .setAndroidConfig( + AndroidConfig.builder() + .putData("detail_id", notification.getDetailId().toString()) + .putData("topic", notification.getTopic().toString()) + .build() + ) .setApnsConfig( ApnsConfig.builder() .setAps( Aps.builder() .setSound("default") + .putCustomData("detail_id", notification.getDetailId().toString()) + .putCustomData("topic", notification.getTopic().toString()) .build() ).build() ) From 3ca41a576b0ba85e3be92e8bd008a576894a72a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=98=EC=84=B1?= Date: Sat, 9 Mar 2024 17:50:51 +0900 Subject: [PATCH 02/11] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#572)=20?= =?UTF-8?q?=EA=B8=B0=EC=97=85=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/retum/jobis/domain/company/model/Company.java | 1 + .../jobis/domain/company/persistence/mapper/CompanyMapper.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/company/model/Company.java b/jobis-application/src/main/java/team/retum/jobis/domain/company/model/Company.java index 0170489a5..3f00f7edf 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/company/model/Company.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/company/model/Company.java @@ -83,6 +83,7 @@ public static Company of(RegisterCompanyRequest request, String businessArea) { .build() ) .workersCount(request.workerNumber()) + .representativePhoneNo(request.representativePhoneNo()) .email(request.email()) .fax(request.fax()) .isMou(false) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java index 9d91c3891..cb759b236 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/company/persistence/mapper/CompanyMapper.java @@ -38,6 +38,7 @@ public CompanyEntity toEntity(Company domain) { .subManagerName(domain.getManagerInfo().subManagerName()) .subManagerPhoneNo(domain.getManagerInfo().subManagerPhoneNo()) .representative(domain.getRepresentative()) + .representativePhoneNo(domain.getRepresentativePhoneNo()) .serviceName(domain.getServiceName()) .take(domain.getTake()) .isMou(domain.isMou()) @@ -79,6 +80,7 @@ public Company toDomain(CompanyEntity entity) { .build() ) .representative(entity.getRepresentative()) + .representativePhoneNo(entity.getRepresentative()) .serviceName(entity.getServiceName()) .take(entity.getTake()) .workersCount(entity.getWorkersCount()) From 2a44a3737ee29b6cd60782cedea8e716d7fd4f8b Mon Sep 17 00:00:00 2001 From: ilyoil2 <0211ilyoil@gmail.com> Date: Sat, 9 Mar 2024 16:05:09 +0900 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#570)=20queryNoticeD?= =?UTF-8?q?etail=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response/QueryNoticeDetailResponse.java | 28 +++++++++++++++++++ .../usecase/QueryNoticeDetailUseCase.java | 25 +++++++++++++++++ .../notice/presentation/NoticeWebAdapter.java | 11 ++++++++ 3 files changed, 64 insertions(+) create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java create mode 100644 jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java new file mode 100644 index 000000000..6d930fcbd --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java @@ -0,0 +1,28 @@ +package team.retum.jobis.domain.notice.dto.response; + +import lombok.Builder; +import lombok.Getter; +import team.retum.jobis.domain.notice.model.Notice; +import team.retum.jobis.domain.notice.model.NoticeAttachment; + +import java.time.LocalDateTime; +import java.util.List; + +@Getter +@Builder +public class QueryNoticeDetailResponse { + + private final String title; + private final String content; + private final LocalDateTime createdAt; + private final List attachments; + + public static QueryNoticeDetailResponse of(Notice notice) { + return QueryNoticeDetailResponse.builder() + .title(notice.getTitle()) + .content(notice.getContent()) + .createdAt(notice.getCreatedAt()) + .attachments(notice.getAttachments()) + .build(); + } +} diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java new file mode 100644 index 000000000..b9b739f17 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java @@ -0,0 +1,25 @@ +package team.retum.jobis.domain.notice.usecase; + + +import lombok.RequiredArgsConstructor; +import team.retum.jobis.common.annotation.ReadOnlyUseCase; +import team.retum.jobis.domain.notice.dto.response.QueryNoticeDetailResponse; +import team.retum.jobis.domain.notice.exception.NoticeNotFoundException; +import team.retum.jobis.domain.notice.model.Notice; +import team.retum.jobis.domain.notice.spi.QueryNoticePort; + +@RequiredArgsConstructor +@ReadOnlyUseCase +public class QueryNoticeDetailUseCase { + + private final QueryNoticePort queryNoticePort; + + public QueryNoticeDetailResponse execute(Long noticeId) { + + Notice notice = queryNoticePort.queryNoticeById(noticeId) + .orElseThrow(() -> NoticeNotFoundException.EXCEPTION); + + return QueryNoticeDetailResponse.of(notice); + + } +} diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/presentation/NoticeWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/presentation/NoticeWebAdapter.java index 41262e47f..15b91353d 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/presentation/NoticeWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/presentation/NoticeWebAdapter.java @@ -3,6 +3,7 @@ import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -11,10 +12,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import team.retum.jobis.domain.notice.dto.response.QueryNoticeDetailResponse; import team.retum.jobis.domain.notice.presentation.dto.CreateNoticeWebRequest; import team.retum.jobis.domain.notice.presentation.dto.UpdateNoticeWebRequest; import team.retum.jobis.domain.notice.usecase.CreateNoticeUseCase; import team.retum.jobis.domain.notice.usecase.DeleteNoticeUseCase; +import team.retum.jobis.domain.notice.usecase.QueryNoticeDetailUseCase; import team.retum.jobis.domain.notice.usecase.UpdateNoticeUseCase; @RequiredArgsConstructor @@ -25,6 +28,7 @@ public class NoticeWebAdapter { private final CreateNoticeUseCase createNoticeUseCase; private final UpdateNoticeUseCase updateNoticeUseCase; private final DeleteNoticeUseCase deleteNoticeUseCase; + private final QueryNoticeDetailUseCase queryNoticeDetailsUseCase; @ResponseStatus(HttpStatus.CREATED) @PostMapping @@ -46,4 +50,11 @@ public void updateNotice( public void deleteNotice(@PathVariable("notice-id") Long noticeId) { deleteNoticeUseCase.execute(noticeId); } + + @GetMapping("/{notice-id}") + public QueryNoticeDetailResponse queryNoticeDetails( + @PathVariable("notice-id") Long noticeId + ) { + return queryNoticeDetailsUseCase.execute(noticeId); + } } From 62c79e6f36bb57248b98c0d861945905992c2c60 Mon Sep 17 00:00:00 2001 From: ilyoil2 <0211ilyoil@gmail.com> Date: Sat, 9 Mar 2024 16:06:41 +0900 Subject: [PATCH 04/11] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#570)=20security=20c?= =?UTF-8?q?onfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/retum/jobis/global/security/SecurityConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java b/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java index b2bb55e56..e1318b1b1 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java @@ -149,6 +149,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .requestMatchers(HttpMethod.POST, "/notices").hasAuthority(TEACHER.name()) .requestMatchers(HttpMethod.PATCH, "/notices/{notice-id}").hasAuthority(TEACHER.name()) .requestMatchers(HttpMethod.DELETE, "/notices/{notice-id}").hasAuthority(TEACHER.name()) + .requestMatchers(HttpMethod.DELETE, "/notices/{notice-id}").permitAll() // notification .requestMatchers(HttpMethod.GET, "/notifications").authenticated() From 34a7885593e9e8b6ff4f26c3c14e3a34d44c34da Mon Sep 17 00:00:00 2001 From: ilyoil2 <0211ilyoil@gmail.com> Date: Sat, 9 Mar 2024 17:09:54 +0900 Subject: [PATCH 05/11] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20::=20(#570)=20?= =?UTF-8?q?=EC=BD=94=EB=A9=98=ED=8A=B8=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/notice/dto/response/QueryNoticeDetailResponse.java | 2 +- .../jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java index 6d930fcbd..9349a299a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/QueryNoticeDetailResponse.java @@ -17,7 +17,7 @@ public class QueryNoticeDetailResponse { private final LocalDateTime createdAt; private final List attachments; - public static QueryNoticeDetailResponse of(Notice notice) { + public static QueryNoticeDetailResponse from(Notice notice) { return QueryNoticeDetailResponse.builder() .title(notice.getTitle()) .content(notice.getContent()) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java index b9b739f17..dac984ee8 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java @@ -13,13 +13,12 @@ public class QueryNoticeDetailUseCase { private final QueryNoticePort queryNoticePort; - public QueryNoticeDetailResponse execute(Long noticeId) { Notice notice = queryNoticePort.queryNoticeById(noticeId) .orElseThrow(() -> NoticeNotFoundException.EXCEPTION); - return QueryNoticeDetailResponse.of(notice); + return QueryNoticeDetailResponse.from(notice); } } From fcca5d2fa170afd8033364d18fc79a8a24fe2bf0 Mon Sep 17 00:00:00 2001 From: ilyoil2 <0211ilyoil@gmail.com> Date: Sun, 10 Mar 2024 14:29:38 +0900 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20::=20(#570)=20nam?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jobis/domain/notice/dto/response/AttachmentResponse.java | 2 +- .../retum/jobis/domain/notice/model/NoticeAttachment.java | 2 +- .../jobis/domain/notice/persistence/mapper/NoticeMapper.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/AttachmentResponse.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/AttachmentResponse.java index 1c54884a1..d53ecf5e4 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/AttachmentResponse.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/dto/response/AttachmentResponse.java @@ -17,7 +17,7 @@ public class AttachmentResponse { public static AttachmentResponse of(NoticeAttachment noticeAttachment) { return new AttachmentResponse( - noticeAttachment.getAttachmentUrl(), + noticeAttachment.getUrl(), noticeAttachment.getType() ); } diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/notice/model/NoticeAttachment.java b/jobis-application/src/main/java/team/retum/jobis/domain/notice/model/NoticeAttachment.java index f226fddb2..8ec9a739a 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/notice/model/NoticeAttachment.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/model/NoticeAttachment.java @@ -7,7 +7,7 @@ @AllArgsConstructor public class NoticeAttachment { - private final String attachmentUrl; + private final String url; private final AttachmentType type; diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/persistence/mapper/NoticeMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/persistence/mapper/NoticeMapper.java index 7790c2644..776fa7060 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/persistence/mapper/NoticeMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/notice/persistence/mapper/NoticeMapper.java @@ -23,7 +23,7 @@ public NoticeEntity toEntity(Notice domain) { .orElseThrow(() -> NotificationNotFoundException.EXCEPTION); List attachments = domain.getAttachments().stream() - .map(attachment -> new NoticeAttachmentEntity(attachment.getAttachmentUrl(), attachment.getType())) + .map(attachment -> new NoticeAttachmentEntity(attachment.getUrl(), attachment.getType())) .toList(); return NoticeEntity.builder() @@ -50,4 +50,4 @@ public Notice toDomain(NoticeEntity entity) { .attachments(attachments) .build(); } -} \ No newline at end of file +} From 77da26f7199ca63e3726058cce0f75aac94e833a Mon Sep 17 00:00:00 2001 From: ilyoil2 <0211ilyoil@gmail.com> Date: Sun, 10 Mar 2024 14:30:18 +0900 Subject: [PATCH 07/11] =?UTF-8?q?=F0=9F=A6=B7=20::=20(#570)=20security=20c?= =?UTF-8?q?onfig=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/team/retum/jobis/global/security/SecurityConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java b/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java index e1318b1b1..3081235d2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/global/security/SecurityConfig.java @@ -149,7 +149,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .requestMatchers(HttpMethod.POST, "/notices").hasAuthority(TEACHER.name()) .requestMatchers(HttpMethod.PATCH, "/notices/{notice-id}").hasAuthority(TEACHER.name()) .requestMatchers(HttpMethod.DELETE, "/notices/{notice-id}").hasAuthority(TEACHER.name()) - .requestMatchers(HttpMethod.DELETE, "/notices/{notice-id}").permitAll() + .requestMatchers(HttpMethod.GET, "/notices/{notice-id}").permitAll() // notification .requestMatchers(HttpMethod.GET, "/notifications").authenticated() From 56469496676c90d3ea64d7c38c7c75f6d8e67870 Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Sun, 10 Mar 2024 19:33:56 +0900 Subject: [PATCH 08/11] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#574)=20null?= =?UTF-8?q?=20=EA=B2=80=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BugAttachmentEntity.java | 2 -- .../persistence/mapper/BugReportMapper.java | 23 ++++++++++++------- .../webhook/slack/SlackAdapter.java | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/entity/BugAttachmentEntity.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/entity/BugAttachmentEntity.java index 4cb0dd2fd..be27964a2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/entity/BugAttachmentEntity.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/entity/BugAttachmentEntity.java @@ -2,7 +2,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Embeddable; -import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; @@ -14,7 +13,6 @@ @Embeddable public class BugAttachmentEntity { - @NotNull @Column(columnDefinition = "VARCHAR(300)") private String attachmentUrl; } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java index a95ab8fc0..f2b133270 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java @@ -22,9 +22,12 @@ public BugReportEntity toEntity(BugReport domain) { StudentEntity student = studentJpaRepository.findById(domain.getStudentId()) .orElseThrow(() -> StudentNotFoundException.EXCEPTION); - List bugAttachments = domain.getAttachment().attachmentUrls().stream() - .map(BugAttachmentEntity::new) - .toList(); + List bugAttachments = null; + if (domain.getAttachment().attachmentUrls() != null) { + bugAttachments = domain.getAttachment().attachmentUrls().stream() + .map(BugAttachmentEntity::new) + .toList(); + } return BugReportEntity.builder() .id(domain.getId()) @@ -37,11 +40,15 @@ public BugReportEntity toEntity(BugReport domain) { } public BugReport toDomain(BugReportEntity entity) { - BugAttachment bugAttachment = new BugAttachment( - entity.getAttachments().stream() - .map(BugAttachmentEntity::getAttachmentUrl) - .toList() - ); + BugAttachment bugAttachment = null; + + if (entity.getAttachments() != null) { + bugAttachment = new BugAttachment( + entity.getAttachments().stream() + .map(BugAttachmentEntity::getAttachmentUrl) + .toList() + ); + } return BugReport.builder() .id(entity.getId()) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java index 944bf8caa..0e911e822 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java @@ -57,7 +57,7 @@ public void sendExceptionInfo(HttpServletRequest request, Exception exception) { private List createBugReportSlackAttachments(BugReport bugReport, String writer) { BugAttachment bugAttachment = bugReport.getAttachment(); - if (bugAttachment.attachmentUrls().isEmpty()) { + if (bugAttachment == null || bugAttachment.attachmentUrls().isEmpty()) { return Collections.singletonList( createBugReportSlackAttachment(bugReport, writer, null, true) ); From 55a480e842bc5b52d5d5707bc639955b41db879c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B8=B8=EA=B7=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 20:39:38 +0900 Subject: [PATCH 09/11] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20::=20(#develop)=20co?= =?UTF-8?q?mpanyLogoUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/persistence/ApplicationPersistenceAdapter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index 9d2e274d1..a5641218e 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -87,6 +87,7 @@ public List queryApplicationByConditions(ApplicationFilter applic .grade(application.getGrade()) .number(application.getNumber()) .classNumber(application.getClassNumber()) + .companyLogoUrl(application.getCompanyLogoUrl()) .profileImageUrl(application.getProfileImageUrl()) .companyName(application.getCompanyName()) .createdAt(application.getCreatedAt()) From 586d2bdedde1eb2752d3ac44037dfcc8ce2674d0 Mon Sep 17 00:00:00 2001 From: Kangmin Date: Sun, 10 Mar 2024 22:46:23 +0900 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#574)=20default=20em?= =?UTF-8?q?pty=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../persistence/mapper/BugReportMapper.java | 23 +++++++------------ .../request/CreateBugReportWebRequest.java | 7 ++++++ .../webhook/slack/SlackAdapter.java | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java index f2b133270..a95ab8fc0 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/persistence/mapper/BugReportMapper.java @@ -22,12 +22,9 @@ public BugReportEntity toEntity(BugReport domain) { StudentEntity student = studentJpaRepository.findById(domain.getStudentId()) .orElseThrow(() -> StudentNotFoundException.EXCEPTION); - List bugAttachments = null; - if (domain.getAttachment().attachmentUrls() != null) { - bugAttachments = domain.getAttachment().attachmentUrls().stream() - .map(BugAttachmentEntity::new) - .toList(); - } + List bugAttachments = domain.getAttachment().attachmentUrls().stream() + .map(BugAttachmentEntity::new) + .toList(); return BugReportEntity.builder() .id(domain.getId()) @@ -40,15 +37,11 @@ public BugReportEntity toEntity(BugReport domain) { } public BugReport toDomain(BugReportEntity entity) { - BugAttachment bugAttachment = null; - - if (entity.getAttachments() != null) { - bugAttachment = new BugAttachment( - entity.getAttachments().stream() - .map(BugAttachmentEntity::getAttachmentUrl) - .toList() - ); - } + BugAttachment bugAttachment = new BugAttachment( + entity.getAttachments().stream() + .map(BugAttachmentEntity::getAttachmentUrl) + .toList() + ); return BugReport.builder() .id(entity.getId()) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java index d54623666..d0a33f9ac 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java @@ -8,7 +8,9 @@ import team.retum.jobis.domain.bug.dto.request.CreateBugReportRequest; import team.retum.jobis.domain.bug.model.DevelopmentArea; +import java.util.Collections; import java.util.List; +import java.util.Objects; @Getter @NoArgsConstructor @@ -28,6 +30,7 @@ public class CreateBugReportWebRequest { private List attachmentUrls; public CreateBugReportRequest toDomainRequest() { + setAttachmentUrls(attachmentUrls); return CreateBugReportRequest.builder() .title(this.title) .content(this.content) @@ -35,4 +38,8 @@ public CreateBugReportRequest toDomainRequest() { .attachmentUrls(this.attachmentUrls) .build(); } + + private void setAttachmentUrls(List attachmentUrls) { + this.attachmentUrls = Objects.requireNonNullElse(attachmentUrls, Collections.emptyList()); + } } diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java index 0e911e822..944bf8caa 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/thirdparty/webhook/slack/SlackAdapter.java @@ -57,7 +57,7 @@ public void sendExceptionInfo(HttpServletRequest request, Exception exception) { private List createBugReportSlackAttachments(BugReport bugReport, String writer) { BugAttachment bugAttachment = bugReport.getAttachment(); - if (bugAttachment == null || bugAttachment.attachmentUrls().isEmpty()) { + if (bugAttachment.attachmentUrls().isEmpty()) { return Collections.singletonList( createBugReportSlackAttachment(bugReport, writer, null, true) ); From 233bfcec0217c164a1440ee396c045f534864cdf Mon Sep 17 00:00:00 2001 From: alsdl0629 Date: Mon, 11 Mar 2024 08:39:38 +0900 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=A7=A9=20::=20(#574)=20default=20em?= =?UTF-8?q?pty=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/request/CreateBugReportWebRequest.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java index d0a33f9ac..556bf5a5c 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java @@ -30,16 +30,11 @@ public class CreateBugReportWebRequest { private List attachmentUrls; public CreateBugReportRequest toDomainRequest() { - setAttachmentUrls(attachmentUrls); return CreateBugReportRequest.builder() .title(this.title) .content(this.content) .developmentArea(this.developmentArea) - .attachmentUrls(this.attachmentUrls) + .attachmentUrls(Objects.requireNonNullElse(attachmentUrls, Collections.emptyList())) .build(); } - - private void setAttachmentUrls(List attachmentUrls) { - this.attachmentUrls = Objects.requireNonNullElse(attachmentUrls, Collections.emptyList()); - } }