Skip to content

Commit

Permalink
refactor: 수정사항 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Dec 27, 2024
1 parent b7450f6 commit 316fb17
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public interface UserMapper {
UserResponse toUserResponse(User user);

UserResponseDto.UserInfo toUserInfoDto(User user);

default String toString(Department department) {
return department.getValue();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public JwtDto refresh(String refreshToken) {
@Override
public UserResponseDto.UserInfo findUserInfo(Long userId) {
User user = userGetService.find(userId);

return mapper.toUserInfoDto(user);
}
private long getKakaoId(Login dto) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import leets.weeth.domain.user.application.usecase.UserManageUseCase;
import leets.weeth.domain.user.application.usecase.UserUseCase;
import leets.weeth.global.common.response.CommonResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
Expand All @@ -22,41 +21,41 @@ public class UserAdminController {
private final UserManageUseCase userManageUseCase;

@GetMapping("/all")
@Operation(summary="어드민용 회원 조회")
@Operation(summary = "어드민용 회원 조회")
public CommonResponse<List<AdminResponse>> findAll() {
return CommonResponse.createSuccess(USER_FIND_ALL_SUCCESS.getMessage(), userManageUseCase.findAllByAdmin());
}

@PatchMapping
@Operation(summary="가입 신청 승인")
@Operation(summary = "가입 신청 승인")
public CommonResponse<Void> accept(@RequestParam Long userId) {
userManageUseCase.accept(userId);
return CommonResponse.createSuccess(USER_ACCEPT_SUCCESS.getMessage());
}

@DeleteMapping
@Operation(summary="유저 추방")
@Operation(summary = "유저 추방")
public CommonResponse<Void> ban(@RequestParam Long userId) {
userManageUseCase.ban(userId);
return CommonResponse.createSuccess(USER_BAN_SUCCESS.getMessage());
}

@PatchMapping("/role")
@Operation(summary="관리자로 승격/강등")
@Operation(summary = "관리자로 승격/강등")
public CommonResponse<Void> update(@RequestParam Long userId, @RequestParam String role) {
userManageUseCase.update(userId, role);
return CommonResponse.createSuccess(USER_ROLE_UPDATE_SUCCESS.getMessage());
}

@PatchMapping("/apply")
@Operation(summary="다음 기수도 이어서 진행")
@Operation(summary = "다음 기수도 이어서 진행")
public CommonResponse<Void> applyOB(@RequestParam Long userId, @RequestParam Integer cardinal) {
userManageUseCase.applyOB(userId, cardinal);
return CommonResponse.createSuccess(USER_APPLY_OB_SUCCESS.getMessage());
}

@PatchMapping("/reset")
@Operation(summary="회원 비밀번호 초기화")
@Operation(summary = "회원 비밀번호 초기화")
public CommonResponse<Void> resetPassword(@RequestParam Long userId) {
userManageUseCase.reset(userId);
return CommonResponse.createSuccess(USER_PASSWORD_RESET_SUCCESS.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import leets.weeth.domain.user.application.dto.response.UserResponseDto;
import leets.weeth.domain.user.application.dto.response.UserResponseDto.SummaryResponse;
Expand Down

0 comments on commit 316fb17

Please sign in to comment.