Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/gxwebsoft/shop/entity/ShopCoupon.java
This commit is contained in:
2025-08-12 00:02:14 +08:00
47 changed files with 2576 additions and 579 deletions

View File

@@ -27,9 +27,9 @@ public class ShopGenerator {
// 输出目录
private static final String OUTPUT_DIR = "/src/main/java";
// Vue文件输出位置
private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/mp-vue";
private static final String OUTPUT_LOCATION_VUE = "/Users/liangxin/Project/Html/web/mp-vue";
// Vue文件输出目录
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/template-10550";
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/liangxin/Project/Html/miniProgram/template-10550";
// Vue文件输出目录
private static final String OUTPUT_DIR_VUE = "/src";
// 作者名称
@@ -37,7 +37,7 @@ public class ShopGenerator {
// 是否在xml中添加二级缓存配置
private static final boolean ENABLE_CACHE = false;
// 数据库连接配置
private static final String DB_URL = "jdbc:mysql://47.119.165.234:3308/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8";
private static final String DB_URL = "jdbc:mysql://8.134.169.209:13306/modules?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8";
private static final String DB_DRIVER = "com.mysql.cj.jdbc.Driver";
private static final String DB_USERNAME = "modules";
private static final String DB_PASSWORD = "8YdLnk7KsPAyDXGA";
@@ -100,6 +100,7 @@ public class ShopGenerator {
// "shop_express",
// "shop_express_template",
// "shop_express_template_detail"
"shop_gift"
};
// 需要去除的表前缀
private static final String[] TABLE_PREFIX = new String[]{

View File

@@ -0,0 +1,79 @@
package com.gxwebsoft.shop;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/**
* 证书路径构建测试
*
* @author 科技小王子
* @since 2025-08-09
*/
public class CertificatePathTest {
@Test
public void testDevCertificatePath() {
// 模拟开发环境配置
String uploadPath = "/Users/gxwebsoft/JAVA/mp-java/src/main/resources/";
Integer tenantId = 10324;
String privateKeyFile = "apiclient_key.pem";
// 构建证书路径
String tenantCertPath = uploadPath + "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + privateKeyFile;
// 验证路径构建结果
String expectedTenantPath = "/Users/gxwebsoft/JAVA/mp-java/src/main/resources/dev/wechat/10324";
String expectedPrivateKeyPath = "/Users/gxwebsoft/JAVA/mp-java/src/main/resources/dev/wechat/10324/apiclient_key.pem";
assertEquals(expectedTenantPath, tenantCertPath);
assertEquals(expectedPrivateKeyPath, privateKeyPath);
System.out.println("开发环境证书路径测试通过:");
System.out.println("租户证书目录: " + tenantCertPath);
System.out.println("私钥文件路径: " + privateKeyPath);
}
@Test
public void testProdCertificatePath() {
// 模拟生产环境配置
String uploadPath = "/www/wwwroot/file.ws";
Integer tenantId = 10324;
String privateKeyFile = "apiclient_key.pem";
// 构建证书路径生产环境不使用upload-path而是从数据库读取
// 这里只是为了对比展示
String tenantCertPath = uploadPath + "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + privateKeyFile;
// 验证路径构建结果
String expectedTenantPath = "/www/wwwroot/file.ws/dev/wechat/10324";
String expectedPrivateKeyPath = "/www/wwwroot/file.ws/dev/wechat/10324/apiclient_key.pem";
assertEquals(expectedTenantPath, tenantCertPath);
assertEquals(expectedPrivateKeyPath, privateKeyPath);
System.out.println("生产环境证书路径测试通过:");
System.out.println("租户证书目录: " + tenantCertPath);
System.out.println("私钥文件路径: " + privateKeyPath);
}
@Test
public void testMultipleTenants() {
String uploadPath = "/Users/gxwebsoft/JAVA/mp-java/src/main/resources/";
String privateKeyFile = "apiclient_key.pem";
// 测试多个租户的路径构建
Integer[] tenantIds = {10324, 10325, 10326};
for (Integer tenantId : tenantIds) {
String tenantCertPath = uploadPath + "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + privateKeyFile;
assertTrue(tenantCertPath.contains(tenantId.toString()));
assertTrue(privateKeyPath.endsWith(privateKeyFile));
System.out.println("租户 " + tenantId + " 证书路径: " + privateKeyPath);
}
}
}