refactor(bookmark): 重构书签服务入口文件并整合用户权限功能

将 bookmark.go 重命名为 main.go,并调整包引用路径。将 bookmarks 和 user_np
两个模块的处理逻辑合并到同一个服务中,统一注册路由。同时更新了相关 API
的引用路径,确保生成代码与内部实现正确绑定。

此外,移除了独立的 user_np 服务入口文件,其功能已整合至 bookmark 服务中。

配置文件中调整了 user_np 和 vfs 服务的端口及部分接口定义,完善了用户
相关操作的路径参数和请求体结构。
This commit is contained in:
zzy
2025-09-25 09:50:35 +08:00
parent 1e81e603de
commit 24f238f377
23 changed files with 1173 additions and 601 deletions

View File

@ -10,18 +10,23 @@ import (
// mg contains helpful utility functions, like Deps
)
//go:generate go tool oapi-codegen -config config/bookmark/client.yaml config/bookmark/bookmark.yaml
//go:generate go tool oapi-codegen -config config/bookmark/server.yaml config/bookmark/bookmark.yaml
//go:generate go tool oapi-codegen -config config/vfs/server.yaml config/vfs/vfs.yaml
//go:generate go tool oapi-codegen -config config/vfs/client.yaml config/vfs/vfs.yaml
//go:generate go tool oapi-codegen -config config/user_np/server.yaml config/user_np/user_np.yaml
// Default target to run when none is specified
// If not set, running mage will list available targets
// var Default = Build
func BuildAll() error {
func Build_All() error {
services := []struct {
Name string
Path string
}{
{"openapi", "."},
{"vfs_api", "."},
{"bookmark", "./cmd/bookmark"},
{"user_np", "./cmd/user_np"},
}
platforms := []struct {
@ -53,9 +58,7 @@ func BuildAll() error {
// 使用 release 模式构建并显示链接信息
cmd := exec.Command("go", "build",
"-x",
"-ldflags", "-s -w -extldflags -static", // 去除调试信息,减小体积
"-v", // 显示编译过程中的包信息
"-o", outputName,
service.Path)
cmd.Env = env