This commit is contained in:
2024-04-18 16:12:17 +08:00
parent 1a453a25e7
commit a7aed30ea7
2 changed files with 4 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
package cn.lihongjie.coal.resource.dto;
import cn.lihongjie.coal.base.dto.CommonDto;
import cn.lihongjie.coal.common.DictCode;
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
import lombok.Data;
@@ -12,6 +14,7 @@ public class ResourceDto extends CommonDto {
@Comment("资源类型")
private String type;
@DictTranslate(dictKey = DictCode.RESOURCE_TYPE)
private String typeName;
@Comment("资源地址")

View File

@@ -12,7 +12,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.ArrayList;
import java.util.List;
@@ -42,14 +41,7 @@ public class ResourceEntity extends CommonEntity {
@Comment("资源类型 0 菜单 1 按钮 3 url")
private String type;
@Formula(
"(select i.name\n"
+ "from t_dictionary d,\n"
+ " t_dictionary_item i\n"
+ "where d.id = i.dictionary_id\n"
+ " and d.code = 'resource.type'\n"
+ " and i.code = type)")
private String typeName;
@Comment("资源地址")
private String url;