fix: SiteType 改为引擎类型,与 mediabot 对齐
nexusphp/mtorrent/mteam/pttime/gazelle/unit3d/jsonapi/unknown DB默认值 private → unknown
This commit is contained in:
@@ -4,12 +4,17 @@ import com.baomidou.mybatisplus.annotation.EnumValue;
|
|||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点类型枚举
|
* 站点引擎类型(与 mediabot 保持一致)。
|
||||||
*/
|
*/
|
||||||
public enum SiteType {
|
public enum SiteType {
|
||||||
PRIVATE("private", "私有站点"),
|
NEXUSPHP("nexusphp", "NexusPHP"),
|
||||||
PUBLIC("public", "公开站点"),
|
MTORRENT("mtorrent", "MTorrent"),
|
||||||
SEMI_PUBLIC("semi_public", "半公开站点");
|
MTEAM("mteam", "M-Team API"),
|
||||||
|
PTTIME("pttime", "PTTime"),
|
||||||
|
GAZELLE("gazelle", "Gazelle"),
|
||||||
|
UNIT3D("unit3d", "UNIT3D"),
|
||||||
|
JSONAPI("jsonapi", "JSON API"),
|
||||||
|
UNKNOWN("unknown", "未知");
|
||||||
|
|
||||||
@EnumValue
|
@EnumValue
|
||||||
@JsonValue
|
@JsonValue
|
||||||
@@ -22,13 +27,8 @@ public enum SiteType {
|
|||||||
this.label = label;
|
this.label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() { return value; }
|
||||||
return value;
|
public String getLabel() { return label; }
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SiteType fromValue(String value) {
|
public static SiteType fromValue(String value) {
|
||||||
for (SiteType type : values()) {
|
for (SiteType type : values()) {
|
||||||
@@ -36,6 +36,6 @@ public enum SiteType {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PRIVATE;
|
return UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class SiteServiceImpl implements SiteService {
|
|||||||
site.setDescription(description);
|
site.setDescription(description);
|
||||||
site.setBaseUrl(baseUrl);
|
site.setBaseUrl(baseUrl);
|
||||||
site.setIconUrl(iconUrl);
|
site.setIconUrl(iconUrl);
|
||||||
site.setSiteType(siteType != null ? com.par.core.enums.SiteType.fromValue(siteType) : com.par.core.enums.SiteType.PRIVATE);
|
site.setSiteType(siteType != null ? com.par.core.enums.SiteType.fromValue(siteType) : com.par.core.enums.SiteType.UNKNOWN);
|
||||||
site.setSchemaVersion("1.0.0");
|
site.setSchemaVersion("1.0.0");
|
||||||
site.setStatus(SiteStatus.ACTIVE);
|
site.setStatus(SiteStatus.ACTIVE);
|
||||||
site.setSubmitterId(submitterId);
|
site.setSubmitterId(submitterId);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ CREATE TABLE sites (
|
|||||||
description TEXT COMMENT '站点描述',
|
description TEXT COMMENT '站点描述',
|
||||||
base_url VARCHAR(500) COMMENT '站点基础URL',
|
base_url VARCHAR(500) COMMENT '站点基础URL',
|
||||||
icon_url VARCHAR(500) COMMENT '站点图标URL',
|
icon_url VARCHAR(500) COMMENT '站点图标URL',
|
||||||
site_type VARCHAR(50) NOT NULL DEFAULT 'private' COMMENT '站点类型: private/public/xxx',
|
site_type VARCHAR(50) NOT NULL DEFAULT 'unknown' COMMENT '站点引擎类型: nexusphp/mtorrent/mteam/...',
|
||||||
schema_version VARCHAR(20) NOT NULL DEFAULT '1.0.0' COMMENT '当前生效的schema版本',
|
schema_version VARCHAR(20) NOT NULL DEFAULT '1.0.0' COMMENT '当前生效的schema版本',
|
||||||
current_config_id BIGINT UNSIGNED COMMENT '当前生效的配置版本ID(site_configs.id)',
|
current_config_id BIGINT UNSIGNED COMMENT '当前生效的配置版本ID(site_configs.id)',
|
||||||
status VARCHAR(20) NOT NULL DEFAULT 'active' COMMENT '站点状态: active/pending/deprecated',
|
status VARCHAR(20) NOT NULL DEFAULT 'active' COMMENT '站点状态: active/pending/deprecated',
|
||||||
|
|||||||
Reference in New Issue
Block a user