Skip to content

feat: 后台管理增加被举报项目列表接口#66

Merged
chenyme merged 13 commits intolinux-do:masterfrom
yyg-max:yyg
Jul 9, 2025
Merged

feat: 后台管理增加被举报项目列表接口#66
chenyme merged 13 commits intolinux-do:masterfrom
yyg-max:yyg

Conversation

@yyg-max
Copy link
Copy Markdown
Collaborator

@yyg-max yyg-max commented Jul 6, 2025

例行检查

  • 我已阅读并理解 贡献者公约
  • 我已阅读并同意 贡献者许可协议 (CLA),确认我的贡献将根据项目的 MIT 许可证进行许可,
  • 我知晓如果此 PR 并不做出实质性更改,或可被认为是为了PR被合并而提交PR的,则可能不会被合并,

变更内容
后台管理增加被举报项目列表接口

@OrenZhang OrenZhang requested a review from Copilot July 6, 2025 09:32

This comment was marked as outdated.

refactor: 项目列表
@OrenZhang OrenZhang requested a review from Copilot July 6, 2025 11:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

该 PR 为后台管理新增“被举报项目列表”接口,包含路由、处理器、查询逻辑和文档等改动。

  • 注册 /api/v1/admin/projects/report 路由并添加管理员权限校验中间件
  • 实现 GetProjectsList 接口与对应的 QueryProjectsList 数据查询逻辑
  • 更新项目路由与 Dashboard 路由的 Swagger 注解格式
  • swagger.yaml(及同步更新的 swagger.jsondocs.go)中新增并完善接口文档

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

File Description
internal/router/router.go 添加 /admin/projects/report 路由及中间件
internal/apps/admin/routers.go 新增 GetProjectsList 接口及请求/响应结构
internal/apps/admin/utils.go 实现 QueryProjectsList 数据查询逻辑
docs/swagger.yaml 新增并同步更新 admin 接口的 Swagger 文档
Comments suppressed due to low confidence (4)

internal/apps/admin/middlewares.go:44

  • 当前在管理员权限校验失败时返回 404,语义上应使用 403 Forbidden 以明确表示无权限访问。
			c.AbortWithStatusJSON(http.StatusNotFound, gin.H{"error_msg": UserNotFound, "data": nil})

internal/apps/admin/err.go:28

  • [nitpick] UserNotFound 错误消息为“未找到用户”,但在管理员权限校验中使用,建议提供更明确的权限不足或未授权提示。
	UserNotFound = "未找到用户"

internal/apps/admin/routers.go:51

  • 新增的管理端接口缺少单元测试或集成测试,建议为 GetProjectsList 方法补充相应测试以保证功能稳定性。
func GetProjectsList(c *gin.Context) {

docs/swagger.yaml:2

  • [nitpick] Swagger 文档中的 admin.ListProjectsResponse 在 swagger.yaml、swagger.json 和 docs.go 中重复出现,建议抽取公用模板或通过自动化工具生成以减少维护成本。
  admin.ListProjectsResponse:

OrenZhang
OrenZhang previously approved these changes Jul 6, 2025
TethysPlex
TethysPlex previously approved these changes Jul 6, 2025
Copy link
Copy Markdown
Collaborator

@TethysPlex TethysPlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yyg-max yyg-max dismissed stale reviews from TethysPlex and OrenZhang via 80e9e37 July 6, 2025 13:23
TethysPlex
TethysPlex previously approved these changes Jul 7, 2025
@yyg-max yyg-max closed this Jul 7, 2025
@yyg-max yyg-max deleted the yyg branch July 7, 2025 16:03
@yyg-max yyg-max restored the yyg branch July 8, 2025 08:10
@yyg-max yyg-max reopened this Jul 8, 2025
@yyg-max yyg-max requested review from OrenZhang and TethysPlex July 8, 2025 08:22
@yyg-max yyg-max requested a review from chenyme July 9, 2025 02:22
@chenyme chenyme merged commit 857d75c into linux-do:master Jul 9, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants