-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/#108
- Loading branch information
Showing
17 changed files
with
181 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/sponus/sponusbe/auth/controller/AuthController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.sponus.sponusbe.auth.controller; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.sponus.sponusbe.auth.jwt.dto.JwtPair; | ||
import com.sponus.sponusbe.auth.jwt.exception.SecurityCustomException; | ||
import com.sponus.sponusbe.auth.jwt.exception.SecurityErrorCode; | ||
import com.sponus.sponusbe.auth.jwt.util.JwtUtil; | ||
import com.sponus.sponusbe.global.common.ApiResponse; | ||
|
||
import io.jsonwebtoken.ExpiredJwtException; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@RequestMapping("api/v1/auth") | ||
@RestController | ||
public class AuthController { | ||
|
||
private final JwtUtil jwtUtil; | ||
|
||
@GetMapping("/reissue") | ||
public ApiResponse<JwtPair> reissueToken(@RequestHeader("RefreshToken") String refreshToken) { | ||
try { | ||
jwtUtil.validateRefreshToken(refreshToken); | ||
return ApiResponse.onSuccess( | ||
jwtUtil.reissueToken(refreshToken) | ||
); | ||
} catch (ExpiredJwtException eje) { | ||
throw new SecurityCustomException(SecurityErrorCode.TOKEN_EXPIRED, eje); | ||
} catch (IllegalArgumentException iae) { | ||
throw new SecurityCustomException(SecurityErrorCode.INVALID_TOKEN, iae); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...om/sponus/sponusbe/domain/organizationLink/dto/request/OrganizationLinkUpdateRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.sponus.sponusbe.domain.organizationLink.dto.request; | ||
|
||
public record OrganizationLinkUpdateRequest( | ||
String name, | ||
String url | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ava/com/sponus/sponusbe/domain/organizationLink/service/OrganizationLinkQueryService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
package com.sponus.sponusbe.domain.organizationLink.service; | ||
|
||
import com.sponus.sponusbe.domain.organization.exception.OrganizationException; | ||
import com.sponus.sponusbe.domain.organizationLink.dto.response.OrganizationLinkGetResponse; | ||
import com.sponus.sponusbe.domain.organizationLink.entity.OrganizationLink; | ||
import com.sponus.sponusbe.domain.organizationLink.repository.OrganizationLinkRepository; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
import static com.sponus.sponusbe.domain.organizationLink.exception.OrganizationLinkErrorCode.ORGANIZATION_LINK_NOT_FOUND; | ||
|
||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
@Service | ||
public class OrganizationLinkQueryService { | ||
private final OrganizationLinkRepository organizationLinkRepository; | ||
public OrganizationLinkGetResponse getOrganizationLink(Long organizationLinkId) { | ||
OrganizationLink organizationLink = organizationLinkRepository.findById(organizationLinkId) | ||
.orElseThrow(() -> new OrganizationException(ORGANIZATION_LINK_NOT_FOUND)); | ||
|
||
return OrganizationLinkGetResponse.from(organizationLink); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.