package com.haha.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.haha.common.vo.Result;
import com.haha.entity.DictData;
import com.haha.entity.DictType;

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

/**
 * 字典服务接口
 */
public interface DictService extends IService<DictType> {

    Result<Map<String, Object>> getDictTypeList(Map<String, Object> params);

    Result<DictType> getDictTypeById(Long id);

    Result<DictType> getDictTypeByCode(String dictCode);

    Result<Void> addDictType(DictType dictType);

    Result<Void> updateDictType(DictType dictType);

    Result<Void> deleteDictType(Long id);

    Result<Void> batchDeleteDictType(List<Long> ids);

    Result<List<DictData>> getDictDataList(String dictCode);

    Result<Map<String, Object>> getDictDataPage(Map<String, Object> params);

    Result<DictData> getDictDataById(Long id);

    Result<Void> addDictData(DictData dictData);

    Result<Void> updateDictData(DictData dictData);

    Result<Void> deleteDictData(Long id);

    Result<Void> batchDeleteDictData(List<Long> ids);

    Map<String, List<DictData>> getAllDictData();

    List<DictData> getDictDataByCode(String dictCode);

    void refreshCache();

    String getDictLabel(String dictCode, String itemValue);

    String getDictValue(String dictCode, String itemLabel);

    Result<Void> exportDictData(String dictCode);

    Result<Void> importDictData(List<DictData> dataList);
}
