|
@@ -1,16 +1,15 @@
|
|
|
package main
|
|
|
|
|
|
import (
|
|
|
- "embed"
|
|
|
"flag"
|
|
|
"log"
|
|
|
- "net/http"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
swaggerFiles "github.com/swaggo/files"
|
|
|
ginSwagger "github.com/swaggo/gin-swagger"
|
|
|
"filecloud/internal/database"
|
|
|
"filecloud/internal/handler"
|
|
|
+ "filecloud/service"
|
|
|
// _ "filecloud/docs"
|
|
|
)
|
|
|
|
|
@@ -18,9 +17,6 @@ var (
|
|
|
configPath = flag.String("file", "./config.toml", "config file")
|
|
|
)
|
|
|
|
|
|
-//go:embed public/*
|
|
|
-var publicFS embed.FS
|
|
|
-
|
|
|
// @title FileCloud API
|
|
|
// @version 1.0
|
|
|
// @description FileCloud API documentation
|
|
@@ -39,8 +35,8 @@ func main() {
|
|
|
|
|
|
r := gin.Default()
|
|
|
|
|
|
- // Serve static files from embedded frontend
|
|
|
- r.StaticFS("/", http.FS(publicFS))
|
|
|
+ // 用本地静态文件服务替代 embed,改为 /static 路径
|
|
|
+ r.Static("/static", "./public")
|
|
|
|
|
|
// API routes
|
|
|
api := r.Group("/api")
|