메뉴 임시 수정
This commit is contained in:
@@ -86,7 +86,7 @@ public class RedisAuthorizationManager
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String baseUri = menu.getMenuApiUri();
|
String baseUri = menu.getMenuUrl();
|
||||||
if (baseUri == null || baseUri.isBlank()) {
|
if (baseUri == null || baseUri.isBlank()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 {}
|
||||||
@@ -45,8 +45,7 @@ public class MenuDto {
|
|||||||
Long updatedUid,
|
Long updatedUid,
|
||||||
List<MenuDto.Basic> children,
|
List<MenuDto.Basic> children,
|
||||||
ZonedDateTime createdDttm,
|
ZonedDateTime createdDttm,
|
||||||
ZonedDateTime updatedDttm,
|
ZonedDateTime updatedDttm) {
|
||||||
String menuApiUrl) {
|
|
||||||
this.menuUid = menuUid;
|
this.menuUid = menuUid;
|
||||||
this.menuNm = menuNm;
|
this.menuNm = menuNm;
|
||||||
this.menuUrl = menuUrl;
|
this.menuUrl = menuUrl;
|
||||||
@@ -59,7 +58,6 @@ public class MenuDto {
|
|||||||
this.children = children;
|
this.children = children;
|
||||||
this.createdDttm = createdDttm;
|
this.createdDttm = createdDttm;
|
||||||
this.updatedDttm = updatedDttm;
|
this.updatedDttm = updatedDttm;
|
||||||
this.menuApiUrl = menuApiUrl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +68,6 @@ public class MenuDto {
|
|||||||
private String menuUid;
|
private String menuUid;
|
||||||
private String menuNm;
|
private String menuNm;
|
||||||
private String menuUrl;
|
private String menuUrl;
|
||||||
private String menuApiUri;
|
|
||||||
private String roles; // "ROLE_A,ROLE_B"
|
private String roles; // "ROLE_A,ROLE_B"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,15 @@ package com.kamco.cd.kamcoback.postgres.entity;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
|
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
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 jakarta.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -15,6 +23,7 @@ import lombok.NoArgsConstructor;
|
|||||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||||
@Table(name = "tb_menu")
|
@Table(name = "tb_menu")
|
||||||
public class MenuEntity extends CommonDateEntity {
|
public class MenuEntity extends CommonDateEntity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "menu_uid")
|
@Column(name = "menu_uid")
|
||||||
private String menuUid;
|
private String menuUid;
|
||||||
@@ -49,9 +58,6 @@ public class MenuEntity extends CommonDateEntity {
|
|||||||
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
|
||||||
private List<MenuEntity> children = new ArrayList<>();
|
private List<MenuEntity> children = new ArrayList<>();
|
||||||
|
|
||||||
@Column(name = "menu_api_uri")
|
|
||||||
private String menuApiUri;
|
|
||||||
|
|
||||||
public MenuDto.Basic toDto() {
|
public MenuDto.Basic toDto() {
|
||||||
return new MenuDto.Basic(
|
return new MenuDto.Basic(
|
||||||
this.menuUid,
|
this.menuUid,
|
||||||
@@ -65,7 +71,6 @@ public class MenuEntity extends CommonDateEntity {
|
|||||||
this.updatedUid,
|
this.updatedUid,
|
||||||
this.children.stream().map(MenuEntity::toDto).toList(),
|
this.children.stream().map(MenuEntity::toDto).toList(),
|
||||||
this.getCreatedDate(),
|
this.getCreatedDate(),
|
||||||
this.getModifiedDate(),
|
this.getModifiedDate());
|
||||||
this.menuApiUri);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,17 +72,12 @@ public class MenuRepositoryImpl implements MenuRepositoryCustom {
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
MenuWithRolesDto.class,
|
MenuWithRolesDto.class, tm.menuUid, tm.menuNm, tm.menuUrl, roleAgg))
|
||||||
tm.menuUid,
|
|
||||||
tm.menuNm,
|
|
||||||
tm.menuUrl,
|
|
||||||
tm.menuApiUri,
|
|
||||||
roleAgg))
|
|
||||||
.from(tm)
|
.from(tm)
|
||||||
.leftJoin(tmm)
|
.leftJoin(tmm)
|
||||||
.on(tmm.menuUid.eq(tm).and(tmm.deleted.isFalse()))
|
.on(tmm.menuUid.eq(tm).and(tmm.deleted.isFalse()))
|
||||||
.where(tm.deleted.isFalse())
|
.where(tm.deleted.isFalse())
|
||||||
.groupBy(tm.menuUid, tm.menuNm, tm.menuUrl, tm.menuApiUri)
|
.groupBy(tm.menuUid, tm.menuNm, tm.menuUrl)
|
||||||
.fetch();
|
.fetch();
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user