26 lines
518 B
Go
26 lines
518 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// AlarmRepository 定义了对告警模型的数据库操作接口
|
|
type AlarmRepository interface {
|
|
}
|
|
|
|
// gormAlarmRepository 是 AlarmRepository 的 GORM 实现。
|
|
type gormAlarmRepository struct {
|
|
ctx context.Context
|
|
db *gorm.DB
|
|
}
|
|
|
|
// NewGormAlarmRepository 创建一个新的 AlarmRepository GORM 实现实例。
|
|
func NewGormAlarmRepository(ctx context.Context, db *gorm.DB) AlarmRepository {
|
|
return &gormAlarmRepository{
|
|
ctx: ctx,
|
|
db: db,
|
|
}
|
|
}
|