Skip to content

Commit

Permalink
fix: package
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitiwat-owen committed Jan 1, 2024
1 parent ae5d9c5 commit fb92560
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
server:
go run ./src/.
go run ./cmd/.

mock-gen:
mockgen -source ./src/pkg/repository/cache/cache.repository.go -destination ./src/mocks/repository/cache/cache.mock.go
mockgen -source ./src/pkg/repository/auth/auth.repository.go -destination ./src/mocks/repository/auth/auth.mock.go
mockgen -source ./pkg/repository/cache/cache.repository.go -destination ./mocks/repository/cache/cache.mock.go
mockgen -source ./pkg/repository/auth/auth.repository.go -destination ./mocks/repository/auth/auth.mock.go

test:
go vet ./...
go test -v -coverpkg ./src/internal/... -coverprofile coverage.out -covermode count ./src/internal/...
go test -v -coverpkg ./internal/... -coverprofile coverage.out -covermode count ./internal/...
go tool cover -func=coverage.out
go tool cover -html=coverage.out -o coverage.html

Expand Down
2 changes: 1 addition & 1 deletion database/postgresql.connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package database
import (
"fmt"
"github.com/isd-sgcu/johnjud-auth/cfgldr"
"github.com/isd-sgcu/johnjud-auth/src/internal/domain/model"
"github.com/isd-sgcu/johnjud-auth/internal/domain/model"
"gorm.io/driver/postgres"
"gorm.io/gorm"
gormLogger "gorm.io/gorm/logger"
Expand Down
4 changes: 2 additions & 2 deletions internal/service/token/token.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *serviceImpl) Validate(token string) (*tokenDto.UserCredential, error) {
return nil, errors.New("expired token")
}

accessTokenCache := &token.AccessTokenCache{}
accessTokenCache := &tokenDto.AccessTokenCache{}
err = s.accessTokenCache.GetValue(payloads["auth_session_id"].(string), accessTokenCache)
if err != nil {
if err != redis.Nil {
Expand All @@ -95,7 +95,7 @@ func (s *serviceImpl) Validate(token string) (*tokenDto.UserCredential, error) {
return nil, errors.New("invalid token")
}

userCredential := &token.UserCredential{
userCredential := &tokenDto.UserCredential{
UserID: payloads["user_id"].(string),
Role: accessTokenCache.Role,
AuthSessionID: payloads["auth_session_id"].(string),
Expand Down
8 changes: 4 additions & 4 deletions mocks/repository/auth/auth.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions mocks/repository/cache/cache.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mocks/service/token/token.mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (m *TokenServiceMock) CreateCredential(userId string, role constant.Role, a
func (m *TokenServiceMock) Validate(token string) (*tokenDto.UserCredential, error) {
args := m.Called(token)
if args.Get(0) != nil {
return args.Get(0).(*token.UserCredential), nil
return args.Get(0).(*tokenDto.UserCredential), nil
}

return nil, args.Error(1)
Expand Down

0 comments on commit fb92560

Please sign in to comment.