Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 개발질문 게시판의 해시태그 기능 구현 완료 #629

Merged
merged 27 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
443535b
feat(Hashtag): Hashtag와 BoardHashtag 관련 entity와 domain 객체 설계
mingmingmon Dec 14, 2024
2c83f45
feat(HashtagRegister): 해시태그 등록 api 작성
mingmingmon Dec 14, 2024
6480448
feat(BoardRegister): 게시글 생성 시 개발질문 카테고리인 경우 해시태그 저장 로직 추가
mingmingmon Dec 14, 2024
3f32633
refactor(BoardDtoMapper): 게시판 관련 응답 시 해시태그 정보를 포함하도록 수정
mingmingmon Dec 14, 2024
1ca7590
feat(BoardUpdate): 게시글 수정 시 해시태그의 변경 로직 추가
mingmingmon Dec 14, 2024
6b2a81e
feat(BoardsByHashtagRetrievalController): 해시태그로 게시글 조회하는 API 작성
mingmingmon Dec 14, 2024
4c4a70d
fix(BoardsByHashtagRetrievalService): 잘못된 페이지네이션 수정
mingmingmon Dec 14, 2024
8496bd4
refactor(BoardRegisterController): 개발질문 게시판이 아닌 게시판에 해시태그 등록할 경우 예외발생…
mingmingmon Dec 14, 2024
c85f96b
fix(BoardRegisterService, BoardUpdateService): 개발질문 카테고리가 아닌 경우 해시태그 …
mingmingmon Dec 15, 2024
1527242
refactor(BoardHashtagPersistenceAdapter): repository 변수명 앞에 도메인명 삭제
mingmingmon Dec 22, 2024
0a53dd5
refactor(BoardHashtagRepository): SQL문에 개행추가, customRepository에서 JPQL…
mingmingmon Dec 22, 2024
991b9a1
refactor(ExternalBoardHashtag): external 패키지 아래에 위치했던 boardHashtag 관련…
mingmingmon Dec 22, 2024
32fe799
refactor(BoardRegisterService): 게시글 등록 시 해시태그를 표현할 수 있는 카테고리인지 검증하는 로…
mingmingmon Dec 22, 2024
8198678
refactor(BoardHashtagRegisterService): 존재하는 hashtag인지 판단하는 로직 메소드로 표현
mingmingmon Dec 22, 2024
2538b6a
refactor(BoardUpdateService): 복잡한 로직 메소드 추출 및 board update API에서 해시태그…
mingmingmon Dec 22, 2024
b01237d
refactor: 코드 컨벤션 준수하도록 수정
mingmingmon Dec 22, 2024
35f0975
refactor(HashtagRegisterController): 해시태그 등록 권한 수정, 응답 형식 수정 및 도메인 제약…
mingmingmon Dec 22, 2024
7fd88ae
refactor(BoardUpdateService): 사용하지 않는 로깅 코드 삭제
mingmingmon Dec 22, 2024
56b7c5e
feat(HashtagRetrievalController): 존재하는 해시태그 정보 조회하는 API 작성
mingmingmon Dec 22, 2024
b0103cf
refactor(BoardUpdateService): boardHashtag의 변화에 따른 hashtag의 boardUsag…
mingmingmon Dec 22, 2024
d92d201
refactor(HashtagPersistenceAdapter): 이름으로 해시태그를 찾을 때 없는 경우 notfound 예…
mingmingmon Dec 22, 2024
c682599
refactor(HashtagRetrievlaController): 권한 수정
mingmingmon Dec 22, 2024
7d925d3
refactor: 통일된 import문 정렬과 코드 정리 방식을 활용한 정리
mingmingmon Dec 22, 2024
df6ac3a
Merge branch 'develop' into feat/#609
mingmingmon Dec 22, 2024
be6d91d
refactor(HotBoardRetrievalService): 핫 게시글 응답에 HashtagInfo 필드 추가
mingmingmon Dec 22, 2024
fb49e64
refactor(BoardRegisterService): 중복된 해시태그 등록 가능 검사 삭제 및 코드컨벤션 준수
mingmingmon Dec 24, 2024
c33240f
refactor(BoardHashtagRepository): group by와 distinct 동시 사용 대신 group b…
mingmingmon Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -33,8 +34,6 @@
import page.clab.api.global.exception.SortingArgumentException;
import page.clab.api.global.util.PageableUtils;

