feat: update framework

This commit is contained in:
Rogee
2024-11-29 15:03:47 +08:00
parent f7d95418a2
commit 391f217bd8
17 changed files with 368 additions and 132 deletions

View File

@@ -4,26 +4,21 @@
package main
import (
"log"
serviceHttp "backend/services"
"backend/common/service/http"
"backend/common/service/migrate"
"git.ipao.vip/rogeecn/atom"
"github.com/spf13/cobra"
log "github.com/sirupsen/logrus"
)
func main() {
providers := serviceHttp.Default()
opts := []atom.Option{
atom.Name("backend"),
atom.RunE(func(cmd *cobra.Command, args []string) error {
return serviceHttp.Serve()
}),
atom.Name("qvyun"),
http.Command(),
migrate.Command(),
}
if err := atom.Serve(providers, opts...); err != nil {
if err := atom.Serve(opts...); err != nil {
log.Fatal(err)
}
}