Skip to content

Commit

Permalink
Merge pull request #105 from TaetaetaE01/main
Browse files Browse the repository at this point in the history
각 도메인 페이지네이션 error fix
  • Loading branch information
TaetaetaE01 authored Aug 16, 2024
2 parents 696c0ac + 425f83f commit 345b4a9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ResponseEntity<ApiResponse<Page<CampusNotice>>> getCampusNoticeList(@Requ
}

@PostMapping
public ResponseEntity<ApiResponse<Void>> crawlerNotice(){
public ResponseEntity<ApiResponse<Void>> crawlerNotice() {
lambdaUtil.invokeLambda();
return ResponseEntity.ok().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void invokeLambda(String functionName, String payload, CampusNoticeType n
CampusNoticeRegisterRequest[] campusNoticeRegisterRequests =
objectMapper.readValue(body, CampusNoticeRegisterRequest[].class);
List<CampusNotice> campusNotices = new ArrayList<>();
for (CampusNoticeRegisterRequest campusNoticeRegisterRequest : campusNoticeRegisterRequests){
for (CampusNoticeRegisterRequest campusNoticeRegisterRequest : campusNoticeRegisterRequests) {
CampusNotice campusNotice = campusNoticeRegisterRequest.toCampusNoticeEntity(fileService, noticeType);
campusNotices.add(campusNotice);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import java.util.List;


@RequestMapping(SecurityConfig.SERVER+"/members")
@RequestMapping(SecurityConfig.SERVER + "/members")
@Tag(name = "멤버", description = "회원가입,로그인 API")
public interface MemberController {

Expand All @@ -50,7 +50,7 @@ public interface MemberController {
ResponseEntity<com.example.bigbrotherbe.global.exception.response.ApiResponse<JwtToken>> signIn(@RequestBody MemberRequest memberRequest);

@PostMapping("/test")
@Operation(summary = "test용", description = "현재는 로그인 멤버의 AffiliationRoleLost를 가져오는 값")
@Operation(summary = "test용", description = "현재는 로그인 멤버의 AffiliationRoleList 가져오는 값")
ResponseEntity<com.example.bigbrotherbe.global.exception.response.ApiResponse<AffiliationListDto>> test();

@GetMapping("/information")
Expand Down Expand Up @@ -85,10 +85,9 @@ public interface MemberController {
@Operation(summary = "refresh 토큰으로 토큰 재 생성 요청")
ResponseEntity<com.example.bigbrotherbe.global.exception.response.ApiResponse<TokenDto>> refreshToken(@RequestHeader("Authorization") String refreshToken);


@DeleteMapping
@Operation(summary = "유저 탈퇴")
ResponseEntity<com.example.bigbrotherbe.global.exception.response.ApiResponse<Void>> memberDeleteSelf();
ResponseEntity<com.example.bigbrotherbe.global.exception.response.ApiResponse<Void>> memberDeleteSelf();

@PatchMapping("/information")
@Operation(summary = "유저 상세 정보 변경")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.example.bigbrotherbe.domain.member.entity.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

public enum CouncilType {
GENERAL_STUDENTS_ASSOCIATION("총학"),
COLLEGE("단과대"),
Expand All @@ -23,4 +25,5 @@ public static CouncilType fromcouncilType(String councilType) {
}
throw new IllegalArgumentException("없는 CouncilType입니다." + councilType);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.bigbrotherbe.domain.member.entity.Member;
import com.example.bigbrotherbe.domain.notice.dto.response.NoticeResponse;
import com.example.bigbrotherbe.domain.notice.entity.Notice;
import com.example.bigbrotherbe.domain.member.service.MemberService;
import com.example.bigbrotherbe.domain.notice.dto.request.NoticeModifyRequest;
import com.example.bigbrotherbe.domain.notice.dto.request.NoticeRegisterRequest;
import com.example.bigbrotherbe.domain.notice.repository.NoticeRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.example.bigbrotherbe.domain.member.repository.AffiliationRepository;
import com.example.bigbrotherbe.domain.member.repository.MemberRepository;
import com.example.bigbrotherbe.global.jwt.entity.JwtToken;

import java.util.List;

import com.example.bigbrotherbe.global.exception.BusinessException;
Expand Down Expand Up @@ -74,7 +75,7 @@ public Long getAffiliationIdByMemberId(Long memberId, String affiliation) {
}

return affiliationMemberRepository.findAllByMemberId(memberId).stream()
.map(am -> affiliationRepository.findById(am.getId()))
.map(am -> affiliationRepository.findById(am.getAffiliation().getAffiliation_id()))
.filter(optAffiliation -> optAffiliation.isPresent() &&
affiliation.equals(optAffiliation.get().getCouncilType()))
.map(optAffiliation -> optAffiliation.get().getAffiliation_id())
Expand Down
32 changes: 16 additions & 16 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
spring:
datasource:
url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER_NAME}
password: ${DB_PASSWORD}
datasource:
url: ${DB_URL}
driver-class-name: com.mysql.cj.jdbc.Driver
username: ${DB_USER_NAME}
password: ${DB_PASSWORD}

# 태태 로컬 데이터베이스 설정
# datasource:
# url: jdbc:mysql://localhost:3306/bigbrother
# driver-class-name: com.mysql.cj.jdbc.Driver
# username: root
# password: 1234
# datasource:
# url: jdbc:mysql://localhost:3306/bigbrother
# driver-class-name: com.mysql.cj.jdbc.Driver
# username: root
# password: 1234

jpa:
jpa:
hibernate:
ddl-auto: update
properties:
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
show_sql: true
format_sql: true
show_sql: true
2 changes: 1 addition & 1 deletion src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spring:

jpa:
hibernate:
ddl-auto: create-drop
ddl-auto: update
properties:
hibernate:
format_sql: true
Expand Down

0 comments on commit 345b4a9

Please sign in to comment.