feat: add toolbox query, upload module, update config and gitignore
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -27,6 +27,8 @@ import (
|
||||
pay "qnc-server/app/main/api/internal/handler/pay"
|
||||
product "qnc-server/app/main/api/internal/handler/product"
|
||||
query "qnc-server/app/main/api/internal/handler/query"
|
||||
toolbox "qnc-server/app/main/api/internal/handler/toolbox"
|
||||
upload "qnc-server/app/main/api/internal/handler/upload"
|
||||
user "qnc-server/app/main/api/internal/handler/user"
|
||||
"qnc-server/app/main/api/internal/svc"
|
||||
|
||||
@@ -1091,6 +1093,46 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 工具箱统一查询
|
||||
Method: http.MethodPost,
|
||||
Path: "/toolbox/query",
|
||||
Handler: toolbox.ToolboxQueryHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 访问已上传图片
|
||||
Method: http.MethodGet,
|
||||
Path: "/upload/file/:name",
|
||||
Handler: upload.ServeUploadHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
rest.WithMiddlewares(
|
||||
[]rest.Middleware{serverCtx.AuthInterceptor},
|
||||
[]rest.Route{
|
||||
{
|
||||
// 图片 Base64 上传
|
||||
Method: http.MethodPost,
|
||||
Path: "/upload/image",
|
||||
Handler: upload.UploadImageHandler(serverCtx),
|
||||
},
|
||||
}...,
|
||||
),
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user