메뉴 임시 수정

This commit is contained in:
2025-12-24 09:11:03 +09:00
parent c7093736d8
commit 78d1f4fc9a
5 changed files with 23 additions and 18 deletions

View File

@@ -86,7 +86,7 @@ public class RedisAuthorizationManager
continue;
}
String baseUri = menu.getMenuApiUri();
String baseUri = menu.getMenuUrl();
if (baseUri == null || baseUri.isBlank()) {
continue;
}

View File

@@ -0,0 +1,8 @@
package com.kamco.cd.kamcoback.menu;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/my/menus")
public class MyMenusApiController {}

View File

@@ -45,8 +45,7 @@ public class MenuDto {
Long updatedUid,
List<MenuDto.Basic> children,
ZonedDateTime createdDttm,
ZonedDateTime updatedDttm,
String menuApiUrl) {
ZonedDateTime updatedDttm) {
this.menuUid = menuUid;
this.menuNm = menuNm;
this.menuUrl = menuUrl;
@@ -59,7 +58,6 @@ public class MenuDto {
this.children = children;
this.createdDttm = createdDttm;
this.updatedDttm = updatedDttm;
this.menuApiUrl = menuApiUrl;
}
}
@@ -70,7 +68,6 @@ public class MenuDto {
private String menuUid;
private String menuNm;
private String menuUrl;
private String menuApiUri;
private String roles; // "ROLE_A,ROLE_B"
}
}

View File

@@ -2,7 +2,15 @@ package com.kamco.cd.kamcoback.postgres.entity;
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
import jakarta.persistence.*;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
@@ -15,6 +23,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Table(name = "tb_menu")
public class MenuEntity extends CommonDateEntity {
@Id
@Column(name = "menu_uid")
private String menuUid;
@@ -49,9 +58,6 @@ public class MenuEntity extends CommonDateEntity {
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<MenuEntity> children = new ArrayList<>();
@Column(name = "menu_api_uri")
private String menuApiUri;
public MenuDto.Basic toDto() {
return new MenuDto.Basic(
this.menuUid,
@@ -65,7 +71,6 @@ public class MenuEntity extends CommonDateEntity {
this.updatedUid,
this.children.stream().map(MenuEntity::toDto).toList(),
this.getCreatedDate(),
this.getModifiedDate(),
this.menuApiUri);
this.getModifiedDate());
}
}

View File

@@ -72,17 +72,12 @@ public class MenuRepositoryImpl implements MenuRepositoryCustom {
queryFactory
.select(
Projections.constructor(
MenuWithRolesDto.class,
tm.menuUid,
tm.menuNm,
tm.menuUrl,
tm.menuApiUri,
roleAgg))
MenuWithRolesDto.class, tm.menuUid, tm.menuNm, tm.menuUrl, roleAgg))
.from(tm)
.leftJoin(tmm)
.on(tmm.menuUid.eq(tm).and(tmm.deleted.isFalse()))
.where(tm.deleted.isFalse())
.groupBy(tm.menuUid, tm.menuNm, tm.menuUrl, tm.menuApiUri)
.groupBy(tm.menuUid, tm.menuNm, tm.menuUrl)
.fetch();
return content;
}