/*
 * @description: 安全巡检数据库操作相关
 * @Author: LanJianRong
 * @Date: 2020-11-20
 * @FilePath: \design_quantity\dao\upload_dao.go
 */

package dao

import (
	"github.com/go-xorm/xorm"
	"go.mod/models"
)

// 数据库操作引擎
type UploadDao struct {
	engine *xorm.Engine
}

// 获得一个DAO对象
func NewUploadDao(engine *xorm.Engine) *UploadDao {
	return &UploadDao{
		engine: engine,
	}
}

func (d *UploadDao) Add(upload *models.CmUpload) (int64, error) {
	id, err := d.engine.Insert(upload)
	return id, err
}
