22 lines
353 B
Go
22 lines
353 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
lawyermodel "wx_service/internal/lawyer/model"
|
|
)
|
|
|
|
type Service struct {
|
|
db *gorm.DB
|
|
}
|
|
|
|
func NewService(db *gorm.DB) *Service {
|
|
return &Service{db: db}
|
|
}
|
|
|
|
func (s *Service) CreateLawyer(ctx context.Context, lawyer *lawyermodel.Lawyer) error {
|
|
return s.db.WithContext(ctx).Create(lawyer).Error
|
|
}
|