Cron_Admin/app/repository/cron_report_channel.go

23 lines
481 B
Go

package repository
import (
"cron_admin/app/models/cronreportchannelmodel"
"xorm.io/xorm"
)
type ReportChannel struct {
ICommonRepo[cronreportchannelmodel.CronReportChannel]
}
func NewReportChannelRepo() *ReportChannel {
return &ReportChannel{
ICommonRepo: NewCommonRepo[cronreportchannelmodel.CronReportChannel](),
}
}
func (c *ReportChannel) WithByID(id uint) DBOption {
return func(g *xorm.Session) *xorm.Session {
return g.Where("report_channel_id = ?", id)
}
}