package com.zhongshu.card.server.core.dao.dictionary;

import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.client.type.DictionaryType;
import com.zhongshu.card.server.core.dao.dictionary.extend.DictionaryDaoExtend;
import com.zhongshu.card.server.core.domain.dictionary.Dictionary;

import java.util.List;

public interface DictionaryDao extends MongoDao<Dictionary>, DictionaryDaoExtend {

    Dictionary findTopById(String id);

    Dictionary findTopByProjectIdAndKey(String projectId, String key);

    List<Dictionary> findTopByProjectIdAndKeyIn(String projectId, List<String> keys);

    List<Dictionary> findByProjectId(String projectId);

    void deleteByProjectIdAndKeyNotInAndTypeIn(String projectId, List<String> keys, List<DictionaryType> type);
}
