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

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.plugin.pojo.dtos.dataarea.DataAreaDTO;
import com.cm.common.plugin.pojo.vos.dataarea.DataAreaVO;
import com.cm.common.pojo.ListPage;
import com.cm.common.pojo.dtos.ZTreeDTO;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultList;

import java.util.List;
import java.util.Map;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IAreaAreaService
 * @Description: 地区字典
 * @Author: WangGeng
 * @Date: 2019/11/18 14:09
 * @Version: 1.0
 **/
public interface IDataAreaService {
    /**
     * 地区字典新增
     *
     * @param dataAreaVO
     * @return
     * @throws Exception
     */
    SuccessResult saveArea(DataAreaVO dataAreaVO) throws Exception;

    /**
     * 地区字典新增
     *
     * @param token
     * @param dataAreaVO
     * @return
     * @throws Exception
     */
    SuccessResult saveArea(String token, DataAreaVO dataAreaVO) throws Exception;

    /**
     * 地区字典新增
     *
     * @param dataAreaVO
     * @return 新增ID
     * @throws Exception
     */
    String saveAreaReturnId(DataAreaVO dataAreaVO) throws Exception;

    /**
     * 地区字典新增
     *
     * @param token
     * @param dataAreaVO
     * @return 新增ID
     * @throws Exception
     */
    String saveAreaReturnId(String token, DataAreaVO dataAreaVO) throws Exception;

    /**
     * 地区字典删除
     *
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeArea(String ids) throws RemoveException;

    /**
     * 地区字典删除
     *
     * @param token
     * @param ids
     * @return
     * @throws RemoveException
     */
    SuccessResult removeArea(String token, String ids) throws RemoveException;

    /**
     * 地区字典修改
     *
     * @param areaAreaId
     * @param dataAreaVO
     * @return
     * @throws Exception
     */
    SuccessResult updateArea(String areaAreaId, DataAreaVO dataAreaVO) throws Exception;

    /**
     * 地区字典修改
     *
     * @param token
     * @param areaAreaId
     * @param dataAreaVO
     * @return
     * @throws Exception
     */
    SuccessResult updateArea(String token, String areaAreaId, DataAreaVO dataAreaVO) throws Exception;

    /**
     * 通过ID获取地区字典
     *
     * @param areaId
     * @return
     * @throws SearchException
     */
    DataAreaDTO getAreaById(String areaId) throws SearchException;

    /**
     * 通过上级ID获取地区字典列表
     *
     * @param areaParentId
     * @return
     * @throws SearchException
     */
    List<DataAreaDTO> listAreaByParentId(String areaParentId) throws SearchException;

    /**
     * 通过上级ID获取地区字典全部列表
     *
     * @param areaParentId
     * @return
     * @throws SearchException
     */
    List<DataAreaDTO> listAreaAllByParentId(String areaParentId) throws SearchException;

    /**
     * 分页获取地区字典列表
     *
     * @param page
     * @return
     * @throws SearchException
     */
    SuccessResultList<List<DataAreaDTO>> listPageArea(ListPage page) throws SearchException;

    /**
     * zTree列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ZTreeDTO> listZTreeArea(Map<String, Object> params) throws SearchException;

    /**
     * 地区字典列表（通过地区字典编码）
     *
     * @param areaCode
     * @return
     * @throws SearchException
     */
    List<DataAreaDTO> listAreaByAreaCode(String areaCode) throws SearchException;
}
