TASK:style;
This commit is contained in:
@@ -16,4 +16,6 @@ import lombok.EqualsAndHashCode;
|
||||
public class WorkspaceDTO extends PageQueryBaseVo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long styleId;
|
||||
|
||||
}
|
||||
|
||||
57
src/main/java/com/ai/da/model/enums/StyleEnum.java
Normal file
57
src/main/java/com/ai/da/model/enums/StyleEnum.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.ai.da.model.enums;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum StyleEnum {
|
||||
// 定义风格及其对应的中英文描述
|
||||
NEO_CHINESE("新中式", "Neo Chinese"),
|
||||
COUNTRY_STYLE("田园风", "Country Style"),
|
||||
FUTURISM("未来主义", "Futurism"),
|
||||
MINIMALISM("极简风", "Minimalism"),
|
||||
LOLITA("洛丽塔", "Lolita"),
|
||||
Y2K("Y2K", "Y2K"),
|
||||
BUSINESS("商务风", "Business"),
|
||||
MERLAD("美拉德", "Merlad"),
|
||||
OUTDOOR_FUNCTIONAL("户外机能", "Outdoor Functional"),
|
||||
ROCK("摇滚", "Rock"),
|
||||
DOPAMINE("多巴胺", "Dopamine"),
|
||||
GOTHIC("哥特风", "Gothic"),
|
||||
POST_APOCALYPTIC("废土", "Post-apocalyptic"),
|
||||
ROMANTIC("浪漫", "Romantic"),
|
||||
WABI_SABI("侘寂", "Wabi-sabi");
|
||||
|
||||
private final String chinese;
|
||||
private final String english;
|
||||
|
||||
// 构造函数
|
||||
StyleEnum(String chinese, String english) {
|
||||
this.chinese = chinese;
|
||||
this.english = english;
|
||||
}
|
||||
|
||||
// 获取中文描述
|
||||
public String getChinese() {
|
||||
return chinese;
|
||||
}
|
||||
|
||||
// 获取英文描述
|
||||
public String getEnglish() {
|
||||
return english;
|
||||
}
|
||||
|
||||
// 重写toString方法,返回格式化的描述
|
||||
@Override
|
||||
public String toString() {
|
||||
return chinese + " (" + english + ")";
|
||||
}
|
||||
public static StyleEnum fromName(String name) {
|
||||
for (StyleEnum style : StyleEnum.values()) {
|
||||
if (style.name().equals(name)) {
|
||||
return style;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("No enum constant for name: " + name);
|
||||
}
|
||||
}
|
||||
16
src/main/java/com/ai/da/model/vo/StyleVO.java
Normal file
16
src/main/java/com/ai/da/model/vo/StyleVO.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.ai.da.model.vo;
|
||||
|
||||
import com.ai.da.mapper.primary.entity.Style;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class StyleVO extends Style {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String value;
|
||||
}
|
||||
@@ -33,4 +33,6 @@ public class WorkspaceVO extends Workspace {
|
||||
|
||||
private BizJson positionEnum;
|
||||
|
||||
private String styleName;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user