feat: add toolbox query, upload module, update config and gitignore

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Mrx
2026-05-21 17:29:35 +08:00
parent 0a0ca7bf9b
commit 144d5507dd
22 changed files with 11184 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
package upload
import (
"net/http"
uploadlogic "qnc-server/app/main/api/internal/logic/upload"
"qnc-server/app/main/api/internal/svc"
"qnc-server/app/main/api/internal/types"
"qnc-server/common/result"
"github.com/zeromicro/go-zero/rest/httpx"
)
func ServeUploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ServeUploadFileReq
if err := httpx.Parse(r, &req); err != nil {
result.ParamErrorResult(r, w, err)
return
}
l := uploadlogic.NewServeUploadLogic(r.Context(), svcCtx)
if err := l.ServeUpload(req.Name, w); err != nil {
result.HttpResult(r, w, nil, err)
}
}
}