Skip to content

Commit

Permalink
config: swagger scan 패키지를 수정한다. (#79)
Browse files Browse the repository at this point in the history
* feat: swagger scan 패키지를 수정한다.

* feat: 누락된 Tag, Operation을 추가한다.
  • Loading branch information
rlarltj authored May 1, 2024
1 parent 5232cd4 commit 4f9bc09
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import com.moneymong.domain.invitationcode.service.InvitationCodeService;
import com.moneymong.global.security.token.dto.jwt.JwtAuthentication;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

@Tag(name = "4. [초대코드]")
@RequestMapping("/api/v1/agencies/{agencyId}/invitation-code")
@RequiredArgsConstructor
@RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.context.annotation.Profile;

@Configuration
@Profile({"local", "dev", "prod"})
@Profile({"dev", "prod"})
public class OpenApiConfig {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.moneymong.global.image.dto.ImageDeleteRequest;
import com.moneymong.global.image.dto.ImageResponse;
import com.moneymong.global.image.service.ImageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
Expand All @@ -16,19 +18,22 @@
import static org.springframework.http.MediaType.*;
import static org.springframework.http.MediaType.MULTIPART_FORM_DATA_VALUE;

@Tag(name = "9. [이미지]")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/images")
public class ImageController {

private final ImageService imageService;

@Operation(summary = "이미지 업로드")
@PostMapping(consumes = {MULTIPART_FORM_DATA_VALUE, APPLICATION_JSON_VALUE})
public ImageResponse upload(@RequestPart("file") MultipartFile multipartFile) {
ImageResponse response = imageService.upload(multipartFile);
return response;
}

@Operation(summary = "이미지 삭제 API")
@DeleteMapping(consumes = APPLICATION_JSON_VALUE)
public void remove(@RequestBody ImageDeleteRequest deleteRequest) {
imageService.remove(deleteRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@
import com.moneymong.global.security.token.api.request.RefreshAccessTokenRequest;
import com.moneymong.global.security.token.api.response.TokenResponse;
import com.moneymong.global.security.token.service.TokenService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@Tag(name = "0. [로그인]")
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/tokens")
public class TokenController {

private final TokenService tokenService;

@Operation(summary = "AccessToken 갱신")
@PostMapping
public TokenResponse refreshAccessToken(@RequestBody RefreshAccessTokenRequest refreshAccessTokenRequest) {
String refreshToken = refreshAccessTokenRequest.getRefreshToken();
return tokenService.getAccessTokensByRefreshToken(refreshToken);
}

@Operation(summary = "로그아웃")
@DeleteMapping
public void deleteRefreshToken(@RequestBody DeleteRefreshTokenRequest deleteRefreshTokenRequest) {
String refreshToken = deleteRefreshTokenRequest.getRefreshToken();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ management:

# swagger
springdoc:
packages-to-scan: com.moneymong.domain
packages-to-scan: com.moneymong
default-consumes-media-type: application/json;charset=UTF-8
default-produces-media-type: application/json;charset=UTF-8
swagger-ui:
Expand Down

0 comments on commit 4f9bc09

Please sign in to comment.