b2cc27b8f54fc8486293afaeaf33b2436229c0f2
将 bookmark 和 user_np 服务的生成配置分离为 server 和 client 包, 并更新了相应的导入路径。同时更新了 OpenAPI 配置文件中的包名、输出路径及 启用 strict-server 模式以增强类型安全。 此外,同步更新了 VFS 服务的客户端和服务端生成配置,并完善了其 OpenAPI 错误响应定义与二进制内容支持,增强了 API 的规范性和健壮性。 修复了部分权限校验逻辑,并调整了中间件注册方式以适配新的严格模式接口。
# https://gin-gonic.com/zh-cn/docs/quickstart/
go get -u github.com/gin-gonic/gin
# https://github.com/swaggo/gin-swagger
go install github.com/swaggo/swag/cmd/swag@latest
swag init
go get -u github.com/swaggo/gin-swagger
go get -u github.com/swaggo/files
# [link](https://github.com/oapi-codegen/oapi-codegen/?tab=readme-ov-file)
# this will then modify your `go.mod`
go get -tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest
#go:generate go tool oapi-codegen -config cfg.yaml ../../api.yaml
go tool oapi-codegen -config cfg.yaml api.yaml
# https://go-lang.org.cn/doc/tutorial/govulncheck
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
go install github.com/magefile/mage@latest
mage -init
mage build
//go:build mage
package main
import (
"github.com/magefile/mage/sh"
)
// Runs go mod download and then installs the binary.
func Build() error {
if err := sh.Run("go", "mod", "download"); err != nil {
return err
}
return sh.Run("go", "install", "./...")
}
// on vscode settings.json
{
"gopls": {
"buildFlags": ["-tags=mage"]
}
}
Description
Languages
Go
100%