refactor: 对齐后端样例工程规范

This commit is contained in:
2026-07-26 18:24:13 +08:00
parent 4382641e19
commit 4f2bb7e88b
66 changed files with 1869 additions and 660 deletions

View File

@@ -0,0 +1,31 @@
// 平台 API 的数据库迁移与版本命令行工具。
package main
import (
"fmt"
"os"
"git.apinb.com/heqiapp/platforms/backend/api/internal/config"
"git.apinb.com/heqiapp/platforms/backend/api/internal/impl"
_ "git.apinb.com/heqiapp/platforms/backend/api/internal/models"
)
const serviceKey = "Platform"
func main() {
if len(os.Args) < 2 {
fmt.Println("usage: platform-cli <version|migrate>")
return
}
switch os.Args[1] {
case "version":
fmt.Println("platform-cli 0.1.0")
case "migrate":
config.New(serviceKey)
impl.NewImpl()
fmt.Println("platform database auto migrate completed")
default:
fmt.Fprintf(os.Stderr, "unknown command: %s\n", os.Args[1])
os.Exit(1)
}
}