29 lines
549 B
Go
29 lines
549 B
Go
package impl
|
|
|
|
import (
|
|
"ai_scheduler/internal/data/model"
|
|
"ai_scheduler/tmpl/dataTemp"
|
|
"ai_scheduler/utils"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type BotImpl struct {
|
|
dataTemp.DataTemp
|
|
BaseRepository[model.AiBot]
|
|
}
|
|
|
|
func NewBotImpl(db *utils.Db) *BotImpl {
|
|
return &BotImpl{
|
|
DataTemp: *dataTemp.NewDataTemp(db, new(model.AiBot)),
|
|
BaseRepository: NewBaseModel[model.AiBot](db.Client),
|
|
}
|
|
}
|
|
|
|
// WithSysId 系统id
|
|
func (s *BotImpl) WithSysId(sysId interface{}) CondFunc {
|
|
return func(db *gorm.DB) *gorm.DB {
|
|
return db.Where("sys_id = ?", sysId)
|
|
}
|
|
}
|