Skip to content
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0144409
Update main-cd.yml
wodydl0 Feb 24, 2025
d6b15cc
Merge pull request #16 from Ring-Us/main-cd/fix/2
wodydl0 Feb 24, 2025
fc17b48
Fix/main cd/v3 (#18)
wodydl0 Feb 24, 2025
2f89d3b
RINGUS-34 feat: 멘티 프로필 등록 기능 구현 (#20)
wlgns12370 Feb 24, 2025
1938d49
RINGUS-36: feat: 멤버Id 및 파일경로 매핑 테이블 생성 (#21)
jbh010204 Feb 24, 2025
ca39adc
RINGUS-35 feat: 멘토 멘티 프로필 수정 API 개발 (#22)
wlgns12370 Feb 25, 2025
cf5d132
RINGUS-37 chore: 스웨거 접속 경로 변경 (#23)
jbh010204 Feb 25, 2025
8ca92cb
refactor: 프론트엔드 배포 도메인 CORS 허용
jbh010204 Feb 25, 2025
03685b9
chore: DB 마이그레이션을 위한 Flyway 도입 (#24)
jbh010204 Feb 27, 2025
7bffbf4
RINGUS-40 feat: 북마크 생성 및 삭제 API 구현 (#25)
jbh010204 Feb 27, 2025
6ce9e23
RINGUS-45 feat: SessionMemberId 커스텀 어노테이션 구현 (#26)
jbh010204 Feb 28, 2025
e2494db
RINGUS-44 refactor: 파일 로드 api 리팩토링 (#28)
wodydl0 Feb 28, 2025
2f78be1
fix: ci 코드 수정 (#31)
wodydl0 Feb 28, 2025
b7f9be7
feat: storage swagger docs 작성 (#32)
wodydl0 Mar 1, 2025
a69f1f1
RINGUS-48 refactor: 멘토 엔티티 세부필드 변경 (#33)
jbh010204 Mar 4, 2025
2662f85
RINGUS-49 docs: 내 프로필 상세 조회 Docs 작성 (#34)
wlgns12370 Mar 5, 2025
57cc5b7
RINGUS-52 fix: 내 멤버 조회 imgUrl 필드 추가 (#35)
wlgns12370 Mar 6, 2025
896f5b9
RINGUS-46 feat: 멘토링 제안 api (#36)
wodydl0 Mar 7, 2025
9cce0df
RINGUS-53 feat: 세션검증을 담당할 어노테이션 기능 구현 (#37)
jbh010204 Mar 10, 2025
78fe040
RINGUS-58 chore: multipart 파일크기 제한 수정 및 멘토링 flyway 스키마 추가(#38)
wodydl0 Mar 13, 2025
aa78523
RINGUS-27 feat: 멘토 프로필 목록 조회 API 구현 (#39)
wlgns12370 Mar 13, 2025
862feb0
RINGUS-57 feat: 닉네임 중복 검사 API 구현 (#40)
jbh010204 Mar 15, 2025
b9585c1
RINGUS-61 feat: 내 프로필 조회 API 구현 (#41)
wlgns12370 Mar 15, 2025
fc22c19
RINGUS-62 feat: 북마크 멘토 목록 조회 기능 추가 (#42)
jbh010204 Mar 15, 2025
1870361
RINGUS-62 fix: 로그인 아닐 떄 멘토 목록 조회 안되는 오류 수정 (#43)
jbh010204 Mar 16, 2025
f2a7563
RINGUS-63 feat: 내 멤버 조회 닉네임 필드 추가 (#44)
wlgns12370 Mar 18, 2025
ee0374d
RINGUS-60 feat: MentoringStatus ENUM 변경 및 MentorQueryDsl queryFilter …
wodydl0 Mar 21, 2025
0ba4af0
RINGUS-64 feat: 멘토링 멘티 목록 조회 (#46)
jbh010204 Mar 22, 2025
f40c94b
RINGUS-64 fix: git 스테이징 안된 파일 push (#47)
jbh010204 Mar 22, 2025
289f4f6
RINGUS-64 refactor: 닉네임 중복 검사 POST에서 GET으로 변경 (#48)
jbh010204 Mar 23, 2025
759d232
RINGUS-66 feat: 멘토 멘토링 수락 API 개발 (#49)
wlgns12370 Mar 24, 2025
7a0362b
Fix: CORS 문제 해결 (#50)
wlgns12370 Mar 24, 2025
371ff2d
RINGUS-70 rename: 변경된 이미지 응답 필드 반영 (#51)
wlgns12370 Mar 25, 2025
a51e3cf
RINGUS-70 feat: 멘토링 count 필드 추가 (#52)
wlgns12370 Mar 25, 2025
a4d33ea
Update main-cd.yml/v4
wodydl0 Mar 26, 2025
f48cf9a
Update main-cd.yml/v5 (#54)
wodydl0 Mar 26, 2025
dddbc02
RINGUS-70 feat: 멘토링 count 쿼리 구현 (#56)
wlgns12370 Mar 26, 2025
94f99c3
RINGUS-70 Fix: QueryDsl 생성자 주입 추가 (#57)
wlgns12370 Mar 26, 2025
c1444a8
Merge remote-tracking branch 'origin/main' into develop
wlgns12370 Mar 26, 2025
1e9ea53
RINGUS-65 feat: S3 객체 보안 설정 (#60)
wodydl0 Mar 31, 2025
9bf489e
RINGUS-77 feat: TimeTraceAop 적용 (#61)
wodydl0 Apr 17, 2025
e0c8648
RINGUS-74 fix: 누락된 코드 병합 (#62)
wlgns12370 May 2, 2025
e11e2a1
RINGUS-74 feat: Enum 데이터 서버에서 한국어로 번역하기 (#63)
wlgns12370 May 10, 2025
8be5c43
RINGUS-71 feat: 멘티가 신청한 멘토링 시간대 변경 기능 구현 (#59)
jbh010204 May 10, 2025
3990393
Feature/ringus 78 (#64)
wodydl0 May 10, 2025
2a90edb
RINGUS-74 Fix: Enum 데이터 변경 및 DTO 수정 (#66)
wlgns12370 May 15, 2025
dc46926
RINGUS-83 feat: 로그인 여부와 멘토, 멘티 여부 확인 기능 추가 (#65)
jbh010204 May 16, 2025
d726840
RINGUS-87 feat: 포트폴리오 업로드 (#67)
wodydl0 May 18, 2025
891642a
feat: S3 파일 업로드 수정 (#68)
wodydl0 May 18, 2025
7409136
Feature/ringus 81 : flyway schema 추가 (#69)
wodydl0 May 18, 2025
756dac0
RINGUS-74 fix: MentorDetail 필드 수정 (#70)
wlgns12370 May 19, 2025
c11757d
RINGUS-74 Fix: API 연동 오류 해결 (#71)
wlgns12370 May 20, 2025
be67c01
RINGUS-89 fix: 한글 파일 업로드 시 발생 오류 수정 (#72)
wodydl0 May 20, 2025
10ee9ce
RINGUS-84 feat: 멘토링 신청 알림 전송 시스템 구현 (#73)
wlgns12370 May 26, 2025
a407101
RINGUS-67: 비밀번호 재설정 기능 구현 (#74)
jbh010204 May 26, 2025
2ecadfb
RINGUS-67 fix: 비밀번호 재설정 기능에는 세션 체크 없음으로 변경
May 26, 2025
2a2a7ef
RINGUS-92 fix: Hotfix (#75)
jbh010204 May 26, 2025
a1d40c4
RINGUS-92 fix: 비밀번호 검증 api 세션체크 없음 변경 (#76)
jbh010204 May 27, 2025
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
9 changes: 9 additions & 0 deletions .github/workflows/main-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ jobs:
git clone [email protected]:Ring-Us/ring-us-server.git /home/ubuntu/ring-us-server
cd /home/ubuntu/ring-us-server
fi

cd /home/ubuntu/ring-us-server

echo "${{ secrets.ENV }}" > .env.dev

# 🛠 Gradle 빌드 권한 설정
echo "[GitHub Actions] 🔧 Fixing Gradle permissions"
sudo chown -R $USER:$USER ~/.gradle
sudo chmod -R 777 ~/.gradle

# 🛠 Gradle 빌드 권한 설정
echo "[GitHub Actions] 🔧 Fixing Gradle permissions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import es.princip.ringus.domain.mentee.MenteeRepository;
import es.princip.ringus.domain.mentor.Mentor;
import es.princip.ringus.domain.mentor.MentorRepository;
import es.princip.ringus.domain.mentoring.MentoringRepository;
import es.princip.ringus.domain.serviceTerm.ServiceTermAgreement;
import es.princip.ringus.global.exception.CustomRuntimeException;
import es.princip.ringus.global.util.UniversityDomainUtil;
Expand All @@ -32,6 +33,7 @@ public class MemberService {
private final MentorRepository mentorRepository;
private final MenteeRepository menteeRepository;
private final PasswordEncoder passwordEncoder;
private final MentoringRepository mentoringRepository;

/**
* 회원 저장 (이메일 인증 후 회원가입 진행)
Expand Down Expand Up @@ -68,7 +70,7 @@ public MemberResponse getMember(Long memberId) {
Mentor mentor = mentorRepository.findByMemberId(memberId)
.orElseThrow(() -> new CustomRuntimeException(MemberErrorCode.MEMBER_NOT_FOUND));

MentorProfileResponse profile = MentorProfileResponse.from(mentor);
MentorProfileResponse profile = MentorProfileResponse.from(mentor, mentoringRepository.findMentoringCountBy(mentor.getId()));
return MemberResponse.of(member, profile);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import es.princip.ringus.domain.member.MemberRepository;
import es.princip.ringus.domain.mentor.Mentor;
import es.princip.ringus.domain.mentor.MentorRepository;
import es.princip.ringus.domain.mentoring.MentoringRepository;
import es.princip.ringus.domain.support.CursorResponse;
import es.princip.ringus.global.exception.CustomRuntimeException;
import es.princip.ringus.presentation.mentor.dto.*;
Expand All @@ -25,6 +26,7 @@ public class MentorService {

private final MemberRepository memberRepository;
private final MentorRepository mentorRepository;
private final MentoringRepository mentoringRepository;

@Transactional
public Long register(Long memberId, MentorRequest request) {
Expand All @@ -47,7 +49,7 @@ public Long register(Long memberId, MentorRequest request) {

@Transactional
public Long edit(Long memberId, EditMentorRequest request) {
Mentor mentor = mentorRepository.findById(memberId)
Mentor mentor = mentorRepository.findByMemberId(memberId)
.orElseThrow(() -> new CustomRuntimeException(MentorErrorCode.MENTOR_PROFILE_NOT_FOUND));
mentor.edit(request);
return mentor.getId();
Expand All @@ -57,6 +59,7 @@ public CursorResponse<MentorCardResponse> getMentorBy(CursorRequest request, Pag
if(request.isBookmarked()) {
Member member = memberRepository.findById(memberId)
.orElseThrow(() -> new CustomRuntimeException(MemberErrorCode.MEMBER_NOT_FOUND));
Long menteeId = member.getId();

if (member.isNotMentee()) {
throw new CustomRuntimeException(MemberErrorCode.MEMBER_TYPE_DIFFERENT);
Expand All @@ -71,6 +74,9 @@ public CursorResponse<MentorCardResponse> getMentorBy(CursorRequest request, Pag
public MentorDetailResponse getDetailBy(Long mentorId) {
Mentor mentor = mentorRepository.findById(mentorId)
.orElseThrow(() -> new CustomRuntimeException(MentorErrorCode.MENTOR_PROFILE_NOT_FOUND));
return MentorDetailResponse.from(mentor);
return MentorDetailResponse.from(
mentor,
mentoringRepository.findMentoringCountBy(mentorId)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import es.princip.ringus.domain.exception.MentorErrorCode;
import es.princip.ringus.domain.mentor.Mentor;
import es.princip.ringus.domain.mentor.MentorRepository;
import es.princip.ringus.domain.mentoring.MentoringRepository;
import es.princip.ringus.global.exception.CustomRuntimeException;
import es.princip.ringus.presentation.mentor.dto.MyMentorResponse;
import lombok.RequiredArgsConstructor;
Expand All @@ -14,10 +15,11 @@
@Transactional(readOnly = true)
public class MyMentorService {
private final MentorRepository mentorRepository;
private final MentoringRepository mentoringRepository;

public MyMentorResponse getDetailBy(Long memberId) {
Mentor mentor = mentorRepository.findByMemberId(memberId)
.orElseThrow(() -> new CustomRuntimeException(MentorErrorCode.MENTOR_PROFILE_NOT_FOUND));
return MyMentorResponse.from(mentor);
return MyMentorResponse.from(mentor, mentoringRepository.findMentoringCountBy(mentor.getId()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package es.princip.ringus.domain.bookmark;

public interface BookmarkQueryDslRepository {
Boolean isBookmarked(Long memberId, Long mentorId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package es.princip.ringus.domain.bookmark;

import es.princip.ringus.domain.support.QueryDslSupport;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import static es.princip.ringus.domain.mentoring.QMentoring.mentoring;

@Repository
@RequiredArgsConstructor
public class BookmarkQueryDslRepositoryImpl extends QueryDslSupport implements BookmarkQueryDslRepository {
@Override
public Boolean isBookmarked(Long memberId, Long mentorId) {
return queryFactory.select()
.from(mentoring)
.where(mentoring.mentor.id.eq(mentorId).and(mentoring.mentee.memberId.eq(memberId)))
Copy link

Copilot AI Mar 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the 'mentoring' entity in the Bookmark repository implementation appears to be incorrect. This query should reference the Bookmark entity instead to ensure the correct data is fetched.

Suggested change
.from(mentoring)
.where(mentoring.mentor.id.eq(mentorId).and(mentoring.mentee.memberId.eq(memberId)))
.from(bookmark)
.where(bookmark.mentor.id.eq(mentorId).and(bookmark.mentee.memberId.eq(memberId)))

Copilot uses AI. Check for mistakes.
.fetchCount() > 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Optional;

@Repository
public interface BookmarkRepository extends JpaRepository<Bookmark, Long> {
public interface BookmarkRepository extends JpaRepository<Bookmark, Long>, BookmarkQueryDslRepository {
Optional<Bookmark> findByMentorAndMentee(Mentor mentor, Mentee mentee);

Optional<Bookmark> findByMentee(Mentee mentee);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.querydsl.core.Tuple;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.jpa.impl.JPAQuery;
import es.princip.ringus.domain.bookmark.BookmarkRepository;
import es.princip.ringus.domain.mentoring.MentoringRepository;
import es.princip.ringus.domain.support.QueryDslSupport;
import es.princip.ringus.presentation.mentor.dto.CursorRequest;
import es.princip.ringus.presentation.mentor.dto.MentorCardResponse;
Expand All @@ -23,6 +25,9 @@
@RequiredArgsConstructor
public class MentorQueryDslRepositoryImpl extends QueryDslSupport implements MentorQueryDslRepository{

private final MentoringRepository mentoringRepository;
private final BookmarkRepository bookmarkRepository;

private List<Tuple> fetchMentor(
final Pageable pageable,
final CursorRequest request,
Expand All @@ -31,33 +36,33 @@ private List<Tuple> fetchMentor(
JPAQuery<Tuple> query;
if (request.isSuggested()) {
query = queryFactory.select(
mentor.id,
mentor.nickname,
mentor.profileImage,
mentor.introduction,
mentor.organization,
mentor.message,
mentoring.mentoringStatus
)
.from(mentor);
mentor.id,
mentor.nickname,
mentor.profileImage,
mentor.introduction,
mentor.organization,
mentor.message,
mentoring.mentoringStatus
)
.from(mentor);
}
else {
query = queryFactory.select(
mentor.id,
mentor.nickname,
mentor.profileImage,
mentor.introduction,
mentor.organization,
mentor.message
)
.from(mentor);
mentor.id,
mentor.nickname,
mentor.profileImage,
mentor.introduction,
mentor.organization,
mentor.message
)
.from(mentor);
}
queryFilter(query, request, memberId);

query
.where(request.cursor() != null ? mentor.id.goe(request.cursor()) : mentor.id.isNotNull())
.orderBy(new OrderSpecifier<>(ASC, mentor.id))
.limit(pageable.getPageSize() + 1);
.where(request.cursor() != null ? mentor.id.goe(request.cursor()) : mentor.id.isNotNull())
.orderBy(new OrderSpecifier<>(ASC, mentor.id))
.limit(pageable.getPageSize() + 1);

return query.fetch();
}
Expand All @@ -67,33 +72,33 @@ private List<MentorCardResponse> fetchContent(
final CursorRequest request,
final Long memberId
) {

return fetchMentor(pageable, request, memberId).stream()
.map(tuple -> {
if (request.isSuggested()) {
// 🔥 북마크된 멘토 조회 (멘토 목록 조회)
return MentorCardResponse.of(
tuple.get(mentor.id),
tuple.get(mentor.nickname),
tuple.get(mentor.profileImage),
tuple.get(mentor.introduction),
tuple.get(mentor.organization),
tuple.get(mentoring.mentoringStatus.stringValue())

);
} else {
return MentorCardResponse.of(
tuple.get(mentor.id),
tuple.get(mentor.nickname),
tuple.get(mentor.profileImage),
tuple.get(mentor.introduction),
tuple.get(mentor.organization),
tuple.get(mentor.message),
0
);
}
})
.toList();
.map(tuple -> {
if (request.isSuggested()) {
return MentorCardResponse.of(
tuple.get(mentor.id),
tuple.get(mentor.nickname),
tuple.get(mentor.profileImage),
tuple.get(mentor.introduction),
tuple.get(mentor.organization),
tuple.get(mentor.message),
tuple.get(mentoring.mentoringStatus.stringValue()),
mentoringRepository.findMentoringCountBy(tuple.get(mentor.id))
);
} else {
return MentorCardResponse.of(
tuple.get(mentor.id),
tuple.get(mentor.nickname),
tuple.get(mentor.profileImage),
tuple.get(mentor.introduction),
tuple.get(mentor.organization),
tuple.get(mentor.message),
mentoringRepository.findMentoringCountBy(tuple.get(mentor.id)),
bookmarkRepository.isBookmarked(memberId, tuple.get(mentor.id))
);
}
})
.toList();
}

private void queryFilter(
Expand All @@ -103,18 +108,18 @@ private void queryFilter(
) {
if(request.isBookmarked() && memberId != null){
query
.join(mentee).on(mentee.memberId.eq(memberId))
.join(bookmark).on(mentor.id.eq(bookmark.mentor.id))
.where(
bookmark.mentee.id.eq(mentee.id)
);
.join(mentee).on(mentee.memberId.eq(memberId))
.join(bookmark).on(mentor.id.eq(bookmark.mentor.id))
.where(
bookmark.mentee.id.eq(mentee.id)
);
}
// 멘토링 상태 필터 적용 (멘토링 신청 현황 조회 시)

if (request.isSuggested()) {
query.join(mentoring).on(mentoring.mentor.id.eq(mentor.id))
.where(
mentoring.mentoringStatus.isNotNull()
);
.where(
mentoring.mentoringStatus.isNotNull()
);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package es.princip.ringus.domain.mentoring;

public interface MentoringQueryDslRepository {
Long findMentoringCountBy(Long mentorId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package es.princip.ringus.domain.mentoring;

import es.princip.ringus.domain.support.QueryDslSupport;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

import static es.princip.ringus.domain.mentoring.QMentoring.mentoring;

@Repository
@RequiredArgsConstructor
public class MentoringQueryDslRepositoryImpl extends QueryDslSupport implements MentoringQueryDslRepository {

@Override
public Long findMentoringCountBy(Long mentorId) {
return queryFactory.select()
.from(mentoring)
.where(mentoring.mentor.id.eq(mentorId).and(mentoring.mentoringStatus.eq(MentoringStatus.COMPLETED)))
.fetchCount();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
import java.util.Optional;

@Repository
public interface MentoringRepository extends JpaRepository<Mentoring, Long> {
public interface MentoringRepository extends JpaRepository<Mentoring, Long>, MentoringQueryDslRepository {
Optional<Mentoring> findByMenteeIdAndMentorId(Long menteeId, Long mentorId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ public record MentorProfileResponse(
String nickname,
ProfileImageResponse image,
OrganizationResponse organization,
int mentoringCount
Long mentoringCount
) {
public static MentorProfileResponse from(final Mentor mentor){
return new MentorProfileResponse(mentor.getNickname(), ProfileImageResponse.from(mentor.getProfileImage()), OrganizationResponse.from(mentor.getOrganization()),0);
public static MentorProfileResponse from(final Mentor mentor, Long mentoringCount){
return new MentorProfileResponse(
mentor.getNickname(),
ProfileImageResponse.from(mentor.getProfileImage()),
OrganizationResponse.from(mentor.getOrganization()),
mentoringCount
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/mentor")
Expand Down Expand Up @@ -55,14 +54,11 @@ public ResponseEntity<ApiResponseWrapper<CursorResponse<MentorCardResponse>>> ge
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse
) {

Long memberId = Optional.ofNullable(request)
.filter(CursorRequest::isBookmarked)
.map(req -> SessionToMemberId.getSessionMemberId(httpServletRequest, httpServletResponse))
.orElse(null);

log.info(request.toString());
log.info(pageable.toString());
CursorResponse<MentorCardResponse> response = mentorService.getMentorBy(request, pageable, memberId);
return ResponseEntity.ok(ApiResponseWrapper.success(HttpStatus.OK, "성공", response));
}
Expand Down
Loading