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

@@ -34,10 +34,17 @@ type PreCheckResp struct {
// PreUploadCheck
//
// @Router /admin/uploads/pre-uploaded-check/:md5.:ext [get]
// @Bind md5 path
// @Bind ext path
// @Bind mime query
// @Summary 预上传检查
// @Tags Admin Uploads
// @Produce json
// @Param md5 path string true "文件 MD5"
// @Param ext path string true "文件扩展名(不含点)"
// @Param mime query string true "文件 MIME 类型"
// @Success 200 {object} PreCheckResp "成功"
// @Router /admin/uploads/pre-uploaded-check/:md5.:ext [get]
// @Bind md5 path
// @Bind ext path
// @Bind mime query
func (up *uploads) PreUploadCheck(ctx fiber.Ctx, md5, ext, mime string) (*PreCheckResp, error) {
_, err := services.Medias.GetByHash(ctx, md5)
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
@@ -61,8 +68,14 @@ type PostUploadedForm struct {
// PostUploadedAction
//
// @Router /admin/uploads/post-uploaded-action [post]
// @Bind body body
// @Summary 上传完成回调处理
// @Tags Admin Uploads
// @Accept json
// @Produce json
// @Param body body PostUploadedForm true "请求体"
// @Success 200 {object} any "成功"
// @Router /admin/uploads/post-uploaded-action [post]
// @Bind body body
func (up *uploads) PostUploadedAction(ctx fiber.Ctx, body *PostUploadedForm) error {
m, err := services.Medias.GetByHash(ctx, body.Md5)
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {