golang-yitisheng-server/project_doing.md

32 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 项目过程记录
## 2025-12-17
### [任务执行] 初始化模块 yitisheng/yx_user_score
- **操作目标**: 创建新的业务模块目录,并准备实现用户分数和志愿管理功能。
- **影响范围**: `server/modules/yitisheng/yx_user_score/`
- **修改前记录**: 项目中暂无此模块。
### [任务执行] 修正模块路径并实现 CRUD
- **操作目标**: 根据 Task3.md 要求,将 yx_user_score, yx_volunteer, yx_volunteer_record 实现于 modules/yx/ 下。
- **影响范围**: `server/modules/yx/`
- **修改结果**:
- 删除了错误的 `modules/yitisheng` 目录(尝试删除)。
-`modules/yx` 下实现了 Entity, Mapper, Service, Controller。
- 更新了 `main.go` 注册路由。
### [任务执行] 增加 Swagger 文档访问密码验证
- **操作目标**: 为 Swagger 文档接口添加 Basic Auth 验证,防止未授权访问。
- **影响范围**: `server/config/config.go`, `server/main.go`
- **修改前记录**: Swagger 接口公开,无验证。
- **修改结果**:
- `server/config/config.go`: 新增 `SwaggerConfig` 配置项 (默认 admin/password)。
- `server/main.go`: 为 `/swagger` 路由组添加了 `gin.BasicAuth` 中间件。
### [任务执行] 解决本地调试 CORS 问题
- **操作目标**: 允许前端 Vue3 项目跨域调用后端接口。
- **影响范围**: `server/middleware/cors.go`, `server/main.go`
- **修改前记录**: 后端未配置 CORS前端跨域请求被拦截。
- **修改结果**:
- `server/middleware/cors.go`: 创建了 CORS 中间件,允许 `Origin` 头部指定的来源,并放行 `OPTIONS` 请求。
- `server/main.go`: 全局注册了 CORS 中间件。