package services

import (
	"go.mod/dao"
	"go.mod/datasource"
	"go.mod/models"
)

type UploadService interface {
	Get(id int) (*models.CmUpload, error)
}

//返回service操作类
type uploadService struct {
	dao *dao.UploadDao
}

//创建项目用户service
func NewUploadService() UploadService {
	return &uploadService{
		dao: dao.NewUploadDao(datasource.InstanceDbMaster()),
	}
}

func (s *uploadService) Get(id int) (*models.CmUpload, error) {
	file, err := s.dao.GetFile(id)
	return file, err
}
