chores: refactor struct and structure project

This commit is contained in:
ericprd
2025-03-05 21:21:44 +08:00
parent 13a8481f22
commit 567e0e32ca
103 changed files with 1125 additions and 731 deletions
@@ -2,6 +2,6 @@ package subscribeplansvc
import subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
func (sb *SubsPlanSvc) CreatePlan(spec subscribeplandomain.SubscribePlanReq) error {
func (sb *impl) CreatePlan(spec subscribeplandomain.SubscribePlanReq) error {
return sb.subsAccs.Create(spec)
}
@@ -4,6 +4,6 @@ import (
subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
)
func (s *SubsPlanSvc) GetAllPlan() ([]subscribeplandomain.SubscribePlan, error) {
func (s *impl) GetAllPlan() ([]subscribeplandomain.SubscribePlan, error) {
return s.subsAccs.GetAll()
}
+4 -4
View File
@@ -5,17 +5,17 @@ import (
subscribeplandomain "legalgo-BE-go/internal/domain/subscribe_plan"
)
type SubsPlanSvc struct {
type impl struct {
subsAccs subscribeplanrepository.SubsPlanIntf
}
type SubsPlanIntf interface {
type SubscribePlan interface {
CreatePlan(subscribeplandomain.SubscribePlanReq) error
GetAllPlan() ([]subscribeplandomain.SubscribePlan, error)
}
func New(
subsAccs subscribeplanrepository.SubsPlanIntf,
) SubsPlanIntf {
return &SubsPlanSvc{subsAccs}
) SubscribePlan {
return &impl{subsAccs}
}