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
+1 -1
View File
@@ -1,6 +1,6 @@
package subscribesvc
func (s *SubsSvc) Create(subsPlanId string) (string, error) {
func (s *impl) Create(subsPlanId string) (string, error) {
subsId, err := s.subsRepo.Create(subsPlanId)
if err != nil {
return "", err
+9 -5
View File
@@ -1,15 +1,19 @@
package subscribesvc
import subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
import (
subscriberepository "legalgo-BE-go/internal/accessor/subscribe"
userdomain "legalgo-BE-go/internal/domain/user"
)
type SubsSvc struct {
type impl struct {
subsRepo subscriberepository.SubsIntf
}
type SubsIntf interface {
type Subscribe interface {
Create(string) (string, error)
Update(string, userdomain.UserSubsUpdate) error
}
func New(subsRepo subscriberepository.SubsIntf) SubsIntf {
return &SubsSvc{subsRepo}
func New(subsRepo subscriberepository.SubsIntf) Subscribe {
return &impl{subsRepo}
}
+9
View File
@@ -0,0 +1,9 @@
package subscribesvc
import (
userdomain "legalgo-BE-go/internal/domain/user"
)
func (i *impl) Update(id string, spec userdomain.UserSubsUpdate) error {
return nil
}