internal/user/usecase.go   A
last analyzed

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 10
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user.NewUseCase 0 2 1
A user.UseCase.GetName 0 4 1
1
package user
2
3
import (
4
	"github.com/memnix/memnix-rest/pkg/utils"
5
)
6
7
type UseCase struct {
8
	IRepository
9
}
10
11
func (u UseCase) GetName(id string) string {
12
	uintID, _ := utils.ConvertStrToUInt(id)
13
14
	return u.IRepository.GetName(uintID)
15
}
16
17
func NewUseCase(repo IRepository) IUseCase {
18
	return &UseCase{IRepository: repo}
19
}
20