package models import "time" type AiFilePoints struct { Id uint `json:"id"` FileId string `json:"file_id"` CollectName string `json:"collect_name"` PointsId string `json:"points_id"` CreatedAt time.Time `json:"created_at"` } //增加数据 func (this *AiFilePoints) AddAiFilePoint() error { return DB.Create(this).Error } //根据条件查询分页列表 func FindAiFilePoint(page, pagesize int, query interface{}, args ...interface{}) []AiFilePoints { offset := (page - 1) * pagesize var res []AiFilePoints DB.Table("ai_file_points").Where(query, args...).Order("id desc").Offset(offset).Limit(pagesize).Find(&res) return res } //根据条件删除 func DelFilePoints(query interface{}, args ...interface{}) error { return DB.Where(query, args...).Delete(&AiFilePoints{}).Error }