package yb_poster_resource

import (
	"hongze/hongze_yb/global"
)

func (item *YbPosterResource) Create() (err error) {
	err = global.DEFAULT_MYSQL.Create(item).Error
	return
}

// GetPosterByCondition 获取海报
func GetPosterByCondition(path, resourceType, version string) (item *YbPosterResource, err error) {
	err = global.DEFAULT_MYSQL.Model(YbPosterResource{}).
		Where("path = ? AND type = ? AND version = ?", path, resourceType, version).
		First(&item).Error
	return
}
