Skip to content

Commit

Permalink
Merge pull request #71 from Y-edu/develop
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
ywj9811 authored Feb 25, 2025
2 parents e8b21fe + 2a363f4 commit 541fcb9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AllApplicationResponse getAllApplication() {
List<ApplicationForm> applicationForms = adminGetService.allApplication();
return new AllApplicationResponse(applicationForms.stream()
.map(applicationForm -> {
List<ClassMatching> classMatchings = adminGetService.allMatching(applicationForm);
List<ClassMatching> classMatchings = adminGetService.allMatching(applicationForm.getApplicationFormId());
int accept = (int)classMatchings.stream()
.filter(classMatching -> classMatching.getMatchStatus().equals(MatchingStatus.수락) || classMatching.getMatchStatus().equals(MatchingStatus.전송))
.count();
Expand All @@ -47,7 +47,7 @@ public CommonParentsResponse getParentsInfo(String applicationFormId) {

public AllAlarmTalkResponse getAlarmTalkInfo(String applicationFormId) {
ApplicationForm applicationForm = adminGetService.applicationFormById(applicationFormId);
List<ClassMatching> classMatchings = adminGetService.allMatching(applicationForm);
List<ClassMatching> classMatchings = adminGetService.allMatching(applicationFormId);
List<AlarmTalkResponse> alarmTalkResponses = classMatchings.stream()
.map(AdminMapper::mapToAlarmTalkResponse)
.toList();
Expand All @@ -69,8 +69,8 @@ public ClassDetailsResponse getClassDetails(String applicationFormId) {
}

public AllFilteringTeacher searchAllTeacher(String applicationFormId, TeacherSearchRequest request) {
ApplicationForm applicationForm = adminGetService.applicationFormById(applicationFormId);
List<Teacher> teachers = adminGetService.allTeacherBySearch(applicationForm, request);
List<ClassMatching> classMatchings = adminGetService.allMatching(applicationFormId);
List<Teacher> teachers = adminGetService.allTeacherBySearch(classMatchings, request);
return new AllFilteringTeacher(teachers.stream()
.map(teacher -> {
List<TeacherDistrict> teacherDistricts = adminGetService.allDistrictByTeacher(teacher);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public List<ApplicationForm> allApplication() {
return applicationFormRepository.findAll(Sort.by(Sort.Direction.DESC, "createdAt"));
}

public List<ClassMatching> allMatching(ApplicationForm applicationForm) {
return classMatchingRepository.allByApplicationForm(applicationForm);
public List<ClassMatching> allMatching(String applicationFormId) {
return classMatchingRepository.allByApplicationForm(applicationFormId);
}

public ApplicationForm applicationFormById(String applicationFormId) {
Expand All @@ -54,8 +54,8 @@ public List<Goal> allGoalByApplicationForm(ApplicationForm applicationForm) {
return goalRepository.findAllByApplicationForm(applicationForm);
}

public List<Teacher> allTeacherBySearch(ApplicationForm applicationForm, TeacherSearchRequest teacherSearchRequest) {
return teacherRepository.findAllSearchTeacher(applicationForm, teacherSearchRequest);
public List<Teacher> allTeacherBySearch(List<ClassMatching> classMatchings, TeacherSearchRequest teacherSearchRequest) {
return teacherRepository.findAllSearchTeacher(classMatchings, teacherSearchRequest);
}

public Teacher teacherById(long teacherId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.yedu.backend.domain.matching.domain.repository;

import com.yedu.backend.domain.matching.domain.entity.ClassMatching;
import com.yedu.backend.domain.parents.domain.entity.ApplicationForm;

import java.util.List;

public interface ClassMatchingDslRepository {
List<ClassMatching> allByApplicationForm(ApplicationForm applicationForm);
List<ClassMatching> allByApplicationForm(String applicationFormId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.yedu.backend.domain.matching.domain.entity.ClassMatching;
import com.yedu.backend.domain.matching.domain.entity.constant.MatchingStatus;
import com.yedu.backend.domain.parents.domain.entity.ApplicationForm;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

Expand All @@ -19,9 +18,9 @@ public class ClassMatchingDslRepositoryImpl implements ClassMatchingDslRepositor
private final JPAQueryFactory queryFactory;

@Override
public List<ClassMatching> allByApplicationForm(ApplicationForm applicationForm) {
public List<ClassMatching> allByApplicationForm(String applicationFormId) {
return queryFactory.selectFrom(classMatching)
.where(classMatching.applicationForm.eq(applicationForm))
.where(classMatching.applicationForm.applicationFormId.eq(applicationFormId))
.orderBy(statusOrderSpecifier())
.fetch();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.yedu.backend.domain.teacher.domain.repository;

import com.yedu.backend.admin.application.dto.req.TeacherSearchRequest;
import com.yedu.backend.domain.matching.domain.entity.ClassMatching;
import com.yedu.backend.domain.parents.domain.entity.ApplicationForm;
import com.yedu.backend.domain.teacher.domain.entity.Teacher;

import java.util.List;

public interface TeacherDslRepository {
List<Teacher> findAllMatchingApplicationForm(ApplicationForm applicationForm);
List<Teacher> findAllSearchTeacher(ApplicationForm applicationForm, TeacherSearchRequest request);
List<Teacher> findAllSearchTeacher(List<ClassMatching> classMatchings, TeacherSearchRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.querydsl.core.types.dsl.CaseBuilder;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.yedu.backend.admin.application.dto.req.TeacherSearchRequest;
import com.yedu.backend.domain.matching.domain.entity.ClassMatching;
import com.yedu.backend.domain.parents.domain.entity.ApplicationForm;
import com.yedu.backend.domain.parents.domain.entity.constant.ClassType;
import com.yedu.backend.domain.parents.domain.entity.constant.Gender;
Expand Down Expand Up @@ -69,9 +70,9 @@ private BooleanExpression subjectSpecifier(ClassType classType) {
}

@Override
public List<Teacher> findAllSearchTeacher(ApplicationForm applicationForm, TeacherSearchRequest request) {
List<Long> teacherIds = getTeachers(applicationForm)
.stream().map(Teacher::getTeacherId)
public List<Teacher> findAllSearchTeacher(List<ClassMatching> classMatchings, TeacherSearchRequest request) {
List<Long> teacherIds = classMatchings.stream()
.map(classMatching -> classMatching.getTeacher().getTeacherId())
.toList();

BooleanBuilder builder = searchLikeSpecifier(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class BizppurioMapper {

private static final String WEB_LINK = "WL";
private static final String BOT = "BK";
private static final String CHANNEL = "AC";
private static final String MESSAGE = "MD";

public CommonRequest mapToApplyChannel(Teacher teacher) {
Expand Down Expand Up @@ -109,23 +110,20 @@ public CommonRequest mapToApplyAgree(Teacher teacher) {
}

public CommonRequest mapToApplyPhotoSubmit(Teacher teacher) {
String message = ("지원서는 Y-Edu가 프로필로 만들어, 이후 매칭 시 학부모님께 전달드릴게요. \n" +
String message = ("안녕하세요 선생님 \uD83D\uDE42\n" +
"\n" +
"다음 단계는 프로필 사진과 영상을 구글폼으로 제출해 주세요. \uD83D\uDE42\n" +
"지원서가 정상적으로 제출되었어요.\n" +
"Y-Edu의 선생님으로 지원해주셔서 감사합니다. \n" +
"\n" +
"\uD83D\uDCF7 프로필 사진 포인트\n" +
"- 증명사진도 좋아요 \n" +
"- 사진의 배경이 원색으로 깔끔해야합니다. \n" +
"지원서는 Y-Edu가 프로필로 만들어, 과외 매칭 시 학부모님께 전달드릴게요. \n" +
"\n" +
"\uD83D\uDCF9 영상 제출 포인트 (선택)\n" +
"- 30초 정도의 영상입니다. \n" +
"- 영어 과목은 80% 이상 영어로!\n" +
"- 비율은 가로가 길게 촬영\n" +
"- 제출 시 매칭 확률 47% up\n" +
"다음 단계로 프로필 사진과 영상을 구글폼으로 제출해주세요. \uD83D\uDE00\n" +
"\n" +
"영상은 첫 수업 아이에게 앞으로의 수업을 설명해주는 내용이면 됩니다. (구글폼에 가이드 참고)\n" +
"✅ 제출 포인트\n" +
"- [필수] 프로필 사진 \n" +
"- [선택] 영어 수업 소개영상 \n" +
"\n" +
"사진과 영상은 꼭 3일 이내 제출해주세요!");
"구체적인 설명은 아래 버튼을 눌러 구글폼에서 확인할 수 있으며, 꼭 3일 이내 제출 부탁드려요 \uD83D\uDE47\uD83C\uDFFB\u200D\uFE0F");
CommonButton webLinkButton = new WebButton("사진/영상 제출하기", WEB_LINK, photoSubmitUrl, photoSubmitUrl);
Message messageBody = new ButtonMessage(message, yeduApplyKey, applyPhotoSubmit, new CommonButton[]{webLinkButton});
return createCommonRequest(messageBody, teacher.getTeacherInfo().getPhoneNumber());
Expand Down Expand Up @@ -213,18 +211,16 @@ public CommonRequest mapToMatchingChannel(Teacher teacher) {
"영어이름 : " + teacherInfo.getNickName() + "\n" +
"전화번호 : " + teacherInfo.getPhoneNumber() + "\n" +
"\n" +
teacherInfo.getNickName() + " 선생님 등록을 위한 모든 절차가 완료되었습니다. \n" +
teacherInfo.getNickName() + " 선생님 등록을 위한 모든 절차가 완료되었습니다. \uD83C\uDF89\n" +
"\n" +
"해당 채널은 선생님이 신청하셨던 지역의 ‘과외 건이 공지’되는 채널입니다. \n" +
"해당 채널은 선생님이 신청하셨던 지역의 ‘과외 공지’가 전달되는 채널입니다. \n" +
"\n" +
"이 채널만큼은 꼼꼼히 확인 및 반응해주셔야 해요!\n" +
"\n" +
"공지되는 과외건에 대해 3시간 이내에 반복적으로 반응이 없을 경우, 과외건 공지가 줄어들게 된다는 사실을 명심해주세요! ☝\uD83C\uDFFB\n" +
"\n" +
"아래 버튼을 눌러, 과외 공지를 받기 시작해주세요. 회신 메세지가 없어도 설정이 완료된 것이니 안심해주세요. \n" +
"\n" +
"앞으로 잘부탁드립니다 선생님! \uD83D\uDE42");
CommonButton simpleButton = new SimpleButton("과외 받기 시작하기", BOT);
CommonButton simpleButton = new SimpleButton("채널 추가", CHANNEL);
Message messageBody = new ButtonMessage(message, yeduMatchingKey, matchingChannel, new CommonButton[]{simpleButton});
return createCommonRequest(messageBody, teacherInfo.getPhoneNumber());
}
Expand Down

0 comments on commit 541fcb9

Please sign in to comment.