feat: tag routes
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
serviceauth "legalgo-BE-go/internal/services/auth"
|
||||
subscribesvc "legalgo-BE-go/internal/services/subscribe"
|
||||
subscribeplansvc "legalgo-BE-go/internal/services/subscribe_plan"
|
||||
tagsvc "legalgo-BE-go/internal/services/tag"
|
||||
|
||||
"go.uber.org/fx"
|
||||
)
|
||||
@@ -13,5 +14,6 @@ var Module = fx.Module("services",
|
||||
serviceauth.New,
|
||||
subscribeplansvc.New,
|
||||
subscribesvc.New,
|
||||
tagsvc.New,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -5,10 +5,5 @@ import (
|
||||
)
|
||||
|
||||
func (s *SubsPlanSvc) GetAllPlan() ([]subscribeplandomain.SubscribePlan, error) {
|
||||
subsPlan, err := s.subsAccs.GetAll()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return subsPlan, nil
|
||||
return s.subsAccs.GetAll()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package tagsvc
|
||||
|
||||
import tagdomain "legalgo-BE-go/internal/domain/tag"
|
||||
|
||||
func (i *impl) Create(spec tagdomain.TagReq) error {
|
||||
return i.TagRepo.Create(spec)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package tagsvc
|
||||
|
||||
import tagdomain "legalgo-BE-go/internal/domain/tag"
|
||||
|
||||
func (i *impl) GetAll() ([]tagdomain.Tag, error) {
|
||||
return i.TagRepo.GetAll()
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package tagsvc
|
||||
|
||||
import (
|
||||
tagrepository "legalgo-BE-go/internal/accessor/tag"
|
||||
tagdomain "legalgo-BE-go/internal/domain/tag"
|
||||
)
|
||||
|
||||
type impl struct {
|
||||
TagRepo tagrepository.TagAccessor
|
||||
}
|
||||
|
||||
type TagIntf interface {
|
||||
Create(tagdomain.TagReq) error
|
||||
GetAll() ([]tagdomain.Tag, error)
|
||||
}
|
||||
|
||||
func New(
|
||||
tagRepo tagrepository.TagAccessor,
|
||||
) TagIntf {
|
||||
return &impl{
|
||||
TagRepo: tagRepo,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user