27 lines
585 B
Go
27 lines
585 B
Go
package impl
|
|
|
|
import (
|
|
"ai_scheduler/internal/data/model"
|
|
"ai_scheduler/tmpl/dataTemp"
|
|
"ai_scheduler/utils"
|
|
"context"
|
|
)
|
|
|
|
type AdviceCustomerImpl struct {
|
|
dataTemp.DataTemp
|
|
}
|
|
|
|
func NewAdviceCustomerImpl(db *utils.Db) *AdviceCustomerImpl {
|
|
return &AdviceCustomerImpl{
|
|
DataTemp: *dataTemp.NewDataTemp(db, new(model.AiAdviceCustomer)),
|
|
}
|
|
}
|
|
|
|
// BatchInsert 批量插入好友记录
|
|
func (a *AdviceCustomerImpl) BatchInsert(ctx context.Context, records []model.AiAdviceCustomer) error {
|
|
if len(records) == 0 {
|
|
return nil
|
|
}
|
|
return a.Db.WithContext(ctx).Create(&records).Error
|
|
}
|