diff --git a/build.gradle b/build.gradle index 5c70d98b..644e4536 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,10 @@ dependencies { //spring aop implementation 'org.springframework.boot:spring-boot-starter-aop' + + //Swagger + implementation group: 'io.springfox', name: 'springfox-swagger2', version: '3.0.0' + implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2' } tasks.named('test') { diff --git a/src/main/java/com/sptp/backend/common/config/SwaggerConfig.java b/src/main/java/com/sptp/backend/common/config/SwaggerConfig.java new file mode 100644 index 00000000..61c40f8e --- /dev/null +++ b/src/main/java/com/sptp/backend/common/config/SwaggerConfig.java @@ -0,0 +1,40 @@ +package com.sptp.backend.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.Collections; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2) + .ignoredParameterTypes(AuthenticationPrincipal.class) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() + .apiInfo(apiInfo()); + } + + private ApiInfo apiInfo() { + return new ApiInfo( + "Atties REST API TEST", + "아띠즈 API 문서 목록", + "V1", + "Terms of service", + new Contact("administrator", "www.example.com", "administrator@email.com"), + "License of API", "www.example.com", Collections.emptyList()); + } +} \ No newline at end of file diff --git a/src/main/java/com/sptp/backend/common/config/WebSecurityConfig.java b/src/main/java/com/sptp/backend/common/config/WebSecurityConfig.java index dc070b1e..24a64c6b 100644 --- a/src/main/java/com/sptp/backend/common/config/WebSecurityConfig.java +++ b/src/main/java/com/sptp/backend/common/config/WebSecurityConfig.java @@ -53,6 +53,14 @@ protected void configure(HttpSecurity http) throws Exception { .antMatchers(HttpMethod.PATCH, "/artists").hasAnyRole("ARTIST", "ADMIN") .antMatchers(HttpMethod.POST, "/art-works").hasAnyRole("ARTIST", "ADMIN") .antMatchers("/admin/**").hasRole("ADMIN") + .antMatchers("/swagger-ui/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/swagger-ui.html").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/api/v2/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/v2/api-docs/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/swagger/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/swagger-resources/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .antMatchers("/webjars/**").permitAll() // TODO : 추후에 따로 권한 설정 논의 필요 + .anyRequest().authenticated(); // 그외 나머지 요청은 인증 필요 http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); @@ -76,6 +84,7 @@ public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.addAllowedOrigin("http://localhost:3000"); + configuration.addAllowedOrigin("http://localhost:8080"); configuration.addAllowedOrigin("https://atties.vercel.app"); configuration.addAllowedOrigin("https://attiess.netlify.app"); configuration.addAllowedHeader("*"); diff --git a/src/main/java/com/sptp/backend/member/web/MemberController.java b/src/main/java/com/sptp/backend/member/web/MemberController.java index 00346761..39b5c6b5 100644 --- a/src/main/java/com/sptp/backend/member/web/MemberController.java +++ b/src/main/java/com/sptp/backend/member/web/MemberController.java @@ -7,9 +7,13 @@ import com.sptp.backend.member.repository.Member; import com.sptp.backend.member.service.MemberService; import com.sptp.backend.email.service.EmailService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.*; @@ -21,6 +25,7 @@ import java.util.List; import java.util.Map; +@Api(tags = {"회원 관련 API"}) @RestController @RequiredArgsConstructor @Slf4j @@ -31,6 +36,7 @@ public class MemberController { private final JwtService jwtService; // 회원가입 + @ApiOperation(value = "로컬 회원 가입 API", notes = "로컬 개발 전용 회원 가입 API") @PostMapping("/members/join") public ResponseEntity join(@RequestBody MemberSaveRequestDto memberSaveRequestDto) { @@ -48,6 +54,7 @@ public ResponseEntity join(@RequestBody MemberSaveRequest } // 로그인 + @ApiOperation(value = "로컬 로그인 API", notes = "유저 아이디와 패스워드를 통해 로그인합니다.") @PostMapping("/members/login") public ResponseEntity login(@RequestBody MemberLoginRequestDto memberLoginRequestDto) { @@ -57,6 +64,7 @@ public ResponseEntity login(@RequestBody MemberLoginRequ } // 토큰 재발급 + @ApiOperation(value = "토큰 재발급 API", notes = "JWT 토큰을 message body에 넣어 요청합니다.") @PostMapping("/members/token") public ResponseEntity refresh(@RequestBody Map refreshToken) { @@ -72,6 +80,7 @@ public ResponseEntity refresh(@RequestBody Map } // 로그아웃 + @ApiOperation(value = "회원 로그아웃 API", notes = "JWT 토큰을 헤더에 넣어 요청합니다.") @PostMapping("/members/logout") public ResponseEntity logout(@RequestHeader("Authorization") String accessToken) { @@ -81,6 +90,7 @@ public ResponseEntity logout(@RequestHeader("Authorization") String access } // 아이디 찾기 + @ApiOperation(value = "아이디 찾기 API", notes = "message body에 email 값을 넣어 요청합니다.") @PostMapping("/members/id") public ResponseEntity findId(@RequestBody Map paramMap) throws Exception { @@ -92,6 +102,7 @@ public ResponseEntity findId(@RequestBody Map paramMap) th } // 비밀번호 임시 발급 + @ApiOperation(value = "비밀번호 임시발급 API", notes = "message body에 email 값을 넣어 요청합니다.") @PostMapping("/members/new-password") public ResponseEntity sendNewPassword(@RequestBody Map paramMap) throws Exception { @@ -103,6 +114,7 @@ public ResponseEntity sendNewPassword(@RequestBody Map par } // 아이디 중복 체크 + @ApiOperation(value = "아이디 중복 체크 API", notes = "URL 파라미터에 userId 값을 넣어 요청합니다.") @GetMapping("/members/check-id") public ResponseEntity checkUserId(@RequestParam("userId") String userId) { @@ -112,6 +124,7 @@ public ResponseEntity checkUserId(@RequestParam("userId") String userId) { } // 이메일 중복 체크 + @ApiOperation(value = "이메일 중복 체크 API", notes = "URL 파라미터에 email 값을 넣어 요청합니다.") @GetMapping("/members/check-email") public ResponseEntity checkUserEmail(@RequestParam("email") String email) { @@ -121,6 +134,7 @@ public ResponseEntity checkUserEmail(@RequestParam("email") String email) } // 닉네임 중복 체크 + @ApiOperation(value = "닉네임 중복 체크 API", notes = "URL 파라미터에 nickname 값을 넣어 요청합니다.") @GetMapping("/members/check-nickname") public ResponseEntity checkUserNickname(@RequestParam("nickname") String nickname) { @@ -130,6 +144,7 @@ public ResponseEntity checkUserNickname(@RequestParam("nickname") String n } // 비밀번호 재설정 + @ApiOperation(value = "비밀번호 재설정 API", notes = "header에 JWT 토큰, message body에 password 값을 넣어 요청합니다.") @PatchMapping("/members/password") public ResponseEntity changePassword( @RequestBody @Valid PasswordChangeRequest passwordChangeRequest, @@ -141,6 +156,7 @@ public ResponseEntity changePassword( } // 회원 탈퇴 + @ApiOperation(value = "회원 탈퇴 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @DeleteMapping("/members") public ResponseEntity withdrawUser( @RequestHeader("Authorization") String accessToken, @@ -153,7 +169,9 @@ public ResponseEntity withdrawUser( } // 회원 정보 수정 - @PatchMapping("/members") + // TODO : MultipartFile image를 Request Dto 안에 포함해야 Swagger에서 인식 + @ApiOperation(value = "회원 정보 수정 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") + @PatchMapping(value = "/members") public ResponseEntity updateUser(@AuthenticationPrincipal CustomUserDetails userDetails, @RequestParam(value = "image", required = false) MultipartFile image, MemberUpdateRequest memberUpdateRequest) throws IOException { @@ -164,6 +182,7 @@ public ResponseEntity updateUser(@AuthenticationPrincipal CustomUserDetail } // 작가 정보 수정 + @ApiOperation(value = "작가 정보 수정 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @PatchMapping("/artists") public ResponseEntity updateArtist(@AuthenticationPrincipal CustomUserDetails userDetails, @RequestParam(value = "image", required = false) MultipartFile image, @@ -175,6 +194,7 @@ public ResponseEntity updateArtist(@AuthenticationPrincipal CustomUserDeta } // 작가 인증 파일 보내기 + @ApiOperation(value = "작가 인증 파일 전송 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @PatchMapping("/members/certification") public ResponseEntity certifyArtist(@AuthenticationPrincipal CustomUserDetails userDetails, @RequestParam(value = "certificationImage", required = true) MultipartFile image) throws IOException { @@ -185,6 +205,7 @@ public ResponseEntity certifyArtist(@AuthenticationPrincipal CustomUserDet } // 작가 인증 파일 목록 조회 + @ApiOperation(value = "관리자 작가 인증 파일 조회 API", notes = "") @GetMapping("/admin/members/certification") public ResponseEntity> certificationList() { @@ -194,6 +215,7 @@ public ResponseEntity> certificationList() { } // roles 작가로 전환 + @ApiOperation(value = "작가 전환 API", notes = "URL에 memberId 값을 넣어 요청합니다.") @PatchMapping("/admin/roles/{memberId}") public ResponseEntity changeToArtist(@PathVariable(value = "memberId") Long memberId) { @@ -207,6 +229,7 @@ public ResponseEntity changeToArtist(@PathVariable(value = } // 회원 정보 조회 + @ApiOperation(value = "회원 정보 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @GetMapping("/members/me") public ResponseEntity getMember(@AuthenticationPrincipal CustomUserDetails userDetails) { @@ -216,6 +239,7 @@ public ResponseEntity getMember(@AuthenticationPrincipal CustomU } // 회원-작가 픽 관계 등록 (작가 픽하기) + @ApiOperation(value = "작가 픽하기 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 artistId 값을 넣어 요청합니다.") @PostMapping("/members/preferred-artists/{artistId}") public ResponseEntity pickArtist(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "artistId") Long artistId) { @@ -226,6 +250,7 @@ public ResponseEntity pickArtist(@AuthenticationPrincipal CustomUserDetail } // 회원-작가 픽 관계 취소 + @ApiOperation(value = "작가 픽 취소 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 artistId 값을 넣어 요청합니다.") @DeleteMapping("/members/preferred-artists/{artistId}") public ResponseEntity deletePickArtist(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "artistId") Long artistId) { @@ -236,6 +261,7 @@ public ResponseEntity deletePickArtist(@AuthenticationPrincipal CustomUser } // 회원-작가 픽 목록 조회 + @ApiOperation(value = "작가 픽 목록 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @GetMapping("/members/preferred-artists") public ResponseEntity> preferredArtistList(@AuthenticationPrincipal CustomUserDetails userDetails) { @@ -245,6 +271,7 @@ public ResponseEntity> preferredArtistList(@Authen } // 작가 상세 조회 + @ApiOperation(value = "작가 상세 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다, URL에 artistId 값을 넣어 요청합니다.") @GetMapping("/artists/{artistId}") public ResponseEntity getArtistDetail(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "artistId") Long artistId) { @@ -253,6 +280,7 @@ public ResponseEntity getArtistDetail(@AuthenticationPrinc } // 회원-작품 찜 관계 등록 (작품 찜하기) + @ApiOperation(value = "작품 찜하기 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 artWorkId 값을 넣어 요청합니다.") @PostMapping("/members/preferred-artworks/{artWorkId}") public ResponseEntity pickArtWork(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "artWorkId") Long artWorkId) { @@ -263,6 +291,7 @@ public ResponseEntity pickArtWork(@AuthenticationPrincipal CustomUserDetai } // 회원-작품 찜 관계 취소 + @ApiOperation(value = "작품 찜 취소 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 artWorkId 값을 넣어 요청합니다.") @DeleteMapping("/members/preferred-artworks/{artWorkId}") public ResponseEntity deletePickArtWork(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "artWorkId") Long artWorkId) { @@ -273,6 +302,7 @@ public ResponseEntity deletePickArtWork(@AuthenticationPrincipal CustomUse } // 회원-작품 찜 목록 조회 + @ApiOperation(value = "작품 찜 목록 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @GetMapping("/members/preferred-artworks") public ResponseEntity> preferredArtWorkList(@AuthenticationPrincipal CustomUserDetails userDetails) { @@ -282,6 +312,7 @@ public ResponseEntity> preferredArtWorkList(@Auth } // 회원-작품 취향 맞춤 추천 목록 조회 + @ApiOperation(value = "추천 작품 목록 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, 쿼리 파라미터에 page, limit 값을 넣어 요청합니다.") @GetMapping("/members/customized-artworks") public ResponseEntity customizedArtWorkList(@AuthenticationPrincipal CustomUserDetails userDetails, @RequestParam("page") Integer page, @RequestParam("limit") Integer limit) { @@ -292,6 +323,7 @@ public ResponseEntity customizedArtWorkList(@Authenti } // 일대일 문의 + @ApiOperation(value = "일대일 문의 등록 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @PostMapping("/members/ask") public ResponseEntity saveAsk(@AuthenticationPrincipal CustomUserDetails userDetails, MemberAskRequestDto memberAskRequestDto) throws IOException { @@ -302,6 +334,7 @@ public ResponseEntity saveAsk(@AuthenticationPrincipal CustomUserDetails u } // 일대일 문의 수정 + @ApiOperation(value = "일대일 문의 수정 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 askId 값을 넣어 요청합니다.") @PatchMapping("/members/ask/{askId}") public ResponseEntity updateAsk(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "askId") Long askId, @@ -313,6 +346,7 @@ public ResponseEntity updateAsk(@AuthenticationPrincipal CustomUserDetails } // 일대일 문의 삭제 + @ApiOperation(value = "일대일 문의 삭제 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 askId 값을 넣어 요청합니다.") @DeleteMapping("/members/ask/{askId}") public ResponseEntity deleteAsk(@AuthenticationPrincipal CustomUserDetails userDetails, @PathVariable(value = "askId") Long askId) throws IOException { @@ -323,6 +357,7 @@ public ResponseEntity deleteAsk(@AuthenticationPrincipal CustomUserDetails } // 일대일 문의 목록 조회 + @ApiOperation(value = "일대일 문의 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @GetMapping("/members/ask") public ResponseEntity> getAskList(@AuthenticationPrincipal CustomUserDetails userDetails) { @@ -332,6 +367,7 @@ public ResponseEntity> getAskList(@AuthenticationPrincip } // 관리자 일대일 문의 목록 조회 + @ApiOperation(value = "관리자 일대일 문의 조회 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @GetMapping("/admin/members/ask") public ResponseEntity> getAllAskList() { @@ -341,6 +377,7 @@ public ResponseEntity> getAllAskList() { } // 일대일 문의 답변 + @ApiOperation(value = "일대일 문의 답변 API", notes = "헤더에 JWT 토큰 값을 넣어 요청, URL에 askId 값을 넣어 요청합니다.") @PatchMapping("/admin/members/answer/{askId}") public ResponseEntity updateAnswer(@PathVariable(value = "askId") Long askId, @RequestBody MemberAnswerRequest memberAnswerRequest) { @@ -351,6 +388,7 @@ public ResponseEntity updateAnswer(@PathVariable(value = "askId") Long ask } // 관심 키워드 수정 + @ApiOperation(value = "관심 키워드 수정 API", notes = "헤더에 JWT 토큰 값을 넣어 요청합니다.") @PatchMapping("/members/keywords") public ResponseEntity> updateKeywords(@AuthenticationPrincipal CustomUserDetails userDetails, @RequestBody MemberUpdateKeywordsRequestDto memberUpdateKeywordsRequestDto) { diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/ArtistUpdateRequest.java b/src/main/java/com/sptp/backend/member/web/dto/request/ArtistUpdateRequest.java index a9e517d5..223f7ca3 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/ArtistUpdateRequest.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/ArtistUpdateRequest.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import java.util.List; @@ -11,14 +12,24 @@ @Builder public class ArtistUpdateRequest { + @ApiModelProperty(required = true, value = "유저 닉네임", example = "아라") private String nickname; + @ApiModelProperty(required = true, value = "유저 이메일", example = "test1234@naver.com") private String email; + @ApiModelProperty(required = true, value = "학력", example = "xx대학교 xx학과") private String education; + @ApiModelProperty(required = true, value = "이력", example = "이력입니다.") private String history; + @ApiModelProperty(required = true, value = "소개,설명", example = "소개글입니다.") private String description; + @ApiModelProperty(required = true, value = "인스타그램 주소", example = "www.instagram.com") private String instagram; + @ApiModelProperty(required = true, value = "비헨스 주소", example = "www.behance.com") private String behance; + @ApiModelProperty(required = true, value = "유저 주소", example = "서울시 xx구 xx동 123동 1234호") private String address; + @ApiModelProperty(required = true, value = "유저 연락처", example = "01012345678") private String telephone; + @ApiModelProperty(required = true, value = "이미지 변경 여부", example = "true") private Boolean isChanged; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberAnswerRequest.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberAnswerRequest.java index a21389dd..ea3feb52 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberAnswerRequest.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberAnswerRequest.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; @Getter @@ -9,5 +10,6 @@ @Builder public class MemberAnswerRequest { + @ApiModelProperty(required = true, value = "문의 글 답변", example = "답변") private String answer; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberAskRequestDto.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberAskRequestDto.java index 428f3ef1..a0139ca6 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberAskRequestDto.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberAskRequestDto.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import org.springframework.web.multipart.MultipartFile; @@ -10,7 +11,10 @@ @Builder public class MemberAskRequestDto { + @ApiModelProperty(required = true, value = "문의 글 제목", example = "제목") private String title; + @ApiModelProperty(required = true, value = "문의 글 내용", example = "내용") private String content; + @ApiModelProperty(required = true, value = "문의 글 첨부 사진") private MultipartFile[] image; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberLoginRequestDto.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberLoginRequestDto.java index 9b7d3a1f..73c4c79f 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberLoginRequestDto.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberLoginRequestDto.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; @Getter @@ -9,6 +10,8 @@ @Builder public class MemberLoginRequestDto { + @ApiModelProperty(required = true, value = "유저 아이디", example = "test1234") private String userId; + @ApiModelProperty(required = true, value = "유저 패스워드", example = "password1234") private String password; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberSaveRequestDto.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberSaveRequestDto.java index 91ae0626..9e431907 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberSaveRequestDto.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberSaveRequestDto.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import java.util.List; @@ -11,11 +12,17 @@ @Builder public class MemberSaveRequestDto { + @ApiModelProperty(required = true, value = "유저 닉네임", example = "아라") private String nickname; + @ApiModelProperty(required = true, value = "유저 아이디", example = "test1234") private String userId; + @ApiModelProperty(required = true, value = "유저 이메일", example = "test1234@naver.com") private String email; + @ApiModelProperty(required = true, value = "유저 패스워드", example = "password1234") private String password; + @ApiModelProperty(required = true, value = "유저 연락처", example = "01012345678") private String telephone; + @ApiModelProperty(required = true, value = "유저 관심 키워드", example = "화려한,유화") private List keywords; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateKeywordsRequestDto.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateKeywordsRequestDto.java index d026d4a7..51e69763 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateKeywordsRequestDto.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateKeywordsRequestDto.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import java.util.List; @@ -11,5 +12,6 @@ @Builder public class MemberUpdateKeywordsRequestDto { + @ApiModelProperty(required = true, value = "유저 관심 키워드", example = "['화려한','유화']") private List keywords; } diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateRequest.java b/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateRequest.java index 97fc0b4e..edcd36cc 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateRequest.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/MemberUpdateRequest.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import java.util.List; @@ -11,9 +12,14 @@ @Builder public class MemberUpdateRequest { + @ApiModelProperty(required = true, value = "유저 닉네임", example = "아라") private String nickname; + @ApiModelProperty(required = true, value = "유저 이메일", example = "test1234@naver.com") private String email; + @ApiModelProperty(required = true, value = "유저 주소", example = "서울시 xx구 xx동 123동 1234호") private String address; + @ApiModelProperty(required = true, value = "유저 연락처", example = "01012345678") private String telephone; + @ApiModelProperty(required = true, value = "이미지 변경 여부", example = "true") private Boolean isChanged; } \ No newline at end of file diff --git a/src/main/java/com/sptp/backend/member/web/dto/request/PasswordChangeRequest.java b/src/main/java/com/sptp/backend/member/web/dto/request/PasswordChangeRequest.java index 0237abe8..0011a83e 100644 --- a/src/main/java/com/sptp/backend/member/web/dto/request/PasswordChangeRequest.java +++ b/src/main/java/com/sptp/backend/member/web/dto/request/PasswordChangeRequest.java @@ -1,5 +1,6 @@ package com.sptp.backend.member.web.dto.request; +import io.swagger.annotations.ApiModelProperty; import lombok.*; import org.hibernate.validator.constraints.Length; @@ -12,6 +13,7 @@ @Builder public class PasswordChangeRequest { + @ApiModelProperty(required = true, value = "유저 비밀번호", example = "password1234") @Length(min = 8, message = "비밀번호는 8자 이상 입력해주세요.") @NotBlank(message = "비밀번호는 공백일 수 없습니다.") private String password; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f2f45f79..7d0d6d82 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -4,6 +4,10 @@ server: spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + servlet: multipart: max-file-size: 10MB