package com.purui.prims.headless.server.service;

import com.purui.prims.auth.api.authentication.pojo.User;
import com.purui.prims.headless.api.pojo.SemanticParseInfo;
import com.purui.prims.headless.api.pojo.SqlEvaluation;
import com.purui.prims.headless.api.pojo.request.ExecuteQueryReq;
import com.purui.prims.headless.api.pojo.request.QueryMapReq;
import com.purui.prims.headless.api.pojo.request.QueryReq;
import com.purui.prims.headless.api.pojo.request.QuerySqlReq;
import com.purui.prims.headless.api.pojo.response.MapInfoResp;
import com.purui.prims.headless.api.pojo.response.MapResp;
import com.purui.prims.headless.api.pojo.response.ParseResp;
import com.purui.prims.headless.api.pojo.response.QueryResult;

/***
 * SemanticLayerService for query and search
 */
public interface ChatLayerService {

    MapResp performMapping(QueryReq queryReq);

    MapInfoResp map(QueryMapReq queryMapReq);

    ParseResp performParsing(QueryReq queryReq);

    QueryResult performExecution(ExecuteQueryReq queryReq) throws Exception;

    SemanticParseInfo queryContext(Integer chatId);

    void correct(QuerySqlReq querySqlReq, User user);

    SqlEvaluation validate(QuerySqlReq querySqlReq, User user);
}

