Skip to content

Commit

Permalink
Merge pull request #286 from WE-ARE-RACCOONS/RAC-397
Browse files Browse the repository at this point in the history
RAC-397 feat : ์•Œ๋ฆผํ†ก ์ถ”๊ฐ€ ์ž‘์—…
  • Loading branch information
ywj9811 authored Jun 12, 2024
2 parents c4dee35 + f8c4007 commit 93095c3
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 123 deletions.
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

0 comments on commit 93095c3

Please sign in to comment.