- 实现数据库连接和自动迁移 - 实现用户服务(登录、资料、JWT认证) - 实现许愿服务(创建、列表、机器人许愿) - 实现订单服务(创建、支付、状态管理) - 实现JWT认证中间件 - 实现管理后台API(仪表盘、用户、订单、许愿、设置) - 创建Inertia.js前端页面(Vue3 + Tailwind CSS) - 修复Go模块依赖问题
48 lines
897 B
Go
48 lines
897 B
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// AdminDashboard 管理后台首页
|
|
func AdminDashboard(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", gin.H{
|
|
"title": "管理后台",
|
|
"page": "dashboard",
|
|
})
|
|
}
|
|
|
|
// AdminUsers 用户管理
|
|
func AdminUsers(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", gin.H{
|
|
"title": "用户管理",
|
|
"page": "users",
|
|
})
|
|
}
|
|
|
|
// AdminOrders 订单管理
|
|
func AdminOrders(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", gin.H{
|
|
"title": "订单管理",
|
|
"page": "orders",
|
|
})
|
|
}
|
|
|
|
// AdminWishes 许愿管理
|
|
func AdminWishes(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", gin.H{
|
|
"title": "许愿管理",
|
|
"page": "wishes",
|
|
})
|
|
}
|
|
|
|
// AdminSettings 系统设置
|
|
func AdminSettings(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "index.html", gin.H{
|
|
"title": "系统设置",
|
|
"page": "settings",
|
|
})
|
|
}
|