package workflow

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

type ProcessService struct{}

func (ps *ProcessService) QueryAllProcess() ([]dao.Process, error) {
	return dao.QueryAllProcess()
}

func (ps *ProcessService) QueryProcessList(info request.PageInfo) (list interface{}, total int64, err error) {
	limit := info.PageSize
	offset := info.PageSize * (info.Page - 1)
	processes, total, err := dao.QueryProcessList(limit, offset)
	return processes, total, err
}

func (ps *ProcessService) CreateProcess(process dao.Process) error {
	return process.CreateProcess()
}

func (ps *ProcessService) UpdateProcess(process dao.Process) error {
	return process.UpdateProcess()
}

func (ps *ProcessService) DeleteProcess(process dao.Process) error {
	return process.DeleteProcess()
}
