This commit is contained in:
2024-04-18 16:28:07 +08:00
parent 8b68e1ce66
commit d889e4d07d
2 changed files with 4 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
package cn.lihongjie.coal.noteBookChapter.dto;
import cn.lihongjie.coal.base.dto.CommonDto;
import cn.lihongjie.coal.common.DictCode;
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
import lombok.Data;
@@ -15,6 +17,7 @@ public class NoteBookChapterDto extends CommonDto {
@Comment("内容类型 0 html 1 markdown")
private String contentType;
@DictTranslate(dictKey = DictCode.NOTEBOOK_CONTENTTYPE)
private String contentTypeName;
@Comment("内容")

View File

@@ -11,7 +11,6 @@ import jakarta.persistence.OneToMany;
import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Formula;
import java.util.List;
@@ -25,14 +24,7 @@ public class NoteBookChapterEntity extends CommonEntity {
@Comment("内容类型 0 html 1 markdown")
private String contentType;
@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 = 'notebook.contentType'\n"
+ " and i.code = content_type)")
private String contentTypeName;
@Comment("内容")
private String content;