docker push不上去,尝试加入github action在服务器构建

This commit is contained in:
irving
2025-10-03 23:25:48 -04:00
parent 29da6b906b
commit 043483a076
4 changed files with 118 additions and 4 deletions

View File

@@ -0,0 +1,65 @@
package com.starry.admin.modules.clerk.module.enums;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
/**
* 店员资料类型枚举
*
* @author admin
* @since 2024-05-19
*/
@ApiModel(value = "店员资料类型", description = "店员资料审核的数据类型枚举")
public enum ClerkDataType {
NICKNAME("0", "昵称"),
AVATAR("1", "头像"),
PHOTO_ALBUM("2", "相册"),
RECORDING("3", "录音");
private final String code;
private final String description;
ClerkDataType(String code, String description) {
this.code = code;
this.description = description;
}
@JsonValue
public String getCode() {
return code;
}
public String getDescription() {
return description;
}
/**
* 根据代码获取枚举
* @param code 代码
* @return 枚举值
*/
@JsonCreator
public static ClerkDataType fromCode(String code) {
if (code == null) {
return null;
}
for (ClerkDataType type : ClerkDataType.values()) {
if (type.code.equals(code)) {
return type;
}
}
throw new IllegalArgumentException("Unknown code: " + code);
}
/**
* 根据代码获取描述
* @param code 代码
* @return 描述
*/
public static String getDescriptionByCode(String code) {
ClerkDataType type = fromCode(code);
return type != null ? type.description : null;
}
}

View File

@@ -1,5 +1,7 @@
package com.starry.admin.modules.clerk.module.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.starry.admin.modules.clerk.module.enums.ClerkDataType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
@@ -46,6 +48,12 @@ public class PlayClerkDataReviewReturnVo {
@ApiModelProperty(value = "资料类型", example = "1", notes = "0:昵称;1:头像;2:相册;3:录音")
private String dataType;
/**
* 资料类型枚举(新增字段,用于类型安全)
*/
@ApiModelProperty(value = "资料类型枚举", example = "AVATAR", notes = "NICKNAME:昵称, AVATAR:头像, PHOTO_ALBUM:相册, RECORDING:录音")
private ClerkDataType dataTypeEnum;
/**
* 资料内容
*/
@@ -88,4 +96,31 @@ public class PlayClerkDataReviewReturnVo {
@ApiModelProperty(value = "备注", example = "资料清晰可见")
private String remark;
// 自定义setter方法保持两个字段的同步
public void setDataType(String dataType) {
this.dataType = dataType;
try {
this.dataTypeEnum = ClerkDataType.fromCode(dataType);
} catch (Exception e) {
this.dataTypeEnum = null;
}
}
public void setDataTypeEnum(ClerkDataType dataTypeEnum) {
this.dataTypeEnum = dataTypeEnum;
this.dataType = dataTypeEnum != null ? dataTypeEnum.getCode() : null;
}
public ClerkDataType getDataTypeEnum() {
// 如果枚举字段为null但字符串字段有值尝试从字符串转换
if (dataTypeEnum == null && dataType != null) {
try {
dataTypeEnum = ClerkDataType.fromCode(dataType);
} catch (Exception e) {
// 转换失败时保持null
}
}
return dataTypeEnum;
}
}