123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- package com.qmth.teachcloud.common.enums;
- import java.util.Objects;
- /**
- * @Description: 上传文件类型
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2020/7/15
- */
- public enum UploadFileEnum {
- /**
- * 客户端
- */
- PAPER("paper", "private", ""),
- /**
- * 系统相关
- */
- UPLOAD("upload", "private", ""),
- /**
- * 导入导出
- */
- FILE("file", "public", ""),
- /**
- * 打印pdf相关
- */
- PDF("pdf", "private", ""),
- /**
- * 题卡图片
- */
- IMAGE("image", "private", ""),
- /**
- * 题卡html文件
- */
- HTML("html", "private", ""),
- /**
- * 阅卷考生题卡原图
- */
- SHEET("sheet", "private", ""),
- /**
- * 卡格式文件
- */
- CARD("card", "private", ""),
- /**
- * 适配后卡格式文件
- */
- ADAPTE("adapte", "private", "");
- private String title;
- private String fssType;
- private String pattern;
- UploadFileEnum(String title, String fssType, String pattern) {
- this.title = title;
- this.fssType = fssType;
- this.pattern = pattern;
- }
- public String getTitle() {
- return title;
- }
- public String getFssType() {
- return fssType;
- }
- public String getPattern() {
- return pattern;
- }
- /**
- * 状态转换 toName
- *
- * @param title
- * @return
- */
- public static String convertToName(String title) {
- for (UploadFileEnum e : UploadFileEnum.values()) {
- if (Objects.equals(title, e.getTitle())) {
- return e.name();
- }
- }
- return null;
- }
- /**
- * 状态转换 toName
- *
- * @param title
- * @return
- */
- public static String convertToFssType(String title) {
- for (UploadFileEnum e : UploadFileEnum.values()) {
- if (Objects.equals(title.toLowerCase(), e.getTitle())) {
- return e.getFssType();
- }
- }
- return null;
- }
- }
|