Merged
Conversation
TethysPlex
reviewed
Jul 6, 2025
OrenZhang
suggested changes
Jul 6, 2025
OrenZhang
reviewed
Jul 6, 2025
refactor: 项目列表
OrenZhang
suggested changes
Jul 6, 2025
OrenZhang
reviewed
Jul 6, 2025
There was a problem hiding this comment.
Pull Request Overview
该 PR 为后台管理新增“被举报项目列表”接口,包含路由、处理器、查询逻辑和文档等改动。
- 注册
/api/v1/admin/projects/report路由并添加管理员权限校验中间件 - 实现
GetProjectsList接口与对应的QueryProjectsList数据查询逻辑 - 更新项目路由与 Dashboard 路由的 Swagger 注解格式
- 在
swagger.yaml(及同步更新的swagger.json、docs.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
previously approved these changes
Jul 6, 2025
TethysPlex
previously approved these changes
Jul 7, 2025
OrenZhang
suggested changes
Jul 8, 2025
chenyme
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
例行检查
变更内容
后台管理增加被举报项目列表接口