docker push不上去,尝试加入github action在服务器构建
This commit is contained in:
@@ -21,8 +21,9 @@ elif [[ "$NATIVE_ARCH" == "arm64" ]] || [[ "$NATIVE_ARCH" == "aarch64" ]]; then
|
||||
NATIVE_ARCH="arm64"
|
||||
fi
|
||||
|
||||
# 处理命令行参数
|
||||
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||
# 处理命令行参数(兼容未提供参数时的 set -u)
|
||||
ARG1="${1-}"
|
||||
if [[ "$ARG1" == "-h" || "$ARG1" == "--help" ]]; then
|
||||
echo -e "${GREEN}PeiPei 后端 Docker 镜像构建脚本${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}用法:${NC}"
|
||||
@@ -51,7 +52,7 @@ if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARGET_ARCH="${1:-$NATIVE_ARCH}"
|
||||
TARGET_ARCH="${ARG1:-$NATIVE_ARCH}"
|
||||
|
||||
# 验证架构参数
|
||||
if [[ "$TARGET_ARCH" != "amd64" && "$TARGET_ARCH" != "arm64" ]]; then
|
||||
|
||||
@@ -93,6 +93,19 @@
|
||||
<artifactId>jave-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Include native ffmpeg binaries for common runtimes to avoid
|
||||
build-platform vs target-platform mismatches in Docker builds. -->
|
||||
<dependency>
|
||||
<groupId>ws.schild</groupId>
|
||||
<artifactId>jave-nativebin-linux64</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ws.schild</groupId>
|
||||
<artifactId>jave-nativebin-osxm1</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-pay</artifactId>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user