mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-07 18:26:37 +08:00
去除无用代码
This commit is contained in:
@@ -31,17 +31,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: Build Vue image
|
- name: Set up Docker Buildx
|
||||||
if: steps.vue-changes.outputs.vue == 'true'
|
if: steps.vue-changes.outputs.vue == 'true'
|
||||||
run: docker build -t bqlpfy/vue-frontend ./vue-frontend
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Docker login
|
- name: Log in to DockerHub
|
||||||
if: steps.vue-changes.outputs.vue == 'true'
|
if: steps.vue-changes.outputs.vue == 'true'
|
||||||
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
- name: Push Vue image
|
- name: Build and push Vue multi-arch image
|
||||||
if: steps.vue-changes.outputs.vue == 'true'
|
if: steps.vue-changes.outputs.vue == 'true'
|
||||||
run: docker push bqlpfy/vue-frontend
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--push \
|
||||||
|
-t bqlpfy/vue-frontend \
|
||||||
|
./vue-frontend
|
||||||
|
|
||||||
build-java:
|
build-java:
|
||||||
if: contains(github.event.head_commit.message, '[skip java]') == false
|
if: contains(github.event.head_commit.message, '[skip java]') == false
|
||||||
@@ -78,14 +86,22 @@ jobs:
|
|||||||
working-directory: ./springboot-backend
|
working-directory: ./springboot-backend
|
||||||
run: mvn clean package -DskipTests
|
run: mvn clean package -DskipTests
|
||||||
|
|
||||||
- name: Build Java Docker image
|
- name: Set up Docker Buildx
|
||||||
if: steps.java-changes.outputs.java == 'true'
|
if: steps.java-changes.outputs.java == 'true'
|
||||||
run: docker build -t bqlpfy/springboot-backend ./springboot-backend
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Docker login
|
- name: Log in to DockerHub
|
||||||
if: steps.java-changes.outputs.java == 'true'
|
if: steps.java-changes.outputs.java == 'true'
|
||||||
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
- name: Push Java image
|
- name: Build and push Java multi-arch image
|
||||||
if: steps.java-changes.outputs.java == 'true'
|
if: steps.java-changes.outputs.java == 'true'
|
||||||
run: docker push bqlpfy/springboot-backend
|
run: |
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--push \
|
||||||
|
-t bqlpfy/springboot-backend \
|
||||||
|
./springboot-backend
|
||||||
|
|||||||
Regular → Executable
+9
-6
@@ -1,11 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# 先检查 docker-compose 或 docker compose 命令
|
# 解决 macOS 下 tr 可能出现的非法字节序列问题
|
||||||
|
export LANG=en_US.UTF-8
|
||||||
|
export LC_ALL=C
|
||||||
|
|
||||||
|
# 检查 docker-compose 或 docker compose 命令
|
||||||
if command -v docker-compose &> /dev/null; then
|
if command -v docker-compose &> /dev/null; then
|
||||||
DOCKER_CMD="docker-compose"
|
DOCKER_CMD="docker-compose"
|
||||||
elif command -v docker &> /dev/null; then
|
elif command -v docker &> /dev/null; then
|
||||||
# docker 命令存在,再检查子命令 compose
|
|
||||||
if docker compose version &> /dev/null; then
|
if docker compose version &> /dev/null; then
|
||||||
DOCKER_CMD="docker compose"
|
DOCKER_CMD="docker compose"
|
||||||
else
|
else
|
||||||
@@ -25,7 +28,7 @@ curl -L -o gost.sql https://github.com/bqlpfy/forward-panel/raw/refs/heads/main/
|
|||||||
echo "✅ 下载完成"
|
echo "✅ 下载完成"
|
||||||
|
|
||||||
generate_random() {
|
generate_random() {
|
||||||
tr -dc A-Za-z0-9 </dev/urandom | head -c16
|
LC_ALL=C tr -dc 'A-Za-z0-9' </dev/urandom | head -c16
|
||||||
}
|
}
|
||||||
|
|
||||||
read -p "数据库名(留空则随机): " DB_NAME
|
read -p "数据库名(留空则随机): " DB_NAME
|
||||||
@@ -61,11 +64,11 @@ EOF
|
|||||||
echo "✅ .env 文件内容(密码已隐藏):"
|
echo "✅ .env 文件内容(密码已隐藏):"
|
||||||
echo "DB_NAME=$DB_NAME"
|
echo "DB_NAME=$DB_NAME"
|
||||||
echo "DB_USER=$DB_USER"
|
echo "DB_USER=$DB_USER"
|
||||||
echo "DB_PASSWORD=******"
|
echo "DB_PASSWORD=DB_PASSWORD"
|
||||||
echo "JWT_SECRET=******"
|
echo "JWT_SECRET=JWT_SECRET"
|
||||||
echo "SERVER_HOST=$SERVER_HOST"
|
echo "SERVER_HOST=$SERVER_HOST"
|
||||||
|
|
||||||
echo "🚀 启动 docker 服务..."
|
echo "🚀 启动 docker 服务..."
|
||||||
$DOCKER_CMD up -d
|
$DOCKER_CMD up -d
|
||||||
|
|
||||||
echo "🎉 部署完成,前端访问地址:http://$SERVER_HOST"
|
echo "🎉 部署完成,访问地址:服务器ip"
|
||||||
|
|||||||
@@ -92,37 +92,17 @@ public class CodeGenerator {
|
|||||||
focList.add(new FileOutConfig(templatePath) {
|
focList.add(new FileOutConfig(templatePath) {
|
||||||
@Override
|
@Override
|
||||||
public String outputFile(TableInfo tableInfo) {
|
public String outputFile(TableInfo tableInfo) {
|
||||||
// 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
|
|
||||||
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
|
return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
|
||||||
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
|
+ "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
cfg.setFileCreate(new IFileCreate() {
|
|
||||||
@Override
|
|
||||||
public boolean isCreate(ConfigBuilder configBuilder, FileType fileType, String filePath) {
|
|
||||||
// 判断自定义文件夹是否需要创建
|
|
||||||
checkDir("调用默认方法创建的目录,自定义目录用");
|
|
||||||
if (fileType == FileType.MAPPER) {
|
|
||||||
// 已经生成 mapper 文件判断存在,不想重新生成返回 false
|
|
||||||
return !new File(filePath).exists();
|
|
||||||
}
|
|
||||||
// 允许生成模板文件
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
cfg.setFileOutConfigList(focList);
|
cfg.setFileOutConfigList(focList);
|
||||||
mpg.setCfg(cfg);
|
mpg.setCfg(cfg);
|
||||||
|
|
||||||
// 配置模板
|
// 配置模板
|
||||||
TemplateConfig templateConfig = new TemplateConfig();
|
TemplateConfig templateConfig = new TemplateConfig();
|
||||||
|
|
||||||
// 配置自定义输出模板
|
|
||||||
//指定自定义模板路径,注意不要带上.ftl/.vm, 会根据使用的模板引擎自动识别
|
|
||||||
// templateConfig.setEntity("templates/entity2.java");
|
|
||||||
// templateConfig.setService();
|
|
||||||
// templateConfig.setController();
|
|
||||||
|
|
||||||
templateConfig.setXml(null);
|
templateConfig.setXml(null);
|
||||||
mpg.setTemplate(templateConfig);
|
mpg.setTemplate(templateConfig);
|
||||||
|
|||||||
@@ -36,40 +36,5 @@ export default {
|
|||||||
resolve({"code": -1, "msg": error.message || "网络请求失败"});
|
resolve({"code": -1, "msg": error.message || "网络请求失败"});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
|
||||||
put: function(path = '', data = {}) {
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
axios.put(path, data, {
|
|
||||||
timeout: 12000,
|
|
||||||
headers:{
|
|
||||||
"Authorization": window.localStorage.getItem('token'),
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(function(response) {
|
|
||||||
resolve(response.data);
|
|
||||||
})
|
|
||||||
.catch(function(error) {
|
|
||||||
console.error('PUT请求错误:', error);
|
|
||||||
resolve({"code": -1, "msg": error.message || "网络请求失败"});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
delete: function(path = '') {
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
axios.delete(path, {
|
|
||||||
timeout: 12000,
|
|
||||||
headers:{
|
|
||||||
"Authorization": window.localStorage.getItem('token')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(function(response) {
|
|
||||||
resolve(response.data);
|
|
||||||
})
|
|
||||||
.catch(function(error) {
|
|
||||||
console.error('DELETE请求错误:', error);
|
|
||||||
resolve({"code": -1, "msg": error.message || "网络请求失败"});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user