mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
优化
This commit is contained in:
@@ -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("内容")
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user