chore: add service version

This commit is contained in:
boojack
2022-05-17 21:21:13 +08:00
parent 5d0e9724db
commit 74ab42069f
13 changed files with 66 additions and 55 deletions

View File

@ -11,10 +11,6 @@ import (
type Main struct {
profile *common.Profile
server *server.Server
db *store.DB
}
func (m *Main) Run() error {
@ -23,15 +19,11 @@ func (m *Main) Run() error {
return fmt.Errorf("cannot open db: %w", err)
}
m.db = db
s := server.NewServer(m.profile)
storeInstance := store.New(db)
s.Store = storeInstance
m.server = s
if err := s.Run(); err != nil {
return err
}
@ -42,7 +34,7 @@ func (m *Main) Run() error {
func Execute() {
profile := common.GetProfile()
m := Main{
profile: &profile,
profile: profile,
}
err := m.Run()