小程序开发-服务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

80 lines
2.0 KiB

#!/bin/bash
echo "=== 移动端页面文件生成器测试 ==="
echo ""
# 检查模板文件是否存在
echo "📋 检查移动端页面模板文件:"
templates=(
"index.config.ts.btl"
"index.tsx.btl"
"add.config.ts.btl"
"add.tsx.btl"
)
TEMPLATE_DIR="src/test/java/com/gxwebsoft/generator/templates"
for template in "${templates[@]}"; do
if [ -f "${TEMPLATE_DIR}/${template}" ]; then
echo "${template} 存在"
else
echo "${template} 缺失"
fi
done
echo ""
# 检查生成器文件是否已更新
echo "🔧 检查生成器文件更新:"
generators=(
"ShopGenerator"
"CmsGenerator"
)
GENERATOR_DIR="src/test/java/com/gxwebsoft/generator"
for gen in "${generators[@]}"; do
if [ -f "${GENERATOR_DIR}/${gen}.java" ]; then
echo "${gen}.java 存在"
# 检查是否包含移动端页面生成配置
if grep -q "移动端页面文件生成" "${GENERATOR_DIR}/${gen}.java"; then
echo "${gen}.java 已包含移动端页面生成配置"
else
echo "${gen}.java 未包含移动端页面生成配置"
fi
else
echo "${gen}.java 缺失"
fi
done
echo ""
# 检查文档文件
echo "📚 检查文档文件:"
if [ -f "docs/MOBILE_PAGE_GENERATOR.md" ]; then
echo "✅ 移动端页面生成器使用说明文档存在"
else
echo "❌ 移动端页面生成器使用说明文档缺失"
fi
echo ""
echo "=== 使用说明 ==="
echo "1. 配置生成器中的表名 (TABLE_NAMES)"
echo "2. 确保 OUTPUT_LOCATION_UNIAPP 路径正确"
echo "3. 运行对应的生成器主方法"
echo "4. 检查生成的移动端页面文件"
echo ""
echo "=== 生成的文件结构示例 ==="
echo "{OUTPUT_LOCATION_UNIAPP}/src/{模块名}/{表名}/"
echo "├── index.config.ts # 列表页面配置"
echo "├── index.tsx # 列表页面组件"
echo "├── add.config.ts # 新增/编辑页面配置"
echo "└── add.tsx # 新增/编辑页面组件"
echo ""
echo "测试完成!"