func (s *storage) Create(model *booking_model.Model) (*booking_model.Model, error) { model.Created = time.Now() model.Updated = time.Now() db, err := s.database.DB() if err != nil { return nil, err } query := db.Create(model) return model, query.Error }
func (s *modelService) Create(d *booking_model.Model) (*booking_model.Model, error) { logger.Debug("create") token, err := s.generateToken() if err != nil { return nil, err } d.Token = token return s.storage.Create(d) }