diff --git a/src/docs/asciidoc/message.adoc b/src/docs/asciidoc/message.adoc index 31b50bef..60115de0 100644 --- a/src/docs/asciidoc/message.adoc +++ b/src/docs/asciidoc/message.adoc @@ -42,4 +42,26 @@ include::{snippets}/message-controller-test/마이스터전형과_마이스터 include::{snippets}/message-controller-test/마이스터전형에서_일반전형으로_바뀐_1차_합격자들에게_메시지를_보낸다/http-request.adoc[] ===== 마이스터전형 1차 합격자들에게 메시지를 보내는 경우 -include::{snippets}/message-controller-test/마이스터_전형_1차_합격자들에게_메시지를_보낸다/http-request.adoc[]https://xxx[] \ No newline at end of file +include::{snippets}/message-controller-test/마이스터_전형_1차_합격자들에게_메시지를_보낸다/http-request.adoc[]https://xxx[] + +=== 어드민을 제외한 모든 유저에게 메시지 보내기 +어드민을 제외한 모든 유저에게 메시지를 보낼 수 있습니다. + +==== 요청 형식 + +===== Request Header +include::{snippets}/message-controller-test/어드민을_제외한_전체_유저에게_메시지를_발송한다/request-headers.adoc[] + +===== Request Body +include::{snippets}/message-controller-test/어드민을_제외한_전체_유저에게_메시지를_발송한다/request-fields.adoc[] + +==== 요청 +include::{snippets}/message-controller-test/어드민을_제외한_전체_유저에게_메시지를_발송한다/http-request.adoc[] + +==== 응답 + +===== 정상 응답 +include::{snippets}/message-controller-test/어드민을_제외한_전체_유저에게_메시지를_발송한다/http-response.adoc[] + +===== 어드민을 제외한 유저가 아무도 없는 경우 +include::{snippets}/message-controller-test/어드민을_제외한_유저가_아무도_없으면_오류가_발생한다/http-response.adoc[] \ No newline at end of file diff --git a/src/main/java/com/bamdoliro/maru/application/message/SendMessageUseCase.java b/src/main/java/com/bamdoliro/maru/application/message/SendMessageUseCase.java index ef1db040..7e6f50a3 100644 --- a/src/main/java/com/bamdoliro/maru/application/message/SendMessageUseCase.java +++ b/src/main/java/com/bamdoliro/maru/application/message/SendMessageUseCase.java @@ -2,10 +2,14 @@ import com.bamdoliro.maru.domain.form.domain.Form; import com.bamdoliro.maru.domain.form.domain.type.FormType; +import com.bamdoliro.maru.domain.user.domain.User; +import com.bamdoliro.maru.domain.user.domain.type.Authority; import com.bamdoliro.maru.infrastructure.message.SendMessageService; import com.bamdoliro.maru.infrastructure.persistence.form.FormRepository; +import com.bamdoliro.maru.infrastructure.persistence.user.UserRepository; import com.bamdoliro.maru.presentation.message.dto.request.SendMessageByStatusRequest; import com.bamdoliro.maru.presentation.message.dto.request.SendMessageByTypeRequest; +import com.bamdoliro.maru.presentation.message.dto.request.SendMessageToAllUserRequest; import com.bamdoliro.maru.shared.annotation.UseCase; import lombok.RequiredArgsConstructor; @@ -17,6 +21,7 @@ public class SendMessageUseCase { private final FormRepository formRepository; private final SendMessageService sendMessageService; + private final UserRepository userRepository; public void execute(SendMessageByStatusRequest request) { List