- 安装Gin框架 v1.11.0 - 重构main.go使用Gin路由器 - 更新handlers使用gin.Context - 重构middleware使用Gin中间件模式 - 更新项目文档(README.md, CLAUDE.md) 项目现已准备好进行数据库集成和前端集成 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
385 B
Go
23 lines
385 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// HomeHandler 首页处理器
|
|
func HomeHandler(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"message": "欢迎使用AnKao Web服务",
|
|
"version": "1.0.0",
|
|
})
|
|
}
|
|
|
|
// HealthCheckHandler 健康检查处理器
|
|
func HealthCheckHandler(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"status": "healthy",
|
|
})
|
|
}
|