14 lines
292 B
Go
14 lines
292 B
Go
package posts
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
// Service Represents a service with a database connection.
|
|
type Service struct {
|
|
db *gorm.DB
|
|
}
|
|
|
|
// Service New creates a new Service instance, initializing it with a GORM database connection.
|
|
func New(db *gorm.DB) *Service {
|
|
return &Service{db: db}
|
|
}
|