feat: tag routes

This commit is contained in:
ericprd
2025-03-01 20:00:54 +08:00
parent 613379c8a5
commit acd80480dd
19 changed files with 336 additions and 8 deletions
+2
View File
@@ -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()
}
+7
View File
@@ -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)
}
+7
View File
@@ -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()
}
+23
View File
@@ -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,
}
}