Skip to content

Commit

Permalink
Merge pull request #29 from LikeLion-12th-SKHU/develop
Browse files Browse the repository at this point in the history
develop -> main push
  • Loading branch information
ttttkii913 authored Jul 24, 2024
2 parents 5947153 + 75f75ab commit 2ae4b3a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class SwaggerConfig {

private Info apiInfo() {
return new Info()
.title("Swaager API")
.description("Swagger API ν…ŒμŠ€νŠΈ")
.title("Walk Mate Swagger API")
.description("Walk Mate Swagger APIμž…λ‹ˆλ‹€.")
.version("1.0.0");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.likelion.likelion_12th_team05.curation.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.RequiredArgsConstructor;

import org.likelion.likelion_12th_team05.common.error.SuccessCode;
Expand Down Expand Up @@ -29,7 +32,12 @@ public class CurationController {
private final LocationService locationService;
private final UserService userService;

// νλ ˆμ΄μ…˜ 지도 νŽ˜μ΄μ§€ - λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 6κ°œμ”© 쑰회 κ°€λŠ₯
@Operation(summary = "λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 6κ°œμ”© 쑰회", description = "λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ„ 6κ°œμ”© μ‘°νšŒν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "500", description = "μ„œλ²„ λ‚΄λΆ€ 였λ₯˜μž…λ‹ˆλ‹€.")
})
@GetMapping
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<CurationListResDto> curationFindAll (
Expand All @@ -49,7 +57,12 @@ public ApiResponseTemplate<CurationListResDto> curationFindAll (
return ApiResponseTemplate.successResponse(curationListResDto, SuccessCode.GET_SUCCESS);
}

// νλ ˆμ΄μ…˜ 생성 νŽ˜μ΄μ§€ - 인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 생성 κ°€λŠ₯
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 생성", description = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ„ μƒμ„±ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PostMapping
@ResponseStatus(HttpStatus.CREATED) // @Valid μΆ”κ°€ μ˜ˆμ •
public ApiResponseTemplate<CurationInfoResDto> curationSave(@RequestBody CurationSaveReqDto curationSaveReqDto
Expand All @@ -58,7 +71,12 @@ public ApiResponseTemplate<CurationInfoResDto> curationSave(@RequestBody Curatio
return ApiResponseTemplate.successResponse(curationInfoResDto, SuccessCode.CURATION_SAVE_SUCCESS);
}

// νλ ˆμ΄μ…˜ 지도 νŽ˜μ΄μ§€ - 인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 이름, content μˆ˜μ •, μ‚­μ œ κ°€λŠ₯
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ μˆ˜μ •", description = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ„ μˆ˜μ •ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PatchMapping("/{curationId}")
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<CurationInfoResDto> curationUpdate(@PathVariable("curationId") Long curationId,
Expand All @@ -68,7 +86,12 @@ public ApiResponseTemplate<CurationInfoResDto> curationUpdate(@PathVariable("cur
return ApiResponseTemplate.successResponse(curationInfoResDto, SuccessCode.CURATION_UPDATE_SUCCESS);
}

// 인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ μ‚­μ œ
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ μ‚­μ œ", description = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ„ μ‚­μ œν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@DeleteMapping("/{curationId}")
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<SuccessCode> curationDelete(@PathVariable("curationId") Long curationId,
Expand All @@ -77,7 +100,12 @@ public ApiResponseTemplate<SuccessCode> curationDelete(@PathVariable("curationId
return ApiResponseTemplate.successWithNoContent(SuccessCode.GET_SUCCESS);
}

// νλ ˆμ΄μ…˜ 지도 νŽ˜μ΄μ§€ - λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 검색 κ°€λŠ₯(query="μ„œμšΈ" 이런 μ‹μœΌλ‘œ)
@Operation(summary = "λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜ 검색", description = "λͺ¨λ“  μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ„ κ²€μƒ‰ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "500", description = "μ„œλ²„ λ‚΄λΆ€ 였λ₯˜μž…λ‹ˆλ‹€.")
})
@GetMapping("/search")
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<CurationListResDto> searchCurations(@RequestParam String query) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.likelion.likelion_12th_team05.like.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.likelion.likelion_12th_team05.common.error.SuccessCode;
import org.likelion.likelion_12th_team05.config.ApiResponseTemplate;
Expand All @@ -15,15 +18,25 @@
public class LikeController {
private final LikeService likeService;

// 인증된 μ‚¬μš©μž - νλ ˆμ΄μ…˜μ— μ’‹μ•„μš” λˆ„λ₯΄κΈ°
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ— μ’‹μ•„μš”", description = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ— μ’‹μ•„μš”λ₯Ό ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PostMapping("/{curationId}/like")
public ApiResponseTemplate<SuccessCode> likeSave(@PathVariable("curationId") Long curationId,
Principal principal) {
likeService.likeSave(curationId, principal);
return ApiResponseTemplate.successWithNoContent(SuccessCode.LIKE_SAVE_SUCCESS);
}

// 인증된 μ‚¬μš©μž - νλ ˆμ΄μ…˜μ— μ’‹μ•„μš” μ·¨μ†Œ
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ— μ’‹μ•„μš” μ·¨μ†Œ", description = "인증된 μ‚¬μš©μžκ°€ νλ ˆμ΄μ…˜μ— μ’‹μ•„μš”λ₯Ό μ·¨μ†Œν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@DeleteMapping("/{curationId}/unlike")
public ApiResponseTemplate<SuccessCode> likeDelete(@PathVariable("curationId") Long curationId,
Principal principal) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.likelion.likelion_12th_team05.location.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.RequiredArgsConstructor;

import org.likelion.likelion_12th_team05.common.error.SuccessCode;
Expand All @@ -25,15 +28,25 @@ public class LocationController {
private final LocationService locationService;
private final CurationService curationService;

// 인증된 μ‚¬μš©μž - λ‚΄κ°€ μ§€λ„μ—μ„œ κ³ λ₯Έ μœ„μΉ˜ λͺ¨λ‘ 보기
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ κ³ λ₯Έ μœ„μΉ˜ 쑰회", description = "인증된 μ‚¬μš©μžκ°€ κ³ λ₯Έ μœ„μΉ˜λ₯Ό μ‘°νšŒν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@GetMapping
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<LocationListResDto> locationFindAll(Principal principal) {
LocationListResDto locationListResDto = locationService.locationFindAll(principal);
return ApiResponseTemplate.successResponse(locationListResDto, SuccessCode.GET_SUCCESS);
}

// 인증된 μ‚¬μš©μž - μœ„μΉ˜ 생성 - μœ„μΉ˜ 이름 + μ‚°μ±…λ‘œ μ„€λͺ… + 사진 μ €μž₯
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜ 생성", description = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PostMapping(value = "/{curationId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<LocationInfoResDto> locationSave(@RequestPart("location") LocationSaveReqDto locationSaveReqDto,
Expand All @@ -44,7 +57,12 @@ public ApiResponseTemplate<LocationInfoResDto> locationSave(@RequestPart("locati
return ApiResponseTemplate.successResponse(locationInfoResDto, SuccessCode.LOCATION_SAVE_SUCCESS);
}

// 인증된 μ‚¬μš©μž - μ‚°μ±…λ‘œ μˆ˜μ • - μ‚°μ±…λ‘œ μ„€λͺ… + 사진 μˆ˜μ •
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜ μˆ˜μ •", description = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜λ₯Ό μˆ˜μ •ν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PatchMapping(value = "/{locationId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<LocationInfoResDto> locationUpdate(@PathVariable("locationId") Long locationId,
Expand All @@ -55,7 +73,12 @@ public ApiResponseTemplate<LocationInfoResDto> locationUpdate(@PathVariable("loc
return ApiResponseTemplate.successResponse(locationInfoResDto, SuccessCode.LOCATION_UPDATE_SUCCESS);
}

// 인증된 μ‚¬μš©μž - μ‚°μ±…λ‘œ μ‚­μ œ - μ•„μ˜ˆ μž₯μ†Œλ₯Ό μ‚­μ œ
@Operation(summary = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜ μ‚­μ œ.", description = "인증된 μ‚¬μš©μžκ°€ μœ„μΉ˜λ₯Ό μ‚­μ œν•©λ‹ˆλ‹€.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@DeleteMapping("/{locationId}")
@ResponseStatus(HttpStatus.OK)
public ApiResponseTemplate<String> locationDelete(@PathVariable("locationId") Long locationId, Principal principal) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.likelion.likelion_12th_team05.user.api;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import jakarta.validation.Valid;
import org.likelion.likelion_12th_team05.common.error.SuccessCode;
import org.likelion.likelion_12th_team05.config.ApiResponseTemplate;
Expand All @@ -21,13 +24,24 @@ public UserController(UserService userService, AuthLoginService authLoginService
this.authLoginService = authLoginService;
}

// 자체 νšŒμ›κ°€μž…
@Operation(summary = "νšŒμ›κ°€μž…", description = "자체 νšŒμ›κ°€μž…")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@PostMapping("/sign-up")
public ApiResponseTemplate<SuccessCode> userSignUp(@RequestBody @Valid UserSignUpReqDto userSignUpReqDto) {
userService.userSignUp(userSignUpReqDto);
return ApiResponseTemplate.successWithNoContent(SuccessCode.USER_SIGNUP_SUCCESS);
}

@Operation(summary = "ꡬ글 둜그인", description = "ꡬ글 둜그인")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@GetMapping("/code/google")
public GoogleToken googleCallback(@RequestParam(name = "code") String code) {
String googleAccessToken = authLoginService.getGoogleAccessToken(code);
Expand All @@ -38,7 +52,12 @@ public GoogleToken signUpOrSignIn(String googleAccessToken) {
return authLoginService.signUpOrSignIn(googleAccessToken);
}

// 자체 둜그인
@Operation(summary = "둜그인", description = "자체 둜그인")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "응닡 생성에 μ„±κ³΅ν•˜μ˜€μŠ΅λ‹ˆλ‹€."),
@ApiResponse(responseCode = "400", description = "잘λͺ»λœ μš”μ²­μž…λ‹ˆλ‹€."),
@ApiResponse(responseCode = "401", description = "인증이 ν•„μš”ν•©λ‹ˆλ‹€.")
})
@GetMapping("/sign-in")
private ApiResponseTemplate<UserSignInResDto> userSignIn(@RequestBody @Valid UserSignInReqDto userSignInReqDto) {
UserSignInResDto userSignInResDto = userService.userSignIn(userSignInReqDto);
Expand Down

0 comments on commit 2ae4b3a

Please sign in to comment.