AnCao/README.md
yanlongqi 805c4597af 将Web框架迁移到Gin
- 安装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>
2025-11-03 11:48:39 +08:00

72 lines
1.2 KiB
Markdown

# AnKao Web 项目
这是一个使用Go语言和Gin框架构建的Web应用项目。
## 项目结构
```
AnKao/
├── main.go # 主程序入口
├── internal/ # 私有应用代码
│ ├── handlers/ # HTTP请求处理器
│ ├── middleware/ # 中间件
│ └── models/ # 数据模型
├── pkg/ # 公共库代码
│ └── config/ # 配置管理
├── go.mod # Go模块文件
└── README.md # 项目说明
```
## 快速开始
### 运行服务器
```bash
go run main.go
```
服务器将在 `http://localhost:8080` 启动
### API端点
- `GET /` - 首页,返回欢迎信息
- `GET /api/health` - 健康检查端点
## 开发
### 安装依赖
```bash
go mod tidy
```
### 构建
```bash
go build -o bin/server.exe main.go
```
### 运行编译后的程序
```bash
# Windows
.\bin\server.exe
# Linux/Mac
./bin/server
```
## 特性
- 基于 Gin 框架的高性能 HTTP 服务器
- 自定义日志中间件
- RESTful API 结构
- 健康检查端点
- 支持数据库集成(预留结构)
## 技术栈
- **Go** 1.25.1
- **Gin** v1.11.0 - Web 框架
- 清晰的项目架构,易于扩展