package book

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	commonReq "github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
	"gorm.io/gorm"
)

func paginate(info commonReq.PageInfo) func(db *gorm.DB) *gorm.DB { return (&info).Paginate() }

func deleteByIDs[T any](ids []int) error {
	return global.GVA_DB.Where("id in ?", ids).Delete(new(T)).Error
}
