Skip to content

Commit

Permalink
Merge pull request #91 from Clubber2024/#90-feat-swagger-설정
Browse files Browse the repository at this point in the history
feat:  swagger 설정
  • Loading branch information
sseongeun authored May 21, 2024
2 parents ef92a53 + fc49dde commit ec3fa4c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.clubber.ClubberServer.domain.club.repository.ClubRepository;
import com.clubber.ClubberServer.domain.club.service.ClubService;
import com.clubber.ClubberServer.global.config.swagger.DisableSwaggerSecurity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -17,13 +19,15 @@
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/clubs")
@Tag(name="[동아리/소모임]")
public class ClubController {

private final ClubService clubService;


// 중앙동아리 - 분과별 동아리 조회
@DisableSwaggerSecurity
@Operation(summary = "분과별 중앙동아리 조회")
@GetMapping(params="division")
public DivisionCenterDto getCentersByDivision(@RequestParam("division")String division){
return clubService.getClubDivision(division);
Expand All @@ -32,6 +36,7 @@ public DivisionCenterDto getCentersByDivision(@RequestParam("division")String di

// 소모임 - 학과별 소모임 조회
@DisableSwaggerSecurity
@Operation(summary = "학과별 소모임 조회")
@GetMapping(params="department")
public DepartmentSmallDto getSmallsByDepartment(@RequestParam("department")String department){
return clubService.getOneDepartmentClubs(department);
Expand All @@ -42,6 +47,7 @@ public DepartmentSmallDto getSmallsByDepartment(@RequestParam("department")Strin
/* === 중앙 동아리 & 소모임 공통 ===*/
// 개별 동아리 및 소모임 페이지 조회
@DisableSwaggerSecurity
@Operation(summary = "동아리 및 소모임 개별 페이지 조회")
@GetMapping("/{clubId}") //중앙동아리 및 소모임 개별 페이지 조회
public OneClubDto getOneClubInfo(@PathVariable("clubId")Long clubId){
return clubService.getIndividualPage(clubId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.clubber.ClubberServer.domain.club.repository.ClubRepository;
import com.clubber.ClubberServer.domain.club.service.ClubService;
import com.clubber.ClubberServer.global.config.swagger.DisableSwaggerSecurity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -15,11 +17,13 @@

@RestController
@RequiredArgsConstructor
@Tag(name = "[인기순위]")
public class PopularSortController {

private final ClubService clubService;

@DisableSwaggerSecurity
@Operation(summary="인기순위 조회")
@GetMapping("/v1/clubs/popular")
public List<PopularClubDto> getTop10PopularClubs(){
return clubService.getPopularClubs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
import com.clubber.ClubberServer.domain.club.repository.ClubRepository;
import com.clubber.ClubberServer.domain.club.service.ClubService;
import com.clubber.ClubberServer.global.config.swagger.DisableSwaggerSecurity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/clubs")
@Tag(name="[검색]")
public class SearchController {

private final ClubRepository clubRepository;
Expand All @@ -21,6 +24,7 @@ public class SearchController {

// hashtag 기반 검색
@DisableSwaggerSecurity
@Operation(summary="hashtag기반 검색")
@GetMapping(params="hashtag")
public HashtagDto searchByHashtag(@RequestParam("hashtag")String hashtag){
return clubService.getClubHashtag(hashtag);
Expand All @@ -29,6 +33,7 @@ public HashtagDto searchByHashtag(@RequestParam("hashtag")String hashtag){

// 동아리명 or 소모임명 기반 검색
@DisableSwaggerSecurity
@Operation(summary="동아리명 및 소모임명 기반 검색")
@GetMapping(params="clubName")
public OneClubDto searchByClubName(@RequestParam("clubName")String clubName){
return clubService.getClubByName(clubName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.clubber.ClubberServer.domain.notice.repository.NoticeRepository;
import com.clubber.ClubberServer.domain.notice.service.NoticeService;
import com.clubber.ClubberServer.global.config.swagger.DisableSwaggerSecurity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -14,11 +16,13 @@

@RestController
@RequiredArgsConstructor
@Tag(name="[공지사항]")
public class NoticeController {
private final NoticeService noticeService;
private final NoticeRepository noticeRepository;

@DisableSwaggerSecurity
@Operation(summary="공지사항 조회")
@GetMapping("/v1/notice")
public List<NoticesDto> getNotices(){
List<NoticesDto> notices=noticeService.getSortedNotices();
Expand Down

0 comments on commit ec3fa4c

Please sign in to comment.