package com.cm.common.plugin.service.tree;

import com.alibaba.fastjson.JSONArray;
import com.cm.common.exception.SearchException;

import java.util.Map;

/**
 * @ClassName: ITreeService
 * @Description: 树结构
 * @Author: WangGeng
 * @Date: 2019-07-02 17:08
 * @Version: 1.0
 **/
public interface ITreeService {

    /**
     * 复选
     */
    String CHECK_BOX = "checkbox";
    /**
     * 单选
     */
    String RADIO = "radio";
    /**
     * 选择
     */
    String SELECT = "select";

    /**
     * 默认参数前缀
     */
    String DEFAULT_PARAMS_AND_VALUE = "defaultKeyAndValue_";

    /**
     * 结果通过state:success来判断
     */
    String RESULT_TYPE_STATE_SUCCESS_RESULT_DATA = "stateSuccessResultData";
    /**
     * 结果通过code:success来判断正确
     */
    String RESULT_TYPE_CODE_SUCCESS_RESULT_DATA = "codeSuccessResultData";
    /**
     * 只是获取列表
     */
    String RESULT_TYPE_JUST_LIST = "justList";

    /**
     * 树结构列表（结果列表）
     *
     * @param params
     * @return
     * @throws SearchException
     */
    JSONArray listTreeJustList(Map<String, Object> params) throws SearchException;

    /**
     * 树结构列表（结果需通过code:success判断并解析）
     *
     * @param params
     * @return
     * @throws SearchException
     */
    JSONArray listTreeCodeSuccessResultData(Map<String, Object> params) throws SearchException;

    /**
     * 树结构列表（结果需通过state:success判断并解析）
     *
     * @param params
     * @return
     * @throws SearchException
     */
    JSONArray listTreeStateSuccessResultData(Map<String, Object> params) throws SearchException;
}
