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

@@ -21,8 +21,9 @@ elif [[ "$NATIVE_ARCH" == "arm64" ]] || [[ "$NATIVE_ARCH" == "aarch64" ]]; then
NATIVE_ARCH="arm64" NATIVE_ARCH="arm64"
fi fi
# 处理命令行参数 # 处理命令行参数(兼容未提供参数时的 set -u
if [[ "$1" == "-h" || "$1" == "--help" ]]; then ARG1="${1-}"
if [[ "$ARG1" == "-h" || "$ARG1" == "--help" ]]; then
echo -e "${GREEN}PeiPei 后端 Docker 镜像构建脚本${NC}" echo -e "${GREEN}PeiPei 后端 Docker 镜像构建脚本${NC}"
echo "" echo ""
echo -e "${YELLOW}用法:${NC}" echo -e "${YELLOW}用法:${NC}"
@@ -51,7 +52,7 @@ if [[ "$1" == "-h" || "$1" == "--help" ]]; then
exit 0 exit 0
fi fi
TARGET_ARCH="${1:-$NATIVE_ARCH}" TARGET_ARCH="${ARG1:-$NATIVE_ARCH}"
# 验证架构参数 # 验证架构参数
if [[ "$TARGET_ARCH" != "amd64" && "$TARGET_ARCH" != "arm64" ]]; then if [[ "$TARGET_ARCH" != "amd64" && "$TARGET_ARCH" != "arm64" ]]; then

View File

@@ -93,6 +93,19 @@
<artifactId>jave-core</artifactId> <artifactId>jave-core</artifactId>
</dependency> </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> <dependency>
<groupId>com.github.binarywang</groupId> <groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId> <artifactId>weixin-java-pay</artifactId>

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; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@@ -46,6 +48,12 @@ public class PlayClerkDataReviewReturnVo {
@ApiModelProperty(value = "资料类型", example = "1", notes = "0:昵称;1:头像;2:相册;3:录音") @ApiModelProperty(value = "资料类型", example = "1", notes = "0:昵称;1:头像;2:相册;3:录音")
private String dataType; 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 = "资料清晰可见") @ApiModelProperty(value = "备注", example = "资料清晰可见")
private String remark; 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;
}
} }