Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .claude/rules/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ companion object {
}
```

## Comments

- Do NOT comment on self-explanatory code
- Add comments in these cases:
- **Core business logic**: Domain rules, policy decisions — explain "why", not "what"
- **Collaboration aid**: Intent or background that other developers need to understand the code
- **Non-obvious implementation**: Performance optimizations, workarounds, external system constraints
- **Architecture decisions**: Reason for choosing a specific pattern or structure (e.g., `// NOTE: Kept in Java for Lombok @SuperBuilder compatibility`)
- Use KDoc (`/** */`) for public APIs, Port interfaces, and external contracts
- Use inline comments (`//`) for implementation intent within methods

## Null Handling

```kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.weeth.domain.user.domain.entity.enums.StatusPriority;
import com.weeth.domain.user.domain.entity.enums.UsersOrderBy;
import com.weeth.domain.user.domain.service.*;
import com.weeth.global.auth.jwt.service.JwtRedisService;
import com.weeth.global.auth.jwt.domain.port.RefreshTokenStorePort;
import lombok.RequiredArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
Expand All @@ -35,7 +35,7 @@ public class UserManageUseCaseImpl implements UserManageUseCase {

private final AttendanceSaveService attendanceSaveService;
private final MeetingGetService meetingGetService;
private final JwtRedisService jwtRedisService;
private final RefreshTokenStorePort refreshTokenStorePort;
private final CardinalGetService cardinalGetService;
private final UserCardinalSaveService userCardinalSaveService;
private final UserCardinalGetService userCardinalGetService;
Expand Down Expand Up @@ -108,15 +108,15 @@ public void update(List<UserRoleUpdate> requests) {
User user = userGetService.find(request.userId());

userUpdateService.update(user, request.role().name());
jwtRedisService.updateRole(user.getId(), request.role().name());
refreshTokenStorePort.updateRole(user.getId(), request.role());
});
}

@Override
public void leave(Long userId) {
User user = userGetService.find(userId);
// 탈퇴하는 경우 리프레시 토큰 삭제
jwtRedisService.delete(user.getId());
refreshTokenStorePort.delete(user.getId());
userDeleteService.leave(user);
}

Expand All @@ -125,7 +125,7 @@ public void ban(UserId userIds) {
List<User> users = userGetService.findAll(userIds.userId());

users.forEach(user -> {
jwtRedisService.delete(user.getId());
refreshTokenStorePort.delete(user.getId());
userDeleteService.ban(user);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public JwtDto refresh(String refreshToken) {
JwtDto token = jwtManageUseCase.reIssueToken(requestToken);

log.info("RefreshToken 발급 완료: {}", token);
return new JwtDto(token.accessToken(), token.refreshToken());
return new JwtDto(token.getAccessToken(), token.getRefreshToken());
}

@Override
Expand All @@ -206,9 +206,9 @@ public List<SummaryResponse> searchUser(String keyword) {

private long getKakaoId(Login dto) {
KakaoTokenResponse tokenResponse = kakaoAuthService.getKakaoToken(dto.authCode());
KakaoUserInfoResponse userInfo = kakaoAuthService.getUserInfo(tokenResponse.access_token());
KakaoUserInfoResponse userInfo = kakaoAuthService.getUserInfo(tokenResponse.getAccessToken());

return userInfo.id();
return userInfo.getId();
}

private void validate(Update dto, Long userId) {
Expand Down Expand Up @@ -246,10 +246,10 @@ private UserCardinalDto getUserCardinalDto(Long userId) {
public SocialLoginResponse appleLogin(Login dto) {
// Apple Token 요청 및 유저 정보 요청
AppleTokenResponse tokenResponse = appleAuthService.getAppleToken(dto.authCode());
AppleUserInfo userInfo = appleAuthService.verifyAndDecodeIdToken(tokenResponse.id_token());
AppleUserInfo userInfo = appleAuthService.verifyAndDecodeIdToken(tokenResponse.getIdToken());

String appleIdToken = tokenResponse.id_token();
String appleId = userInfo.appleId();
String appleIdToken = tokenResponse.getIdToken();
String appleId = userInfo.getAppleId();

Optional<User> optionalUser = userGetService.findByAppleId(appleId);

Expand All @@ -275,13 +275,13 @@ public void appleRegister(Register dto) {

// Apple authCode로 토큰 교환 후 ID Token 검증 및 사용자 정보 추출
AppleTokenResponse tokenResponse = appleAuthService.getAppleToken(dto.appleAuthCode());
AppleUserInfo appleUserInfo = appleAuthService.verifyAndDecodeIdToken(tokenResponse.id_token());
AppleUserInfo appleUserInfo = appleAuthService.verifyAndDecodeIdToken(tokenResponse.getIdToken());

Cardinal cardinal = cardinalGetService.findByUserSide(dto.cardinal());

User user = mapper.from(dto);
// Apple ID 설정
user.addAppleId(appleUserInfo.appleId());
user.addAppleId(appleUserInfo.getAppleId());

UserCardinal userCardinal = new UserCardinal(user, cardinal);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.weeth.domain.user.application.dto.response.CardinalResponse;
import com.weeth.domain.user.application.exception.UserErrorCode;
import com.weeth.domain.user.application.usecase.CardinalUseCase;
import com.weeth.global.auth.jwt.exception.JwtErrorCode;
import com.weeth.global.auth.jwt.application.exception.JwtErrorCode;
import com.weeth.global.common.exception.ApiErrorCodeExample;
import com.weeth.global.common.response.CommonResponse;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.weeth.domain.user.application.exception.UserErrorCode;
import com.weeth.domain.user.application.usecase.UserManageUseCase;
import com.weeth.domain.user.domain.entity.enums.UsersOrderBy;
import com.weeth.global.auth.jwt.exception.JwtErrorCode;
import com.weeth.global.auth.jwt.application.exception.JwtErrorCode;
import com.weeth.global.common.exception.ApiErrorCodeExample;
import com.weeth.global.common.response.CommonResponse;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.weeth.domain.user.domain.service.UserGetService;
import com.weeth.global.auth.annotation.CurrentUser;
import com.weeth.global.auth.jwt.application.dto.JwtDto;
import com.weeth.global.auth.jwt.exception.JwtErrorCode;
import com.weeth.global.auth.jwt.application.exception.JwtErrorCode;
import com.weeth.global.common.exception.ApiErrorCodeExample;
import com.weeth.global.common.response.CommonResponse;
import lombok.RequiredArgsConstructor;
Expand Down
11 changes: 0 additions & 11 deletions src/main/java/com/weeth/global/auth/annotation/CurrentUser.java

This file was deleted.

This file was deleted.

Loading