chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-sandbox</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-sandbox-spec</artifactId>
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.xspaceagi.sandbox.spec.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 沙盒配置类型枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum SandboxConfigTypeEnum {
|
||||
RESOURCE(0, "resource", "资源配置"),
|
||||
SERVERS(1, "servers", "服务器配置"),
|
||||
POLICY(2, "policy", "策略配置");
|
||||
|
||||
private final Integer key;
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
SandboxConfigTypeEnum(Integer key, String code, String description) {
|
||||
this.key = key;
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static SandboxConfigTypeEnum fromCode(String code) {
|
||||
for (SandboxConfigTypeEnum value : SandboxConfigTypeEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SandboxConfigTypeEnum fromKey(Integer key) {
|
||||
for (SandboxConfigTypeEnum value : SandboxConfigTypeEnum.values()) {
|
||||
if (value.getKey().equals(key)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.xspaceagi.sandbox.spec.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 沙盒配置范围枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum SandboxScopeEnum {
|
||||
GLOBAL(0, "global", "全局配置"),
|
||||
USER(1, "user", "个人配置");
|
||||
|
||||
private final Integer key;
|
||||
private final String code;
|
||||
private final String description;
|
||||
|
||||
SandboxScopeEnum(Integer key, String code, String description) {
|
||||
this.key = key;
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static SandboxScopeEnum fromCode(String code) {
|
||||
for (SandboxScopeEnum value : SandboxScopeEnum.values()) {
|
||||
if (value.getCode().equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SandboxScopeEnum fromKey(Integer key) {
|
||||
for (SandboxScopeEnum value : SandboxScopeEnum.values()) {
|
||||
if (value.getKey().equals(key)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user