메뉴 권한별 레디스저장, 조회 추가

This commit is contained in:
2025-12-19 15:28:52 +09:00
parent 428ea96d20
commit 9288273aeb
6 changed files with 107 additions and 64 deletions

View File

@@ -17,6 +17,7 @@ import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -70,11 +71,42 @@ public class MenuApiController {
return ApiResponseDto.ok(ApiLogFunction.getUriMenuInfo(result, apiUri));
}
@Operation(summary = "권한별 메뉴 조회", description = "권한별 메뉴 ")
@Operation(summary = "권한별 메뉴 레디스 저장", description = "권한별 메뉴 레디스 저장")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "등록 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = MenuDto.Basic.class))),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/auth")
public ApiResponseDto<Void> getFindByRoleRedis() {
menuService.getFindByRoleRedis();
return ApiResponseDto.createOK(null);
}
@Operation(summary = "권한별 메뉴 조회", description = "권한별 메뉴 조회")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "조회 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = MenuDto.Basic.class))),
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@GetMapping("/auth")
public ApiResponseDto<String> getFindAllByRole() {
public ApiResponseDto<List<MenuDto.Basic>> getFindAllByRole() {
UserUtil userUtil = new UserUtil();
String role = userUtil.getRole();
return null; // ApiResponseDto.ok(menuService.getFindByRole(role));
return ApiResponseDto.ok(menuService.getFindByRole(role));
}
}