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-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/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..9349a299a --- /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 from(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/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-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..dac984ee8 --- /dev/null +++ b/jobis-application/src/main/java/team/retum/jobis/domain/notice/usecase/QueryNoticeDetailUseCase.java @@ -0,0 +1,24 @@ +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.from(notice); + + } +} 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()) 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/presentation/dto/request/CreateBugReportWebRequest.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/bug/presentation/dto/request/CreateBugReportWebRequest.java index d54623666..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 @@ -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 @@ -32,7 +34,7 @@ public CreateBugReportRequest toDomainRequest() { .title(this.title) .content(this.content) .developmentArea(this.developmentArea) - .attachmentUrls(this.attachmentUrls) + .attachmentUrls(Objects.requireNonNullElse(attachmentUrls, Collections.emptyList())) .build(); } } 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()) 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 +} 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); + } } 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..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,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.GET, "/notices/{notice-id}").permitAll() // notification .requestMatchers(HttpMethod.GET, "/notifications").authenticated() 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() )