接口优化
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.emotion.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.emotion.common.BasePageRequest;
|
||||
import com.emotion.common.PageResult;
|
||||
import com.emotion.dto.request.coze.CozeApiCallPageRequest;
|
||||
import com.emotion.dto.request.coze.CozeApiCallCreateRequest;
|
||||
import com.emotion.dto.request.coze.CozeApiCallUpdateRequest;
|
||||
import com.emotion.dto.response.coze.CozeApiCallResponse;
|
||||
import com.emotion.entity.CozeApiCall;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -20,37 +23,27 @@ public interface CozeApiCallService extends IService<CozeApiCall> {
|
||||
/**
|
||||
* 分页查询API调用记录
|
||||
*/
|
||||
IPage<CozeApiCall> getPage(BasePageRequest request);
|
||||
PageResult<CozeApiCallResponse> getPage(CozeApiCallPageRequest request);
|
||||
|
||||
/**
|
||||
* 根据会话ID分页查询API调用记录
|
||||
* 根据ID获取API调用记录
|
||||
*/
|
||||
IPage<CozeApiCall> getPageByConversationId(BasePageRequest request, String conversationId);
|
||||
|
||||
CozeApiCallResponse getById(String id);
|
||||
|
||||
/**
|
||||
* 根据用户ID分页查询API调用记录
|
||||
* 创建API调用记录
|
||||
*/
|
||||
IPage<CozeApiCall> getPageByUserId(BasePageRequest request, String userId);
|
||||
|
||||
CozeApiCallResponse create(CozeApiCallCreateRequest request);
|
||||
|
||||
/**
|
||||
* 根据Bot ID查询API调用记录
|
||||
* 更新API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getByBotId(String botId);
|
||||
|
||||
CozeApiCallResponse update(CozeApiCallUpdateRequest request);
|
||||
|
||||
/**
|
||||
* 根据状态查询API调用记录
|
||||
* 删除API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getByStatus(String status);
|
||||
|
||||
/**
|
||||
* 根据请求类型查询API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getByRequestType(String requestType);
|
||||
|
||||
/**
|
||||
* 根据时间范围查询API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getByTimeRange(LocalDateTime startTime, LocalDateTime endTime);
|
||||
boolean delete(String id);
|
||||
|
||||
/**
|
||||
* 统计用户的API调用次数
|
||||
@@ -76,42 +69,4 @@ public interface CozeApiCallService extends IService<CozeApiCall> {
|
||||
* 统计用户的API调用费用
|
||||
*/
|
||||
BigDecimal sumCostByUserId(String userId);
|
||||
|
||||
/**
|
||||
* 查询失败的API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getFailedCalls();
|
||||
|
||||
/**
|
||||
* 查询超时的API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getTimeoutCalls();
|
||||
|
||||
/**
|
||||
* 根据追踪ID查询API调用记录
|
||||
*/
|
||||
CozeApiCall getByTraceId(String traceId);
|
||||
|
||||
/**
|
||||
* 根据会话ID和请求类型查询API调用记录
|
||||
*/
|
||||
List<CozeApiCall> getByConversationIdAndRequestType(String conversationId, String requestType);
|
||||
|
||||
/**
|
||||
* 更新API调用状态
|
||||
*/
|
||||
boolean updateStatus(String id, String status, String finalStatus, LocalDateTime endTime);
|
||||
|
||||
/**
|
||||
* 更新API调用结果
|
||||
*/
|
||||
boolean updateResult(String id, Integer responseStatus, String responseBody, String aiReply,
|
||||
Integer totalTokens, BigDecimal cost, String status, String finalStatus,
|
||||
LocalDateTime endTime);
|
||||
|
||||
/**
|
||||
* 创建API调用记录
|
||||
*/
|
||||
CozeApiCall createApiCall(String conversationId, String messageId, String userId,
|
||||
String requestType, String requestUrl, String requestBody);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user