mirror of
https://github.com/langhuihui/monibuca.git
synced 2026-05-07 21:01:13 +08:00
fix: db init table record
This commit is contained in:
+2
-2
@@ -41,9 +41,9 @@ func (p *MP4Plugin) List(ctx context.Context, req *pb.ReqRecordList) (resp *pb.R
|
||||
var totalCount int64 //总条数
|
||||
|
||||
// 查询总记录数
|
||||
countQuery := p.DB.Model(m7s.RecordStream{})
|
||||
countQuery := p.DB.Model(&m7s.RecordStream{})
|
||||
// 查询当前页的数据
|
||||
query := p.DB.Model(m7s.RecordStream{})
|
||||
query := p.DB.Model(&m7s.RecordStream{})
|
||||
if req.PageSize > 0 {
|
||||
query = query.Limit(int(req.PageSize)).Offset(int(offset))
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ func (p *MP4Plugin) RegisterHandler() map[string]http.HandlerFunc {
|
||||
func (p *MP4Plugin) OnInit() (err error) {
|
||||
if p.DB != nil {
|
||||
err = p.DB.AutoMigrate(&Exception{})
|
||||
p.DB.AutoMigrate(&m7s.RecordStream{})
|
||||
var deleteRecordTask DeleteRecordTask
|
||||
deleteRecordTask.DB = p.DB
|
||||
deleteRecordTask.DiskMaxPercent = p.DiskMaxPercent
|
||||
|
||||
Reference in New Issue
Block a user