feat: Add initial license manager backend application, configuration, and development installation documentation.

This commit is contained in:
wood911010 committed 2026-02-14 19:22:07 +08:00
1 parent 5f944dd88a
commit 91fe674dea
2 files changed
+22 -3

No files matched your search

+13 -3
View File
@@ -1,6 +1,7 @@
package main package main
import ( import (
"flag"
"fmt" "fmt"
"log" "log"
"os" "os"
@@ -36,10 +37,19 @@ import (
// @description Bearer token for authentication // @description Bearer token for authentication
func main() { func main() {
// 定义命令行参数
var customPath string
flag.StringVar(&customPath, "config", "", "path to configuration file")
flag.StringVar(&customPath, "c", "", "path to configuration file (shorthand)")
flag.Parse()
// 加载配置 // 加载配置
configPath := "config.yaml" // Docker 环境默认路径 configPath := customPath
if _, err := os.Stat(configPath); os.IsNotExist(err) { if configPath == "" {
configPath = "../configs/config.yaml" // 本地开发环境 configPath = "config.yaml" // Docker 环境默认路径
if _, err := os.Stat(configPath); os.IsNotExist(err) {
configPath = "../configs/config.yaml" // 本地开发环境
}
} }
if err := config.Load(configPath); err != nil { if err := config.Load(configPath); err != nil {
+9
View File
@@ -0,0 +1,9 @@
## 本地开发环境
```bash
# 使用默认配置
go run cmd/main.go
# 指定配置文件
go run . -config configs/config.dev.yaml
```