package org.jeecg.modules.activiti.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.activiti.engine.repository.Model;
import org.jeecg.modules.activiti.model.entity.ReModelEntity;
import org.jeecg.common.api.vo.Result;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * 模型接口
 *
 * @author yao
 * @date 2019/06/12
 */
public interface ReModelService extends IService<ReModelEntity> {

    /**
     * 分页查询
     *
     * @param  req 查询参数
     * @return Page
     */
    IPage queryPage(Integer pageNo, Integer pageSize, HttpServletRequest req);

    /**
     * 新增
     *
     * @param actReModel
     * @return 新增结果
     * @throws UnsupportedEncodingException
     */
    Model add(ReModelEntity actReModel) throws UnsupportedEncodingException;

    /**
     * 部署工作流模型
     *
     * @param id 模型标识
     * @return 部署信息
     */
    Result deploy(String id,HttpServletRequest request);

    /**
     * 导出XML
     *
     * @param id       流程模型标识
     * @param response 响应
     */
    void export(String id, HttpServletResponse response);

    /**
     * 根据主键删除
     *
     * @param id id
     */
    void delete(String id);

    /**
     * 根据主键批量删除
     *
     * @param ids ids
     */
    void deleteBatch(String[] ids);
}
