package workflow

import (
	"server/dao"
	"server/model/common/request"
)

type ProjectProcessService struct{}

func (pps *ProjectProcessService) QueryProjectApplicantList(info request.SearchProjectProcess) (list interface{}, total int64, err error) {
	limit := info.PageInfo.PageSize
	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
	projectProcesses, total, err := dao.QueryProjectApplicantList(limit, offset, info.UserId)
	return projectProcesses, total, err
}

func (pps *ProjectProcessService) QueryProjectProcessList(info request.SearchProjectProcess) (list interface{}, total int64, err error) {
	limit := info.PageInfo.PageSize
	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
	projectProcesses, total, err := dao.QueryProjectProcessList(limit, offset, info.UserId)
	return projectProcesses, total, err
}

func (pps *ProjectProcessService) CreateProjectProcess(process dao.ProjectProcess) error {
	return process.CreateProjectProcess()
}

func (pps *ProjectProcessService) UpdateProjectProcess(process dao.ProjectProcess) error {
	return process.UpdateProjectProcess()
}

func (pps *ProjectProcessService) DeleteProjectProcess(process dao.ProjectProcess) error {
	return process.DeleteProjectProcess()
}
