Skip to content

Commit

Permalink
fixed hrm:main
Browse files Browse the repository at this point in the history
  • Loading branch information
XIAOKAOBO committed Oct 16, 2023
1 parent 64bea80 commit 2dc8db5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 8 additions & 8 deletions hrm/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"flag"
"fmt"

"github.com/CAS735-F23/macrun-teamvs_/player/internal/adapters/handler"
"github.com/CAS735-F23/macrun-teamvs_/player/internal/adapters/repository"
"github.com/CAS735-F23/macrun-teamvs_/player/internal/core/services"
"github.com/CAS735-F23/macrun-teamvs_/hrm/adapters/repository"
"github.com/CAS735-F23/macrun-teamvs_/hrm/internal/adapters/handler"
"github.com/CAS735-F23/macrun-teamvs_/hrm/internal/core/services"
"github.com/gin-gonic/gin"
)

var (
repo = flag.String("db", "postgres", "Database for storing messages")
// redisHost = "localhost:6379"
// httpHandler *handler.HTTPHandler
svc *services.PlayerService
svc *services.HRMService
)

func main() {
Expand All @@ -28,7 +28,7 @@ func main() {
// svc = services.NewMessengerService(store)
default:
store := repository.NewMemoryRepository()
svc = services.NewPlayerService(store)
svc = services.NewHRMService(store)
}

InitRoutes()
Expand All @@ -38,9 +38,9 @@ func main() {
func InitRoutes() {
router := gin.Default()
handler := handler.NewHTTPHandler(*svc)
router.GET("/players", handler.ListPlayers)
router.POST("/player", handler.CreatePlayer)
router.GET("/players/:id", handler.GetPlayer)
router.GET("/hrmss", handler.ListHRM)
router.POST("/hrm", handler.CreateHRM)
router.GET("/hrmss/:id", handler.GetHRM)
// TODO: Implement when needed
// router.PUT("/player", handler.UpdatePlayer)
router.Run(":8000")
Expand Down
3 changes: 1 addition & 2 deletions hrm/internal/core/domain/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package domain
import (
"errors"
"time"

"github.com/google/uuid"
)

Expand Down Expand Up @@ -48,7 +47,7 @@ func (hrm *HRM) readHRate() {

func NewHRM(hrm HRM) (HRM, error) {

// Create a customer object and initialize all the values to avoid nil pointer exceptions
// Create a hrm object and initialize all the values to avoid nil pointer exceptions
hrmN := HRM{
HRMId: hrm.HRMId,
CreatedAt: time.Now(),
Expand Down

0 comments on commit 2dc8db5

Please sign in to comment.