|
@@ -0,0 +1,238 @@
|
|
|
|
+import {
|
|
|
|
+ bluebookAiAgent,
|
|
|
|
+} from '@/xiaolanbenlib/api/index'
|
|
|
|
+import request from '@/xiaolanbenlib/module/axios.js'
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 编辑差评记录的答案消息--编辑后则自动标识为已处理
|
|
|
|
+export const editVisitorDislikeAnswer = (data: {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "answer": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "links": string[],
|
|
|
|
+ "msgId": string,
|
|
|
|
+ "pics": string[],
|
|
|
|
+ "question": string
|
|
|
|
+}) => {
|
|
|
|
+ return request.put(`${bluebookAiAgent}api/v1/my/visitor/dislike/message/answer`, data)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 删除指定的差评待处理记录
|
|
|
|
+export const deleteVisitorDislikeAnswer = (data: {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "msgId": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.delete(`${bluebookAiAgent}api/v1/my/visitor/dislike/message`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 获取未处理的差评记录列表
|
|
|
|
+export type TVisitorDislikeMessagesResponse = {
|
|
|
|
+ "data": [
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "content": string,
|
|
|
|
+ "dislikeReason": string,
|
|
|
|
+ "isDislike": false,
|
|
|
|
+ "isLike": false,
|
|
|
|
+ "isStreaming": false,
|
|
|
|
+ "msgId": number,
|
|
|
|
+ "msgTime": "2025-05-15T09:20:38.928Z",
|
|
|
|
+ "msgUk": string,
|
|
|
|
+ "originalAgentId": string,
|
|
|
|
+ "role": string
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ ],
|
|
|
|
+ "nextId": string,
|
|
|
|
+ "totalCount": number
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+export const getVisitorDislikeMessages = (data: {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "beginId": string,
|
|
|
|
+ "pageSize": number,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorDislikeMessagesResponse>(`${bluebookAiAgent}api/v1/my/visitor/dislike/message`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 访客访问详情--访客信息
|
|
|
|
+export type TVisotorInfoResponse = {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "agentStatus": string,
|
|
|
|
+ "avatarUrl": string,
|
|
|
|
+ "chatRound": number,
|
|
|
|
+ "dislikeCnt": number,
|
|
|
|
+ "isEnt": false,
|
|
|
|
+ "lastChatTime": "2025-05-21T07:09:45.814Z",
|
|
|
|
+ "myAgentId": string,
|
|
|
|
+ "myAgentName": string,
|
|
|
|
+ "name": string,
|
|
|
|
+ "position": string,
|
|
|
|
+ "visitTimes": number,
|
|
|
|
+ "visitorId": number
|
|
|
|
+}
|
|
|
|
+export const getVisitorInfo = (data: {
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "beginId": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisotorInfoResponse>(`${bluebookAiAgent}api/v1/my/visitor/info`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 获取好评记录列表--包含已读未读
|
|
|
|
+export type TVisitorLikeMessagesResponse = {
|
|
|
|
+ "data": [
|
|
|
|
+ {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "content": string,
|
|
|
|
+ "dislikeReason": string,
|
|
|
|
+ "isDislike": false,
|
|
|
|
+ "isLike": false,
|
|
|
|
+ "isStreaming": false,
|
|
|
|
+ "msgId": number,
|
|
|
|
+ "msgTime": "2025-05-21T07:09:45.820Z",
|
|
|
|
+ "msgUk": string,
|
|
|
|
+ "originalAgentId": string,
|
|
|
|
+ "role": string
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ "nextId": string,
|
|
|
|
+ "totalCount": number
|
|
|
|
+}
|
|
|
|
+export const getVisitorLikeMessages = (data: {
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "beginId": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorLikeMessagesResponse>(`${bluebookAiAgent}api/v1/my/visitor/like/messages`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 访客数据列表--列表会按我的智能体明细展示
|
|
|
|
+export type TVisitorListResponse = {
|
|
|
|
+ "data": [
|
|
|
|
+ {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "agentStatus": string,
|
|
|
|
+ "avatarUrl": string,
|
|
|
|
+ "chatRound": number,
|
|
|
|
+ "dislikeCnt": number,
|
|
|
|
+ "isEnt": false,
|
|
|
|
+ "lastChatTime": "2025-05-21T07:09:45.823Z",
|
|
|
|
+ "myAgentId": string,
|
|
|
|
+ "myAgentName": string,
|
|
|
|
+ "name": string,
|
|
|
|
+ "position": string,
|
|
|
|
+ "visitTimes": number,
|
|
|
|
+ "visitorId": number
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ "nextId": string,
|
|
|
|
+ "totalCount": number
|
|
|
|
+}
|
|
|
|
+export const getVisitorList = (data: {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "startId": string,
|
|
|
|
+ "pageSize": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorListResponse>(`${bluebookAiAgent}api/v1/my/visitor/list`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 访客访问详情--访客聊天记录
|
|
|
|
+export type TVisitorMessagesResponse = {
|
|
|
|
+ "data": [
|
|
|
|
+ {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "content": string,
|
|
|
|
+ "dislikeReason": string,
|
|
|
|
+ "isDislike": false,
|
|
|
|
+ "isLike": false,
|
|
|
|
+ "isStreaming": false,
|
|
|
|
+ "msgId": number,
|
|
|
|
+ "msgTime": "2025-05-21T07:09:45.826Z",
|
|
|
|
+ "msgUk": string,
|
|
|
|
+ "originalAgentId": string,
|
|
|
|
+ "role": string
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ "nextId": string,
|
|
|
|
+ "totalCount": number
|
|
|
|
+}
|
|
|
|
+export const getVisitorMessages = (data: {
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "startId": string,
|
|
|
|
+ "beginId": string,
|
|
|
|
+ "pageSize": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorListResponse>(`${bluebookAiAgent}api/v1/my/visitor/messages`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 访客聊天记录 获取指定 msgId 前后各N条;用于查看好差评记录的访客详情
|
|
|
|
+export type TVisitorMessagesByMsgIdResponse = [
|
|
|
|
+ {
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "content": string,
|
|
|
|
+ "dislikeReason": string,
|
|
|
|
+ "isDislike": false,
|
|
|
|
+ "isLike": false,
|
|
|
|
+ "isStreaming": false,
|
|
|
|
+ "msgId": number,
|
|
|
|
+ "msgTime": "2025-05-21T07:09:45.828Z",
|
|
|
|
+ "msgUk": string,
|
|
|
|
+ "originalAgentId": string,
|
|
|
|
+ "role": string
|
|
|
|
+ }
|
|
|
|
+]
|
|
|
|
+export const getVisitorMessagesByMsgId = (data: {
|
|
|
|
+ "visitorId": string,
|
|
|
|
+ "agentId": string,
|
|
|
|
+ "msgId": string,
|
|
|
|
+ "size": number,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorMessagesByMsgIdResponse>(`${bluebookAiAgent}api/v1/my/visitor/messages/byMsgId`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 访问数据汇总
|
|
|
|
+export type TVisitorSummaryResponse = {
|
|
|
|
+ sumChatUv?: number// 总聊天UV ,
|
|
|
|
+ sumPv?: number// 总PV ,
|
|
|
|
+ sumUv?: number// 总UV ,
|
|
|
|
+ todayChatUv?: number// 今日聊天UV ,
|
|
|
|
+ todayPv?: number// 今日PV ,
|
|
|
|
+ todayUv?: number// 今日UV ,
|
|
|
|
+ unprocessedDislikeCnt?: number// 未处理差评记录数 ,
|
|
|
|
+ unreadLikeCnt?: number// 未查看点赞记录数
|
|
|
|
+}
|
|
|
|
+export const getVisitorSummary = (data: {
|
|
|
|
+ "agentId": string,
|
|
|
|
+}) => {
|
|
|
|
+ return request.get<TVisitorSummaryResponse>(`${bluebookAiAgent}api/v1/my/visitor/summary`, {params: data})
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|