package com.ots.project.exam.domain; import com.ots.common.enums.LangTypeEnum; import com.ots.framework.aspectj.lang.annotation.Excel; import com.ots.framework.web.domain.BaseEntity; import lombok.Getter; import lombok.Setter; import org.springframework.web.multipart.MultipartFile; import java.util.Objects; import static com.ots.common.enums.LangTypeEnum.*; @Getter @Setter public class TLibraryCode extends BaseEntity { private static final long serialVersionUID = 1L; private Long id; @Excel(name = "报告类型", type = Excel.Type.EXPORT) private String reportType; @Excel(name = "Library Code(报告字典编码)") private String libraryCode; @Excel(name = "English Content(英文字典内容)") private String englistContent; @Excel(name = "Chinese Content(中文字典内容)") private String chineseContent; @Excel(name = "Thai Content(泰文字典内容)") private String thaiContent; private String icon; private String dictType; private MultipartFile iconFile; private String score; public String getLangTypeContext(LangTypeEnum langType) { if (Objects.equals("2",dictType)) { return icon; } if (English == langType) { return getEnglistContent(); } if (Chinese == langType) { return getChineseContent(); } if (Thai == langType) { return getThaiContent(); } return ""; } public void setLangTypeContext(String context, LangTypeEnum langType) { if (English == langType) { setEnglistContent(context); } if (Chinese == langType) { setChineseContent(context); } if (Thai == langType) { setThaiContent(context); } } }