From 7870dd6ce6d89353df706a06b968ce055c0a8603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A4=80=EC=8D=A8=ED=81=AC?= Date: Sun, 18 Feb 2024 16:41:45 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EB=A8=B9=EC=9D=B4=20=EC=A3=BC?= =?UTF-8?q?=EA=B8=B0=20=ED=83=80=EC=9E=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../networkingService/domain/member/entity/PointType.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/umc/networkingService/domain/member/entity/PointType.java b/src/main/java/com/umc/networkingService/domain/member/entity/PointType.java index 94e8b168..2f65cdcd 100644 --- a/src/main/java/com/umc/networkingService/domain/member/entity/PointType.java +++ b/src/main/java/com/umc/networkingService/domain/member/entity/PointType.java @@ -6,8 +6,11 @@ @Getter @RequiredArgsConstructor public enum PointType { - PUDDING("은하수를 살짝 얹은 커스터드 푸딩", 5L, null), - DOUGHNUT("은하스프링클 도넛", 10L, null); + PUDDING("은하수를 살짝 얹은 커스터드 푸딩", 1L, null), + DOUGHNUT("은하스프링클 도넛", 5L, null), + ICE_CREAM("태양이 물든 선샤인 샤베트 아이스크림", 10L, null), + ROLL_CAKE("찬란한 별들이 쑥쑥 박힌 우주맛 롤케이크", 30L, null), + ; private final String description; From ce8bc47d850df31afe2b7dcc6e43ebb316e41082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A4=80=EC=8D=A8=ED=81=AC?= Date: Sun, 18 Feb 2024 17:08:27 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../networkingService/config/initial/ProjectInfo.java | 6 +++--- .../config/initial/ProjectMemberInfo.java | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/umc/networkingService/config/initial/ProjectInfo.java b/src/main/java/com/umc/networkingService/config/initial/ProjectInfo.java index f0a94c82..b6c362d4 100644 --- a/src/main/java/com/umc/networkingService/config/initial/ProjectInfo.java +++ b/src/main/java/com/umc/networkingService/config/initial/ProjectInfo.java @@ -18,7 +18,7 @@ public enum ProjectInfo { OWORI("오월이", " 모여봐요 우리가족, 우리가족만의 소중한 추억을 기록하고 소통해요", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FOURTH/%EC%98%A4%EC%9B%94%EC%9D%B4+%EB%A1%9C%EA%B3%A0.png", List.of("가족", "소통", "추억"), Semester.FOURTH, List.of(ProjectType.IOS)), ARF("알프", "교내 재학생 - 교환학생 커뮤니티 및 모임 플랫폼", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FOURTH/%EC%95%8C%ED%94%84.png", List.of("안전", "외국인", "대학생"), Semester.FOURTH, List.of(ProjectType.IOS)), MYOJIPSA("묘집사", "미션형 커뮤니티 서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FOURTH/%EB%AC%98%EC%A7%91%EC%82%AC.svg", List.of("커뮤니티", "토끼", "미션"), Semester.FOURTH, List.of(ProjectType.AOS)), - + EM_SAM("엠쌤", "MBTI 고민 상담소, 도와줘요 M쌤!", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FOURTH/%EC%97%A0%EC%8C%A4.png", List.of("MBTI", "상담", "채팅"), Semester.FOURTH, List.of(ProjectType.WEB)), // 5기 // GACI @@ -40,7 +40,7 @@ public enum ProjectInfo { BLOOD_TRAIL("BloodTrail", "헌혈 원포인트 어플", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%5B%ED%81%B4%EB%B0%8B%5D.svg", List.of("헌혈", "커뮤니티"), Semester.FIFTH, List.of(ProjectType.WEB)), NANGMAN_CAT("낭만 고양이", "마음을 전달하는 모바일 편지 서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%EB%82%AD%EB%A7%8C+%EA%B3%A0%EC%96%91%EC%9D%B4.png", List.of("느린 우체통", "개성", "소통"), Semester.FIFTH, List.of(ProjectType.WEB)), UJU_JEONGGEOJANG("우주 정거장", "나를 위한 글쓰기", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%EC%9A%B0%EC%A3%BC%EC%A0%95%EA%B1%B0%EC%9E%A5_.svg", List.of("글쓰기", "몰입", "자기개발"),Semester.FIFTH, List.of(ProjectType.WEB)), - HOMEAT("Homeat", "챌린지형 식비 관리 커뮤니티 어플", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/Friend+-.jpg", List.of("1인가구", "식비관리", "정보공유"), Semester.FIFTH, List.of(ProjectType.IOS)), + HOMEAT("Homeat", "챌린지형 식비 관리 커뮤니티 어플", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/Homeat(%ED%99%88%EC%9E%87).png", List.of("1인가구", "식비관리", "정보공유"), Semester.FIFTH, List.of(ProjectType.IOS)), FORGRAD("FORGRAD", "당신의 졸업을 위한 모든 것! 졸업정보서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%ED%8F%AC%EC%96%B4%EA%B7%B8%EB%9E%98%EB%93%9C.svg", List.of("졸업", "소통", "편리함"), Semester.FIFTH, List.of(ProjectType.AOS)), INTERPHONE("인터폰!", "자신에게 맞는 기업추천 서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%EC%9D%B8%ED%84%B0%ED%8F%B0.svg", List.of("인턴", "대학생", "스펙쌓기"), Semester.FIFTH, List.of(ProjectType.WEB)), DONGNEHYEONG("동네형", "당신 근처의 ‘동네형’에게 운동을 배우세요.", "", List.of("헬스", "PT"), Semester.FIFTH, List.of(ProjectType.WEB)), @@ -116,7 +116,7 @@ public enum ProjectInfo { JJIKJJIKI("찍찍이", "갤러리에서 다른 사진들과 소중한 추억 섞어 보관하지 말자!!!", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%EC%B0%8D%EC%B0%8D%EC%9D%B4.svg", List.of("네컷사진", "앨범", "추억"), Semester.FIFTH, List.of(ProjectType.IOS)), CUPI("큐피", "당신의 호기심을 찐전문가가 해결해줍니다!", "", List.of("전문가", "답변"), Semester.FIFTH, List.of(ProjectType.AOS, ProjectType.WEB)), ONANDOFF("온앤오프", "회고를 통해 일잘러로 성장하고, 일의 on&off 를 도와주는 워라벨 서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/ONNOFF.png", List.of("회고", "직장인", "워라벨"), Semester.FIFTH, List.of(ProjectType.IOS)), - VI_NO("VI.NO", "영상보다 글이 편한 당신을 위한, 영상 블로그화 솔루션","https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/UMC+Matching+Center.png", List.of("영상정리", "영상요약", "생성형AI"), Semester.FIFTH, List.of(ProjectType.WEB)), + VI_NO("VI.NO", "영상보다 글이 편한 당신을 위한, 영상 블로그화 솔루션","https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/Vi.NO.svg", List.of("영상정리", "영상요약", "생성형AI"), Semester.FIFTH, List.of(ProjectType.WEB)), MOAMOA("모아모아", "상품을 모아 사람을 모아 당신의 합리적 소비를 돕기 위한 공동 구매 플랫폼", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/%EB%AA%A8%EC%95%84%EB%AA%A8%EC%95%84.svg", List.of("공동 구매", "합리적 소비", "이웃"), Semester.FIFTH, List.of(ProjectType.WEB)), WITHYOU("with 'You'", "여행을 함께하는 그 사람(당신)과의 Travel Log / 추억 저장소", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/with+%E2%80%98You%E2%80%99.svg", List.of("함께 쓰는 여행", "with who?!"), Semester.FIFTH, List.of(ProjectType.IOS)), ECOLINK("에코링크", "서울 내 다양한 지역에서 운영되고 있는 제로웨이스트 샵들의 위치와 판매 제품 정보, 매장 이용 방법, 그리고 매장 별 다양한 이벤트를 한눈에 확인할 수 있는 플랫폼 서비스", "https://umc-service-bucket.s3.ap-northeast-2.amazonaws.com/project/FIFTH/5%EA%B8%B0+%ED%94%8C%EC%A0%9D+%EC%82%AC%EC%A7%84/Map+To+Zero.svg", List.of("친환경"), Semester.FIFTH, List.of(ProjectType.WEB)), diff --git a/src/main/java/com/umc/networkingService/config/initial/ProjectMemberInfo.java b/src/main/java/com/umc/networkingService/config/initial/ProjectMemberInfo.java index aa90636f..8079c530 100644 --- a/src/main/java/com/umc/networkingService/config/initial/ProjectMemberInfo.java +++ b/src/main/java/com/umc/networkingService/config/initial/ProjectMemberInfo.java @@ -12,19 +12,21 @@ public enum ProjectMemberInfo { BORA("보라", "유지수", Part.PM, ProjectInfo.TODAYSGYM.getName()), CHOROK("초록", "윤지민", Part.DESIGN, ProjectInfo.TODAYSGYM.getName()), BEX_1("벡스", "김준석", Part.ANDROID, ProjectInfo.TODAYSGYM.getName()), - BORA_1("보라", "유지수", Part.SPRING, ProjectInfo.TODAYSGYM.getName()), HERON("헤론", "박세웅", Part.SPRING, ProjectInfo.TODAYSGYM.getName()), // 4기 ARI("아리", "허영은", Part.PM, ProjectInfo.OWORI.getName()), LIBER_1("리버", "이경수", Part.IOS, ProjectInfo.OWORI.getName()), BEX_2("벡스", "김준석", Part.SPRING, ProjectInfo.OWORI.getName()), - HANA_1("하나", "심세원", Part.ANDROID, ProjectInfo.MYOJIPSA.getName()), - YENI_1("예니", "나예은", Part.IOS, ProjectInfo.ARF.getName()), + MANGO("망고", "이재원", Part.SPRING, ProjectInfo.ARF.getName()), + BORA_1("보라", "유지수", Part.PM, ProjectInfo.EM_SAM.getName()), + HERON_1("헤론", "박세웅", Part.SPRING, ProjectInfo.EM_SAM.getName()), + JINRO_1("진로", "박지운", Part.SPRING, ProjectInfo.EM_SAM.getName()), + LIU_1("리우", "송민혁", Part.SPRING, ProjectInfo.EM_SAM.getName()), - + // 5기 LIBER("리버", "이경수", Part.PM, ProjectInfo.UMC_NETWORKING_SERVICE.getName()), DELO("델로", "오정현", Part.DESIGN, ProjectInfo.UMC_NETWORKING_SERVICE.getName()), DEUGI("더기", "양유진", Part.DESIGN, ProjectInfo.UMC_NETWORKING_SERVICE.getName()), From 149b745f80e688a4638bf62403366d86d35ffcc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A4=80=EC=8D=A8=ED=81=AC?= Date: Sun, 18 Feb 2024 17:24:59 +0900 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8?= =?UTF-8?q?=20API=20Page=20response=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/ProjectAllResponse.java | 6 +++++- .../domain/project/mapper/ProjectMapper.java | 17 +++++++++++++++++ .../project/service/ProjectServiceImpl.java | 15 +++------------ src/main/resources/application-local.yml | 2 +- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/umc/networkingService/domain/project/dto/response/ProjectAllResponse.java b/src/main/java/com/umc/networkingService/domain/project/dto/response/ProjectAllResponse.java index 7b3d4578..67860907 100644 --- a/src/main/java/com/umc/networkingService/domain/project/dto/response/ProjectAllResponse.java +++ b/src/main/java/com/umc/networkingService/domain/project/dto/response/ProjectAllResponse.java @@ -16,7 +16,11 @@ @NoArgsConstructor public class ProjectAllResponse { private List projects; - private boolean hasNext; + private int page; + private int totalPages; + private int totalElements; + private Boolean isFirst; + private Boolean isLast; @Getter diff --git a/src/main/java/com/umc/networkingService/domain/project/mapper/ProjectMapper.java b/src/main/java/com/umc/networkingService/domain/project/mapper/ProjectMapper.java index 57a667f8..ef834a19 100644 --- a/src/main/java/com/umc/networkingService/domain/project/mapper/ProjectMapper.java +++ b/src/main/java/com/umc/networkingService/domain/project/mapper/ProjectMapper.java @@ -5,8 +5,10 @@ import com.umc.networkingService.domain.project.dto.response.ProjectDetailResponse; import com.umc.networkingService.domain.project.entity.Project; import com.umc.networkingService.domain.project.entity.ProjectMember; +import org.springframework.data.domain.Page; import org.springframework.stereotype.Component; +import java.awt.print.Pageable; import java.util.List; @@ -32,6 +34,21 @@ public ProjectMember toProjectMember(ProjectCreateRequest.ProjectMemberInfo memb .build(); } + public ProjectAllResponse toProjectAllResponse(Page projects) { + List projectInfos = projects.stream() + .map(this::toProjectInfo) + .toList(); + + return ProjectAllResponse.builder() + .projects(projectInfos) + .page(projects.getNumber()) + .totalPages(projects.getTotalPages()) + .totalElements((int) projects.getTotalElements()) + .isFirst(projects.isFirst()) + .isLast(projects.isLast()) + .build(); + } + public ProjectAllResponse.ProjectInfo toProjectInfo(Project project) { return ProjectAllResponse.ProjectInfo.builder() .projectId(project.getId()) diff --git a/src/main/java/com/umc/networkingService/domain/project/service/ProjectServiceImpl.java b/src/main/java/com/umc/networkingService/domain/project/service/ProjectServiceImpl.java index 78a777ef..4b3d8527 100644 --- a/src/main/java/com/umc/networkingService/domain/project/service/ProjectServiceImpl.java +++ b/src/main/java/com/umc/networkingService/domain/project/service/ProjectServiceImpl.java @@ -103,30 +103,21 @@ public ProjectAllResponse inquiryProjects(Semester semester, ProjectType type, P .orElseGet(() -> projectRepository.findAllBySemester(semester, pageable)); } - return new ProjectAllResponse( - projects.stream().map(projectMapper::toProjectInfo).toList(), - projects.hasNext() - ); + return projectMapper.toProjectAllResponse(projects); } @Override public ProjectAllResponse inquiryHotProjects(Pageable pageable) { Page projects = projectRepository.findAll(pageable); - return new ProjectAllResponse( - projects.stream().map(projectMapper::toProjectInfo).toList(), - projects.hasNext() - ); + return projectMapper.toProjectAllResponse(projects); } @Override public ProjectAllResponse searchProject(String keyword, Pageable pageable){ Page projects = projectRepository.findByNameContainsOrTagContains(keyword, pageable); - return new ProjectAllResponse( - projects.stream().map(projectMapper::toProjectInfo).toList(), - projects.hasNext() - ); + return projectMapper.toProjectAllResponse(projects); } @Override diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 5dcdf205..9ed46296 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -13,7 +13,7 @@ spring: jpa: show-sql: true hibernate: - ddl-auto: create + ddl-auto: update properties: hibernate: format_sql: true \ No newline at end of file From 52c4cb34e06c954f4ccb11d97e482835c8b7d3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A4=80=EC=8D=A8=ED=81=AC?= Date: Sun, 18 Feb 2024 19:06:43 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=EC=B5=9C=EA=B7=BC=ED=99=9C=EB=8F=99?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20=EB=AF=B8=EC=A0=81=EC=9A=A9=20API=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/umc/networkingService/config/WebMvcConfig.java | 2 +- src/main/resources/application-local.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/umc/networkingService/config/WebMvcConfig.java b/src/main/java/com/umc/networkingService/config/WebMvcConfig.java index 8ec21f96..ea01ec0b 100644 --- a/src/main/java/com/umc/networkingService/config/WebMvcConfig.java +++ b/src/main/java/com/umc/networkingService/config/WebMvcConfig.java @@ -18,7 +18,7 @@ public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(lastActiveInterceptor) .addPathPatterns("/**") // 모든 요청에 대해 인터셉터 적용 .excludePathPatterns("/v3/**", "/swagger-ui/**") // 스웨거 요청은 제외 - .excludePathPatterns("/members/login"); // 로그인 API 제외 + .excludePathPatterns("/members/login", "/members"); // 로그인 및 회원가입 API 제외 } //cors 에러 해결 diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 9ed46296..5dcdf205 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -13,7 +13,7 @@ spring: jpa: show-sql: true hibernate: - ddl-auto: update + ddl-auto: create properties: hibernate: format_sql: true \ No newline at end of file From cc61f456eab7a72e4ec52c43a69a5f4462d77823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A4=80=EC=8D=A8=ED=81=AC?= Date: Sun, 18 Feb 2024 19:27:07 +0900 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=EC=B6=9C=EC=84=9D=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=20API=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/umc/networkingService/config/WebMvcConfig.java | 2 +- .../domain/member/service/MemberServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/umc/networkingService/config/WebMvcConfig.java b/src/main/java/com/umc/networkingService/config/WebMvcConfig.java index ea01ec0b..ab836dbd 100644 --- a/src/main/java/com/umc/networkingService/config/WebMvcConfig.java +++ b/src/main/java/com/umc/networkingService/config/WebMvcConfig.java @@ -18,7 +18,7 @@ public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(lastActiveInterceptor) .addPathPatterns("/**") // 모든 요청에 대해 인터셉터 적용 .excludePathPatterns("/v3/**", "/swagger-ui/**") // 스웨거 요청은 제외 - .excludePathPatterns("/members/login", "/members"); // 로그인 및 회원가입 API 제외 + .excludePathPatterns("/members/login", "/members", "/members/attend", "/invites/**"); // 로그인 및 회원가입 API 제외 } //cors 에러 해결 diff --git a/src/main/java/com/umc/networkingService/domain/member/service/MemberServiceImpl.java b/src/main/java/com/umc/networkingService/domain/member/service/MemberServiceImpl.java index b4d96e07..40205c52 100644 --- a/src/main/java/com/umc/networkingService/domain/member/service/MemberServiceImpl.java +++ b/src/main/java/com/umc/networkingService/domain/member/service/MemberServiceImpl.java @@ -150,9 +150,9 @@ public MemberSearchInfosResponse searchMemberInfo(Member loginMember, String key public MemberAttendResponse attendMember(Member loingMember) { Member member = loadEntity(loingMember.getId()); - LocalDate lastActiveDate = member.getLastActiveTime().toLocalDate(); + LocalDateTime lastActiveTime = member.getLastActiveTime(); - if (!lastActiveDate.equals(LocalDate.now())) { + if (lastActiveTime == null || !lastActiveTime.toLocalDate().equals(LocalDate.now())) { member.addRemainPoint(1L); return new MemberAttendResponse(true); }