feat: Enhance Swagger documentation with new admin and user endpoints
Some checks failed
build quyun / Build (push) Failing after 2m1s

- Added definitions for admin authentication, media, posts, orders, and user management.
- Implemented new API paths for admin functionalities including authentication, media management, order processing, and user statistics.
- Updated existing endpoints to improve clarity and structure in the Swagger documentation.
- Introduced new response schemas for various operations to standardize API responses.
This commit is contained in:
2025-12-19 23:43:46 +08:00
parent 49072ddd79
commit 7b18a6a0e6
14 changed files with 4180 additions and 120 deletions

View File

@@ -26,9 +26,15 @@ type orders struct {
// List users
//
// @Router /admin/orders [get]
// @Bind pagination query
// @Bind query query
// @Summary 订单列表
// @Tags Admin Orders
// @Produce json
// @Param pagination query requests.Pagination false "分页参数"
// @Param query query OrderListQuery false "筛选条件"
// @Success 200 {object} requests.Pager{items=services.OrderListItem} "成功"
// @Router /admin/orders [get]
// @Bind pagination query
// @Bind query query
func (ctl *orders) List(
ctx fiber.Ctx,
pagination *requests.Pagination,
@@ -47,8 +53,14 @@ func (ctl *orders) List(
}
// Refund
// @Router /admin/orders/:id/refund [post]
// @Bind id path
//
// @Summary 订单退款
// @Tags Admin Orders
// @Produce json
// @Param id path int64 true "订单 ID"
// @Success 200 {object} any "成功"
// @Router /admin/orders/:id/refund [post]
// @Bind id path
func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
order, err := services.Orders.FindByID(ctx, id)
if err != nil {