docs: add false completion prevention rules and fix swagger gaps

Changes:
- Add FALSE_COMPLETION_PREVENTION.md documenting false completion patterns
- Add integrity check script (scripts/check-integrity.sh) for automated verification
- Fix swagger annotation gaps in 3 handlers (+10 annotations):
  - password_reset_handler.go: +4 annotations
  - totp_handler.go: +4 annotations
  - log_handler.go: +2 annotations
- Define IntegrationRedisSuite type for Redis integration tests
- Update QUALITY_STANDARD.md with swagger completeness and response format requirements
- Update PROJECT_EXPERIENCE_SUMMARY.md with new learnings on false completion

Integrity check now validates:
- Swagger annotation completeness per handler
- Response format uniformity (with OAuth whitelist)
- Test infrastructure type definitions
- Repository test coverage
This commit is contained in:
2026-04-11 23:38:43 +08:00
parent 339c740365
commit 4193b46b5f
8 changed files with 585 additions and 2 deletions

View File

@@ -156,6 +156,20 @@ func (h *LogHandler) GetLoginLogs(c *gin.Context) {
})
}
// GetOperationLogs 获取操作日志列表
// @Summary 获取操作日志列表
// @Description 获取所有操作日志(仅管理员),支持游标分页和偏移分页
// @Tags 日志
// @Produce json
// @Security BearerAuth
// @Param cursor query string false "游标分页游标"
// @Param size query int false "每页数量(游标模式)"
// @Param page query int false "页码"
// @Param page_size query int false "每页数量"
// @Success 200 {object} Response{data=OperationLogListResponse} "操作日志列表"
// @Failure 403 {object} Response "无权限"
// @Failure 500 {object} Response "服务器错误"
// @Router /api/v1/admin/logs/operation [get]
func (h *LogHandler) GetOperationLogs(c *gin.Context) {
var req service.ListOperationLogRequest
if err := c.ShouldBindQuery(&req); err != nil {
@@ -197,6 +211,19 @@ func (h *LogHandler) GetOperationLogs(c *gin.Context) {
})
}
// ExportLoginLogs 导出登录日志
// @Summary 导出登录日志
// @Description 导出登录日志为 CSV 文件
// @Tags 日志
// @Produce json
// @Security BearerAuth
// @Param start_time query string false "开始时间"
// @Param end_time query string false "结束时间"
// @Param user_id query int64 false "用户ID"
// @Success 200 {file} file "CSV文件"
// @Failure 403 {object} Response "无权限"
// @Failure 500 {object} Response "服务器错误"
// @Router /api/v1/admin/logs/login/export [get]
func (h *LogHandler) ExportLoginLogs(c *gin.Context) {
var req service.ExportLoginLogRequest
if err := c.ShouldBindQuery(&req); err != nil {