archive file

dev-tmp1
luotaiqian 2026-08-25 14:27:23 +08:00
parent 884e3b2ea4
commit 1f9dc83d8d
1 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,61 @@
package org.qinan.safetyeval.domain.constant;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
*
*/
@Getter
@RequiredArgsConstructor
public enum ProjectArchiveFileSourceEnum {
/**
*
*/
AUTO_PROCESS_RECORD("auto_process_record", "流程自动记录"),
/**
*
*/
UPLOAD_ADDITIONAL_FILES("upload_additional_files", "补充上传");
/**
*
*/
private final String code;
/**
*
*/
private final String desc;
public static final String REMARKS = "文件来源 auto_process_record:流程自动记录, upload_additional_files:补充上传";
/**
*
*/
public static ProjectArchiveFileSourceEnum fromCode(String code) {
if (code == null || code.isEmpty()) {
return null;
}
for (ProjectArchiveFileSourceEnum type : values()) {
if (type.code.equals(code)) {
return type;
}
}
throw new IllegalArgumentException("未知的文件来源编码: " + code);
}
/**
*
*/
public static String getDescByCode(String code) {
for (ProjectArchiveFileSourceEnum type : values()) {
if (type.code.equals(code)) {
return type.desc;
}
}
return code;
}
}