- 八字页:未绑定生辰时展示虚构示例排盘(1990-08-08 10:30男)与15条字段说明, 附传统文化声明文案;已绑定时支持多档案切换,排盘增强(十神/藏干/纳音/五行配色/命盘概览) - 个人中心:新增生辰管理卡片,每用户免费绑定3个出生年月;登录改为真实微信登录 - 服务端:新增 BirthProfile 模型与 /api/user/birth-profiles 增删查接口,AutoMigrate 建表 - 前端:新增 birth-profile.js 本地存储优先+登录后云端双向同步 - 修复:个人中心 tabBar 页面入口误用 navigateTo 改为 switchTab
祈福小助手后端服务
基于 Go + Gin + Inertia.js 的后端服务。
功能模块
- 用户模块 — 微信登录、资料修改、授权管理
- 支付模块 — 微信支付集成、订单管理
- 许愿树 — 许愿发布、付费许愿、机器人自动许愿
- 管理后台 — 基于 Inertia.js 的前后端分离管理界面
技术栈
- 后端: Go 1.22 + Gin + GORM
- 前端: Inertia.js + React/Vue(待选择)
- 数据库: MySQL
- 缓存: Redis
快速开始
开发环境
# 安装依赖
go mod download
# 启动开发服务器
./scripts/dev.sh
生产构建
# 构建
./scripts/build.sh
# 运行
./bin/lunar-server
项目结构
server/
├── cmd/ # 入口文件
│ └── main.go
├── internal/ # 内部包
│ ├── config/ # 配置
│ ├── handler/ # 处理器
│ ├── middleware/ # 中间件
│ ├── model/ # 数据模型
│ └── service/ # 业务逻辑
├── web/ # Inertia.js 前端
│ ├── src/
│ └── public/
├── migrations/ # 数据库迁移
├── scripts/ # 脚本
└── go.mod
API 接口
用户接口
POST /api/user/login— 用户登录POST /api/user/logout— 用户登出GET /api/user/profile— 获取用户资料PUT /api/user/profile— 更新用户资料POST /api/user/auth— 微信授权
支付接口
POST /api/pay/create— 创建订单POST /api/pay/notify— 支付回调GET /api/pay/status/:orderId— 查询支付状态
订单接口
GET /api/order/list— 订单列表GET /api/order/detail/:id— 订单详情POST /api/order/cancel/:id— 取消订单
许愿接口
GET /api/wish/tree— 获取许愿树POST /api/wish/create— 创建许愿GET /api/wish/list— 许愿列表DELETE /api/wish/:id— 删除许愿
环境变量
参考 .env.local 文件配置。
数据库
执行 migrations/001_init.sql 初始化数据库。