import java.util.List;

@RestController
@RequestMapping("/api/v1/activity-group/admin")
@RequiredArgsConstructor
Expand All @@ -48,7 +47,7 @@ public class ActivityGroupAdminController {
@PreAuthorize("hasRole('USER')")
@PostMapping("")
public ApiResponse<Long> createActivityGroup(
@Valid @RequestBody ActivityGroupRequestDto requestDto
@Valid @RequestBody ActivityGroupRequestDto requestDto
) {
Long id = activityGroupAdminService.createActivityGroup(requestDto);
return ApiResponse.success(id);
Expand All @@ -58,8 +57,8 @@ public ApiResponse<Long> createActivityGroup(
@PreAuthorize("hasRole('USER')")
@PatchMapping("/{activityGroupId}")
public ApiResponse<Long> updateActivityGroup(
@PathVariable(name = "activityGroupId") Long activityGroupId,
@Valid @RequestBody ActivityGroupUpdateRequestDto requestDto
@PathVariable(name = "activityGroupId") Long activityGroupId,
@Valid @RequestBody ActivityGroupUpdateRequestDto requestDto
) throws PermissionDeniedException {
Long id = activityGroupAdminService.updateActivityGroup(activityGroupId, requestDto);
return ApiResponse.success(id);
Expand All @@ -69,30 +68,31 @@ public ApiResponse<Long> updateActivityGroup(
@PreAuthorize("hasRole('ADMIN')")
@PatchMapping("manage/{activityGroupId}")
public ApiResponse<ActivityGroupBoardStatusUpdatedResponseDto> manageActivityGroupStatus(
@PathVariable(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "activityGroupStatus") ActivityGroupStatus status
@PathVariable(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "activityGroupStatus") ActivityGroupStatus status
) {
ActivityGroupBoardStatusUpdatedResponseDto updatedStatusDto = activityGroupAdminService.manageActivityGroup(activityGroupId, status);
ActivityGroupBoardStatusUpdatedResponseDto updatedStatusDto = activityGroupAdminService.manageActivityGroup(
activityGroupId, status);
return ApiResponse.success(updatedStatusDto);
}

@Operation(summary = "[A] 활동 삭제", description = "ROLE_USER 이상의 권한이 필요함")
@PreAuthorize("hasRole('USER')")
@DeleteMapping("/{activityGroupId}")
public ApiResponse<Long> deleteActivityGroup(
@PathVariable(name = "activityGroupId") Long activityGroupId
@PathVariable(name = "activityGroupId") Long activityGroupId
) throws PermissionDeniedException {
Long id = activityGroupAdminService.deleteActivityGroup(activityGroupId);
return ApiResponse.success(id);
}

@Operation(summary = "[U] 프로젝트 진행도 수정", description = "ROLE_USER 이상의 권한이 필요함<br>" +
"진행도는 0~100 사이의 값으로 입력해야 함")
"진행도는 0~100 사이의 값으로 입력해야 함")
@PreAuthorize("hasRole('USER')")
@PatchMapping("/progress/{activityGroupId}")
public ApiResponse<Long> updateProjectProgress(
@PathVariable(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "progress") Long progress
@PathVariable(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "progress") Long progress
) throws PermissionDeniedException {
Long id = activityGroupAdminService.updateProjectProgress(activityGroupId, progress);
return ApiResponse.success(id);
Expand All @@ -102,52 +102,54 @@ public ApiResponse<Long> updateProjectProgress(
@PreAuthorize("hasRole('USER')")
@PostMapping("/schedule")
public ApiResponse<Long> addSchedule(
@RequestParam(name = "activityGroupId") Long activityGroupId,
@Valid @RequestBody List<GroupScheduleDto> scheduleDtos
@RequestParam(name = "activityGroupId") Long activityGroupId,
@Valid @RequestBody List<GroupScheduleDto> scheduleDtos
) throws PermissionDeniedException {
Long id = activityGroupAdminService.addSchedule(activityGroupId, scheduleDtos);
return ApiResponse.success(id);
}

@Operation(summary = "[U] 활동 멤버 및 지원서 조회", description = "ROLE_USER 이상의 권한이 필요함<br>" +
"관리자 또는 리더만 조회 가능<br>" +
"DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
"관리자 또는 리더만 조회 가능<br>" +
"DTO의 필드명을 기준으로 정렬 가능하며, 정렬 방향은 오름차순(asc)과 내림차순(desc)이 가능함")
@PreAuthorize("hasRole('USER')")
@GetMapping("/members")
public ApiResponse<PagedResponseDto<ActivityGroupMemberWithApplyReasonResponseDto>> getApplyGroupMemberList(
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "20") int size,
@RequestParam(name = "sortBy", defaultValue = "status") List<String> sortBy,
@RequestParam(name = "sortDirection", defaultValue = "asc") List<String> sortDirection
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "20") int size,
@RequestParam(name = "sortBy", defaultValue = "status") List<String> sortBy,
@RequestParam(name = "sortDirection", defaultValue = "asc") List<String> sortDirection
) throws SortingArgumentException, PermissionDeniedException, InvalidColumnException {
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection, ActivityGroupMemberWithApplyReasonResponseDto.class);
PagedResponseDto<ActivityGroupMemberWithApplyReasonResponseDto> groupMembers = activityGroupAdminService.getGroupMembersWithApplyReason(activityGroupId, pageable);
Pageable pageable = pageableUtils.createPageable(page, size, sortBy, sortDirection,
ActivityGroupMemberWithApplyReasonResponseDto.class);
PagedResponseDto<ActivityGroupMemberWithApplyReasonResponseDto> groupMembers = activityGroupAdminService.getGroupMembersWithApplyReason(
activityGroupId, pageable);
return ApiResponse.success(groupMembers);
}

@Operation(summary = "[U] 신청 멤버 상태 변경", description = "ROLE_USER 이상의 권한이 필요함")
@PreAuthorize("hasRole('USER')")
@PatchMapping("/accept")
public ApiResponse<Long> acceptGroupMember(
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "memberId") List<String> memberIds,
@RequestParam(name = "status") GroupMemberStatus status
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "memberId") List<String> memberIds,
@RequestParam(name = "status") GroupMemberStatus status
) throws PermissionDeniedException {
Long id = activityGroupAdminService.manageGroupMemberStatus(activityGroupId, memberIds, status);
return ApiResponse.success(id);
}

@Operation(summary = "[U] 활동 멤버 직책 변경", description = "ROLE_USER 이상의 권한이 필요함<br><br>" +
"직책은 팀장만 변경 가능<br>" +
"LEADER: 팀장, MEMBER: 팀원, NONE: 없음<br>" +
"LEADER -> MEMBER, MEMBER -> LEADER 변경만 허용함")
"직책은 팀장만 변경 가능<br>" +
"LEADER: 팀장, MEMBER: 팀원, NONE: 없음<br>" +
"LEADER -> MEMBER, MEMBER -> LEADER 변경만 허용함")
@PreAuthorize("hasRole('USER')")
@PatchMapping("/position")
public ApiResponse<Long> changeGroupMemberPosition(
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "memberId") String memberId,
@RequestParam(name = "position") ActivityGroupRole position
@RequestParam(name = "activityGroupId") Long activityGroupId,
@RequestParam(name = "memberId") String memberId,
@RequestParam(name = "position") ActivityGroupRole position
) throws PermissionDeniedException {
Long id = activityGroupAdminService.changeGroupMemberPosition(activityGroupId, memberId, position);
return ApiResponse.success(id);
Expand All @@ -157,11 +159,12 @@ public ApiResponse<Long> changeGroupMemberPosition(
@Operation(summary = "[S] 삭제된 활동그룹 조회하기", description = "ROLE_SUPER 이상의 권한이 필요함")
@PreAuthorize("hasRole('SUPER')")
public ApiResponse<PagedResponseDto<ActivityGroupResponseDto>> getDeletedActivityGroups(
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "20") int size
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "20") int size
) {
Pageable pageable = PageRequest.of(page, size);
PagedResponseDto<ActivityGroupResponseDto> activityGroups = activityGroupAdminService.getDeletedActivityGroups(pageable);
PagedResponseDto<ActivityGroupResponseDto> activityGroups = activityGroupAdminService.getDeletedActivityGroups(
pageable);
return ApiResponse.success(activityGroups);
}
}
Loading
Loading