Skip to content

Commit

Permalink
Merge pull request #26 from KUIT-Couphone/hotfix/store-swagger-auth
Browse files Browse the repository at this point in the history
fix: store swagger auth 및 CI, application.yml 변경
  • Loading branch information
limsubinn authored Aug 8, 2023
2 parents daec741 + 3906f55 commit 5ac3510
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: Java CI with Gradle

on:
push:
branches: [ "main", "feature/*" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -40,7 +41,7 @@ public class StoreController {
@Operation(summary = "가게 등록", description = """
Request Body에 브랜드 아이디, 매장명, 위도, 경도, 주소를 담아서 보내주세요!
- [ROLE_ADMIN ONLY]
""")
""", security = @SecurityRequirement(name = "bearerAuth"))
public BaseResponse<PostStoreResponse> postBrand(@Validated @RequestBody PostStoreRequest request,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
Expand All @@ -54,15 +55,16 @@ public BaseResponse<PostStoreResponse> postBrand(@Validated @RequestBody PostSto
@Operation(summary = "좌표 변환", description = """
query string에 주소를 담아 보내면 좌표를 반환합니다.
- [ROLE_ADMIN ONLY]
""")
""", security = @SecurityRequirement(name = "bearerAuth"))
public BaseResponse<Coordinate> translateCoordinate(@Parameter(name = "query", description = "도로명주소", example = "서울특별시 광진구 능동로 111", in = ParameterIn.QUERY)
@RequestParam(required = true) String query) {
return new BaseResponse<>(coordinateConverter.getCoordinate(query));
}

@PreAuthorize("hasRole('MEMBER') or hasRole('ADMIN')")
@GetMapping("/nearby")
@Operation(summary = "좌표 중심 가게 반환", description = "query string에 위도, 경도, 버튼 여부를 보내면 주변 가게 리스트를 반환합니다. 좌표게: epsg:5181")
@Operation(summary = "좌표 중심 가게 반환", description = "query string에 위도, 경도, 버튼 여부를 보내면 주변 가게 리스트를 반환합니다. 좌표게: epsg:5181",
security = @SecurityRequirement(name = "bearerAuth"))
public BaseResponse<List<PostNearbyStoreResponse>> translateCoordinate(
@Parameter(name = "longitude", description = "경도", example = "207005.189144674", in = ParameterIn.QUERY) @RequestParam Double longitude,
@Parameter(name = "latitude", description = "위도", example = "449492.810069438", in = ParameterIn.QUERY) @RequestParam Double latitude,
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 @@ -63,7 +63,7 @@ spring:
database: mysql
database-platform: org.hibernate.dialect.MySQLDialect
hibernate:
ddl-auto: create
ddl-auto: update
properties:
hibernate:
format_sql: true
Expand Down

0 comments on commit 5ac3510

Please sign in to comment.