- 新增许愿树页面(Canvas绘制、许愿条展示) - 新增许愿详情页面 - 新增许愿创建弹窗(免费/付费两种模式) - 新增网络请求封装 utils/request.js - 新增Go后端项目结构(Gin + Inertia.js) - 新增用户、订单、许愿数据模型 - 新增数据库迁移脚本 - 更新.gitignore补全忽略规则 - 更新.env.local配置(robot=2, 版本1.0.1) - 添加secrets目录说明文档
40 lines
635 B
Go
40 lines
635 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// CreateOrder 创建订单
|
|
func CreateOrder(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"code": 0,
|
|
"msg": "success",
|
|
"data": gin.H{
|
|
"orderId": "example-order-id",
|
|
},
|
|
})
|
|
}
|
|
|
|
// PayNotify 支付回调
|
|
func PayNotify(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"code": "SUCCESS",
|
|
"msg": "OK",
|
|
})
|
|
}
|
|
|
|
// GetPayStatus 获取支付状态
|
|
func GetPayStatus(c *gin.Context) {
|
|
orderId := c.Param("orderId")
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"code": 0,
|
|
"msg": "success",
|
|
"data": gin.H{
|
|
"orderId": orderId,
|
|
"status": "pending",
|
|
},
|
|
})
|
|
}
|