2025-02-24 16:48:20 +08:00
|
|
|
package subscriberepository
|
|
|
|
|
|
2025-03-08 22:46:05 +08:00
|
|
|
import (
|
|
|
|
|
"legalgo-BE-go/database"
|
|
|
|
|
subscribedomain "legalgo-BE-go/internal/domain/subscribe"
|
|
|
|
|
)
|
2025-02-24 16:48:20 +08:00
|
|
|
|
2025-03-08 22:46:05 +08:00
|
|
|
type accessor struct {
|
|
|
|
|
db *database.DB
|
2025-02-24 16:48:20 +08:00
|
|
|
}
|
|
|
|
|
|
2025-03-08 22:46:05 +08:00
|
|
|
type Subscribe interface {
|
2025-02-24 16:48:20 +08:00
|
|
|
Create(string) (string, error)
|
2025-03-08 22:46:05 +08:00
|
|
|
GetByID(string) (subscribedomain.Subscribe, error)
|
|
|
|
|
Update(subscribedomain.Subscribe) error
|
2025-02-24 16:48:20 +08:00
|
|
|
}
|
|
|
|
|
|
2025-03-08 22:46:05 +08:00
|
|
|
func New(db *database.DB) Subscribe {
|
|
|
|
|
return &accessor{db}
|
2025-02-24 16:48:20 +08:00
|
|
|
}
|