package com.ycwl.basic.facebody.adapter;

import com.ycwl.basic.facebody.entity.AddFaceResp;
import com.ycwl.basic.facebody.entity.SearchFaceResp;

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

public interface IFaceBodyAdapter {
    boolean loadConfig(Map<String, String> _config);

    default boolean assureFaceDb(String dbName) {
        List<String> faceDbs = listFaceDb();
        return faceDbs.contains(dbName) || addFaceDb(dbName);
    }

    boolean addFaceDb(String dbName);
    boolean deleteFaceDb(String dbName);

    List<String> listFaceDb();

    AddFaceResp addFace(String dbName, String entityId, String faceUrl, String extData);

    boolean deleteFace(String dbName, String entityId);

    List<String> listFace(String dbName, String prefix, Integer offset, Integer size);

    SearchFaceResp searchFace(String dbName, String faceUrl);
}
