Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAC-397 feat : 알림톡 추가 작업 #285

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ dependencies {
// https://mvnrepository.com/artifact/org.redisson/redisson-spring-boot-starter
implementation 'org.redisson:redisson-spring-boot-starter:3.18.0'

implementation 'com.github.ywj9811:QueryDslItemReader:v1.0.0'
implementation 'com.github.ywj9811:querydsl-itemreader:v1.0.1'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.postgraduate.domain.mentoring.domain.entity.Mentoring;
import com.querydslitemreader.core.pagingitemreader.expression.Expression;
import com.querydslitemreader.core.pagingitemreader.options.QueryDslNoOffsetNumberOptions;
import com.querydslitemreader.core.pagingitemreader.options.QueryDslNoOffsetPagingItemReader;
import com.querydslitemreader.core.pagingitemreader.QueryDslNoOffsetPagingItemReader;
import jakarta.persistence.EntityManagerFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.postgraduate.domain.mentoring.domain.entity.constant.Status;
import com.querydslitemreader.core.pagingitemreader.expression.Expression;
import com.querydslitemreader.core.pagingitemreader.options.QueryDslNoOffsetNumberOptions;
import com.querydslitemreader.core.pagingitemreader.options.QueryDslNoOffsetPagingItemReader;
import com.querydslitemreader.core.pagingitemreader.QueryDslNoOffsetPagingItemReader;
import jakarta.persistence.EntityManagerFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ public ApplyingResponse applyMentoring(User user, MentoringApplyRequest request)
@Transactional
public void updateCancel(User user, Long mentoringId) {
Mentoring mentoring = mentoringGetService.byIdAndUserAndWaiting(mentoringId, user);
Senior senior = mentoring.getSenior();
Payment payment = mentoring.getPayment();
paymentManageUseCase.refundPayByUser(user, payment.getOrderId());
mentoringUpdateService.updateCancel(mentoring);
bizppurioSeniorMessage.mentoringRefund(senior.getUser());
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.postgraduate.global.bizppurio.application.dto.req.content;

import com.postgraduate.global.bizppurio.application.dto.req.content.button.WebLinkButton;

public record SeniorSingUpMessage(
public record ButtonMessage(
String message,
String senderkey,
String templatecode,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.postgraduate.global.bizppurio.application.dto.req.content;

public record JuniorMatchingWaitingMessage(
public record TextMessage(
String message,
String senderkey,
String templatecode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.postgraduate.global.bizppurio.application.dto.req.content.button;
package com.postgraduate.global.bizppurio.application.dto.req.content;

public record WebLinkButton(
String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.postgraduate.global.bizppurio.application.dto.req.JuniorMatchingFailRequest;
import com.postgraduate.global.bizppurio.application.dto.req.JuniorMatchingSuccessRequest;
import com.postgraduate.global.bizppurio.application.dto.req.content.*;
import com.postgraduate.global.bizppurio.application.dto.req.content.button.WebLinkButton;
import com.postgraduate.global.bizppurio.application.dto.req.content.WebLinkButton;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand All @@ -30,6 +30,8 @@ public class BizppurioMapper {
private String certificationDenied;
@Value("${bizppurio.template.junior_mentoring_refuse}")
private String juniorMentoringRefuse;
@Value("${bizppurio.template.senior_mentoring_refund}")
private String seniorMentoringRefund;
@Value("${bizppurio.template.senior_mentoring_accept}")
private String seniorMentoringAccept;
@Value("${bizppurio.template.junior_mentoring_accept}")
Expand Down Expand Up @@ -73,7 +75,7 @@ public CommonRequest mapToSeniorSignUpMessage(User user) {
WebLinkButton certification = new WebLinkButton("대학원 인증하기", type, certificationPage, certificationPage);
WebLinkButton profile = new WebLinkButton("프로필 작성하기", "WL", profilePage, profilePage);
WebLinkButton[] buttons = {certification, profile};
Message messageBody = new SeniorSingUpMessage(message, senderKey, seniorSignUp, buttons);
Message messageBody = new ButtonMessage(message, senderKey, seniorSignUp, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -86,7 +88,7 @@ public CommonRequest mapToSeniorApplyMessage(User user) {

WebLinkButton mentoringCheck = new WebLinkButton("멘토링 신청 확인하기", type, seniorMentoringPage, seniorMentoringPage);
WebLinkButton[] buttons = {mentoringCheck};
Message messageBody = new SeniorApplyMessage(message, senderKey, seniorMentoringApply, buttons);
Message messageBody = new ButtonMessage(message, senderKey, seniorMentoringApply, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -99,7 +101,7 @@ public CommonRequest mapToSeniorAcceptMessage(User user, String link, String tim
"\n" +
"멘토링 진행 일시에 선배님께서 줌 또는 구글미트를 활용하여 비대면 대화 링크를 열어주시면 됩니다!"
);
Message messageBody = new SeniorAcceptMessage(message, senderKey, seniorMentoringAccept);
Message messageBody = new TextMessage(message, senderKey, seniorMentoringAccept);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -111,7 +113,7 @@ public CommonRequest mapToCertificationApprove(User user) {
);
WebLinkButton profile = new WebLinkButton("프로필 완성하기", type, profilePage, profilePage);
WebLinkButton[] buttons = {profile};
CertificationApproveMessage messageBody = new CertificationApproveMessage(message, senderKey, certificationApprove, buttons);
Message messageBody = new ButtonMessage(message, senderKey, certificationApprove, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -125,7 +127,7 @@ public CommonRequest mapToCertificationDenied(User user) {
);
WebLinkButton certification = new WebLinkButton("대학원 재인증하기", type, certificationPage, certificationPage);
WebLinkButton[] buttons = {certification};
CertificationDeniedMessage messageBody = new CertificationDeniedMessage(message, senderKey, certificationDenied, buttons);
Message messageBody = new ButtonMessage(message, senderKey, certificationDenied, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -139,7 +141,22 @@ public CommonRequest mapToSeniorFinish(User user) {
"\n" +
"멘토링 확정은 멘토링이 정상적으로 진행되었는지 확인하기 위함이며, 멘토링 완료 확정이 진행되지 않을시 정산이 지연될 수 있는점 양해 부탁드려요!\uD83D\uDE03"
);
SeniorFinishMessage messageBody = new SeniorFinishMessage(message, senderKey, seniorMentoringFinish);
Message messageBody = new TextMessage(message, senderKey, seniorMentoringFinish);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

public CommonRequest mapToSeniorRefundMessage(User user) {
String message = (
"안녕하세요, " + user.getNickName() + "님!\n" +
"대학원 김선배입니다 \uD83D\uDE42\n" +
"\n" +
"다름이 아니라 신청한 후배님께서 멘토링을 환불하셔서 알려드려요 !\n" +
"\n" +
"후배가 환불할 경우, 멘토링은 자동으로 취소되며 다음 멘토링 재매칭을 위해 최선을 다하겠습니다 \uD83D\uDE42\n" +
"\n" +
"항상 저희 대학원 김선배를 찾아주셔서 감사드려요"
);
Message messageBody = new TextMessage(message, senderKey, seniorMentoringRefund);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -151,7 +168,7 @@ public CommonRequest mapToJuniorApplyMessage(User user) {
"\n" +
"선배님이 다음날 오후 11시 59분까지 멘토링을 수락해주시지 않으면 멘토링이 자동 취소 및 환불되니 유의해주세요! \uD83D\uDE42"
);
JuniorApplyMessage messageBody = new JuniorApplyMessage(message, senderKey, juniorMentoringApply);
Message messageBody = new TextMessage(message, senderKey, juniorMentoringApply);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -166,7 +183,7 @@ public CommonRequest mapToJuniorAcceptMessage(User user, String link, String tim
"\n" +
"멘토링 시간은 꼭 지켜주세요! \uD83D\uDD05"
);
JuniorAcceptMessage messageBody = new JuniorAcceptMessage(message, senderKey, juniorMentoringAccept);
Message messageBody = new TextMessage(message, senderKey, juniorMentoringAccept);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -180,7 +197,7 @@ public CommonRequest mapToJuniorRefuseMessage(User user) {
);
WebLinkButton otherSenior = new WebLinkButton("다른 선배 보러가기", type, mainPage, mainPage);
WebLinkButton[] buttons = {otherSenior};
JuniorRefuseMessage messageBody = new JuniorRefuseMessage(message, senderKey, juniorMentoringRefuse, buttons);
Message messageBody = new ButtonMessage(message, senderKey, juniorMentoringRefuse, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -198,7 +215,7 @@ public CommonRequest mapToJuniorFinish(User user) {
WebLinkButton mentoringFinish = new WebLinkButton("진행 확정하러가기", type, juniorMentoringPage, juniorMentoringPage);
WebLinkButton[] buttons = {mentoringFinish};

JuniorFinishMessage messageBody = new JuniorFinishMessage(message, senderKey, juniorMentoringFinish, buttons);
Message messageBody = new ButtonMessage(message, senderKey, juniorMentoringFinish, buttons);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand All @@ -213,11 +230,11 @@ public CommonRequest mapToJuniorMatchingFail(JuniorMatchingFailRequest request)
request.alterPostgraduate() + "대학원 " + request.alterMajor() + "학과의 선배를 매칭 드리고 싶어요!\n" +
"\n" +
"신청해주신 선배는 찾지 못했지만, 유사학과의 다른 선배와 멘토링을 해보는 건 어때요 ?"
);
);
WebLinkButton goMainPage = new WebLinkButton("대학원 김선배 바로가기", type, mainPage, mainPage);
WebLinkButton[] buttons = {goMainPage};

JuniorMatchingFailMessage messageBody = new JuniorMatchingFailMessage(message, senderKey, juniorMatchingFail, buttons);
Message messageBody = new ButtonMessage(message, senderKey, juniorMatchingFail, buttons);
return createCommonRequest(messageBody, request.phoneNumber());
}

Expand All @@ -227,14 +244,14 @@ public CommonRequest mapToJuniorMatchingSuccess(JuniorMatchingSuccessRequest req
"\n" +
"오래 기다려주셔서 감사드립니다!\n" +
"\n" +
request.name() + "님께서 신청해주신, " + request.postgraduate() + "대학원 " + request.major() + "학과 선배와 매칭되었어요 \uD83D\uDE42\n" +
request.name() + "님께서 신청해주신, " + request.postgraduate() + "대학원 " + request.major() + "랩실 선배와 매칭되었어요 \uD83D\uDE42\n" +
"\n" +
"아래 링크를 눌러 멘토링을 진행해보세요 !"
);
);
WebLinkButton goMainPage = new WebLinkButton("대학원 김선배 바로가기", type, mainPage, mainPage);
WebLinkButton[] buttons = {goMainPage};

JuniorMatchingSuccessMessage messageBody = new JuniorMatchingSuccessMessage(message, senderKey, juniorMatchingSucess, buttons);
Message messageBody = new ButtonMessage(message, senderKey, juniorMatchingSucess, buttons);
return createCommonRequest(messageBody, request.phoneNumber());
}

Expand All @@ -249,7 +266,7 @@ public CommonRequest mapToJuniorMatchingWaiting(User user) {
"신청해주신 선배를 찾는데에는 3~7일 정도 소요되어요 \uD83D\uDE0A"
);

JuniorMatchingWaitingMessage messageBody = new JuniorMatchingWaitingMessage(message, senderKey, juniorMatchingWaiting);
Message messageBody = new TextMessage(message, senderKey, juniorMatchingWaiting);
return createCommonRequest(messageBody, user.getPhoneNumber());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public void mentoringApply(User user) {
bizppurioSend.sendMessageWithExceptionHandling(() -> mapper.mapToSeniorApplyMessage(user));
}

public void mentoringRefund(User user) {
bizppurioSend.sendMessageWithExceptionHandling(() -> mapper.mapToSeniorRefundMessage(user));
}

public void mentoringAccept(Senior senior, String time) {
bizppurioSend.sendMessageWithExceptionHandling(() -> {
User user = senior.getUser();
Expand Down
Loading