chore: restructure project and add i18n support
- Reorganize project structure with new electron and shared directories - Add comprehensive i18n support with Chinese, English, and Japanese locales - Update build configurations and TypeScript paths for new structure - Add various UI components including chat interface and task management - Include Windows release binaries and localization files - Update dependencies and fix import paths throughout the codebase
This commit is contained in:
64
src/api/ConversationApi.ts
Normal file
64
src/api/ConversationApi.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import { getRequest, postRequest, ResponseModel } from '@utils/request'
|
||||
|
||||
/** 创建会话 创建会话创建会话 GET /agent/assistant/createConversation */
|
||||
export interface CreateConversationResponse {
|
||||
conversationId: string
|
||||
}
|
||||
|
||||
export const createConversation = async () => {
|
||||
const res: ResponseModel = await getRequest('/agent/assistant/createConversation')
|
||||
return res.data as CreateConversationResponse
|
||||
}
|
||||
|
||||
/** 获取会话列表 获取会话列表获取会话列表 POST /agent/assistant/conversationList */
|
||||
export interface ConversationListRequest {
|
||||
pageSize: number
|
||||
pageNum: number
|
||||
conversationId?: string
|
||||
}
|
||||
|
||||
export interface ConversationListResponse {
|
||||
records: Array<ConversationListRecords>
|
||||
total: number
|
||||
size: number
|
||||
current: number
|
||||
optimizeCountSql: boolean
|
||||
searchCount: boolean
|
||||
}
|
||||
|
||||
export interface ConversationListRecords {
|
||||
conversationTitle: string
|
||||
conversationId: string
|
||||
}
|
||||
|
||||
export interface ConversationMessageListResponse {
|
||||
records: Array<ConversationMessageListRecords>
|
||||
total: number
|
||||
size: number
|
||||
current: number
|
||||
optimizeCountSql: boolean
|
||||
searchCount: boolean
|
||||
}
|
||||
|
||||
export interface ConversationMessageListRecords {
|
||||
messageId: string
|
||||
conversationId: string
|
||||
messageType: string
|
||||
messageContent: string
|
||||
messageDisplay: string
|
||||
messageSenderId: string
|
||||
messageSenderRole: string
|
||||
messageTime: string
|
||||
}
|
||||
|
||||
export const getConversationList = async (params: ConversationListRequest) => {
|
||||
const res: ResponseModel = await postRequest('/agent/assistant/conversationList', params)
|
||||
return res.data as ConversationListResponse
|
||||
}
|
||||
|
||||
export const conversationMessageList = async (params: ConversationListRequest) => {
|
||||
const res: ResponseModel = await postRequest('/agent/assistant/conversationMessageList', params)
|
||||
return res.data as ConversationMessageListResponse
|
||||
}
|
||||
122
src/api/SessionsApi.ts
Normal file
122
src/api/SessionsApi.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import { getRequest, postRequest, patchRequest, deleteRequest, ResponseModel } from '@utils/request'
|
||||
|
||||
// 创建会话 的请求参数和响应数据结构
|
||||
export interface CreateSessionRequest {
|
||||
title?: string
|
||||
tenant_id_query?: string
|
||||
}
|
||||
|
||||
export interface CreateSessionResponse {
|
||||
session_id: string
|
||||
user_id: string
|
||||
tenant_id: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export const createSession = async (params: CreateSessionRequest) => {
|
||||
const res: ResponseModel = await postRequest('/nianxx/api/sessions', params)
|
||||
return res.data as CreateSessionResponse
|
||||
}
|
||||
|
||||
|
||||
// 获取会话列表 的请求参数和响应数据结构
|
||||
export interface SessionListRequest {
|
||||
tenant_id_query?: string
|
||||
limit?: number
|
||||
offset?: number
|
||||
}
|
||||
|
||||
export interface SessionListResponse {
|
||||
sessions: Array<SessionListRecords>
|
||||
total: number
|
||||
}
|
||||
|
||||
export interface SessionListRecords {
|
||||
session_id: string
|
||||
user_id: string
|
||||
tenant_id: string
|
||||
title: string
|
||||
status: string
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export const getSessionList = async (params: SessionListRequest) => {
|
||||
const res: ResponseModel = await getRequest('/nianxx/api/sessions', params)
|
||||
return res.data as SessionListResponse
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// 获取会话消息历史 的请求参数和响应数据结构
|
||||
export interface SessionMessagesRequest {
|
||||
user_id_query?: string
|
||||
tenant_id_query?: number
|
||||
limit?: number
|
||||
offset?: number
|
||||
session_id: string
|
||||
}
|
||||
|
||||
export interface SessionMessagesResponse {
|
||||
messages: Array<SessionMessageRecords>
|
||||
total: number
|
||||
}
|
||||
|
||||
export interface SessionMessageRecords {
|
||||
id: number
|
||||
session_id: string
|
||||
role: string
|
||||
content: string
|
||||
source: string
|
||||
message_id: string | null
|
||||
created_at: string
|
||||
timestamp?: number
|
||||
}
|
||||
|
||||
// 获取会话消息历史 的函数实现
|
||||
export const getSessionMessages = async (params: SessionMessagesRequest) => {
|
||||
const res: ResponseModel = await getRequest(`/nianxx/api/sessions/${params.session_id}/messages`, {
|
||||
limit: params.limit,
|
||||
offset: params.offset,
|
||||
user_id_query: params.user_id_query,
|
||||
tenant_id_query: params.tenant_id_query,
|
||||
})
|
||||
return res.data as SessionMessagesResponse
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// /api/sessions/{session_id} 的请求参数和响应数据结构
|
||||
export interface UpdateSessionRequest {
|
||||
session_id: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface UpdateSessionResponse {
|
||||
success: boolean
|
||||
}
|
||||
|
||||
// 更新会话信息 的函数实现
|
||||
export const updateSession = async (params: UpdateSessionRequest) => {
|
||||
const res: ResponseModel = await postRequest(`/nianxx/api/sessions/${params.session_id}/rename`, {
|
||||
title: params.title,
|
||||
})
|
||||
return res.data as UpdateSessionResponse
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// /api/sessions/{session_id} 的请求参数和响应数据结构
|
||||
export interface DeleteSessionRequest {
|
||||
session_id: string
|
||||
}
|
||||
|
||||
export interface DeleteSessionResponse {
|
||||
success: boolean
|
||||
}
|
||||
|
||||
// 删除会话 的函数实现
|
||||
export const deleteSession = async (params: DeleteSessionRequest) => {
|
||||
const res: ResponseModel = await postRequest(`/nianxx/api/sessions/${params.session_id}/delete`, {})
|
||||
return res.data as DeleteSessionResponse
|
||||
}
|
||||
23
src/api/code.ts
Normal file
23
src/api/code.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@utils/request';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 创建图形验证码 GET /auth/code/image */
|
||||
export function authCodeImageUsingGet({
|
||||
params,
|
||||
options,
|
||||
}: {
|
||||
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||
params: API.AuthCodeImageUsingGetParams;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.AuthCodeImageUsingGetResponse>('/auth/code/image', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
59
src/api/configChannel.ts
Normal file
59
src/api/configChannel.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@utils/request';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 绑定渠道账号 绑定渠道账号绑定渠道账号 POST /hotelStaff/configChannel/binding */
|
||||
export function hotelStaffConfigChannelBindingUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.PcConfigChannel;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RBoolean>('/hotelStaff/configChannel/binding', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建账号渠道 创建账号渠道创建账号渠道 POST /hotelStaff/configChannel/createPcConfigChannel */
|
||||
export function hotelStaffConfigChannelCreatePcConfigChannelUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.PcConfig;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RBoolean>(
|
||||
'/hotelStaff/configChannel/createPcConfigChannel',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询配置与渠道关系列表 查询配置与渠道关系列表查询配置与渠道关系列表 POST /hotelStaff/configChannel/pageList */
|
||||
export function hotelStaffConfigChannelPageListUsingPost({
|
||||
options,
|
||||
}: {
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RListPcConfigChannel>(
|
||||
'/hotelStaff/configChannel/pageList',
|
||||
{
|
||||
method: 'POST',
|
||||
...(options || {}),
|
||||
}
|
||||
);
|
||||
}
|
||||
9
src/api/index.ts
Normal file
9
src/api/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
export * from './types';
|
||||
|
||||
export * from './code';
|
||||
export * from './oauth2';
|
||||
export * from './pcUser';
|
||||
export * from './configChannel';
|
||||
export * from './typeMapping';
|
||||
23
src/api/oauth2.ts
Normal file
23
src/api/oauth2.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@utils/request';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 登录 POST /auth/oauth2/token */
|
||||
export function authOauth2TokenUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.AuthOauth2TokenUsingPostBody;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.AuthOauth2TokenUsingPostResponse>('/auth/oauth2/token', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
23
src/api/pcUser.ts
Normal file
23
src/api/pcUser.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@utils/request';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 修改pc桌面端平台用户密码 修改pc桌面端平台用户密码 POST /hotelStaff/pcUser/updatePassword */
|
||||
export function hotelStaffPcUserUpdatePasswordUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.UpdatePasswordForm;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RBoolean>('/hotelStaff/pcUser/updatePassword', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
59
src/api/typeMapping.ts
Normal file
59
src/api/typeMapping.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
import request from '@utils/request';
|
||||
|
||||
import * as API from './types';
|
||||
|
||||
/** 查询房型映射列表 查询房型映射列表查询房型映射列表 POST /hotelStaff/typeMapping/list */
|
||||
export function hotelStaffTypeMappingListUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.RoomTypeMapping;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RListRoomTypeMapping>('/hotelStaff/typeMapping/list', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询房型映射列表 查询房型映射列表查询房型映射列表 POST /hotelStaff/typeMapping/pageList */
|
||||
export function hotelStaffTypeMappingPageListUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.RoomTypeMapping;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RPageRoomTypeMapping>('/hotelStaff/typeMapping/pageList', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改房型映射 修改房型映射修改房型映射 POST /hotelStaff/typeMapping/update */
|
||||
export function hotelStaffTypeMappingUpdateUsingPost({
|
||||
body,
|
||||
options,
|
||||
}: {
|
||||
body: API.RoomTypeMapping;
|
||||
options?: { [key: string]: unknown };
|
||||
}) {
|
||||
return request<API.RBoolean>('/hotelStaff/typeMapping/update', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
193
src/api/types.ts
Normal file
193
src/api/types.ts
Normal file
@@ -0,0 +1,193 @@
|
||||
/* eslint-disable */
|
||||
// @ts-ignore
|
||||
|
||||
export type AuthCodeImageUsingGetParams = {
|
||||
randomStr?: string;
|
||||
};
|
||||
|
||||
export type AuthCodeImageUsingGetResponse = Record<string, unknown>;
|
||||
|
||||
export type AuthCodeImageUsingGetResponses = {
|
||||
200: AuthCodeImageUsingGetResponse;
|
||||
};
|
||||
|
||||
export type AuthOauth2TokenUsingPostBody = {
|
||||
openIdCode?: unknown[];
|
||||
grant_type?: string;
|
||||
scope?: string;
|
||||
clientId: string;
|
||||
};
|
||||
|
||||
export type AuthOauth2TokenUsingPostResponse = Record<string, unknown>;
|
||||
|
||||
export type AuthOauth2TokenUsingPostResponses = {
|
||||
200: AuthOauth2TokenUsingPostResponse;
|
||||
};
|
||||
|
||||
export type HotelStaffConfigChannelBindingUsingPostResponses = {
|
||||
200: RBoolean;
|
||||
};
|
||||
|
||||
export type HotelStaffConfigChannelCreatePcConfigChannelUsingPostResponses = {
|
||||
200: RBoolean;
|
||||
};
|
||||
|
||||
export type HotelStaffConfigChannelPageListUsingPostResponses = {
|
||||
200: RListPcConfigChannel;
|
||||
};
|
||||
|
||||
export type HotelStaffPcUserUpdatePasswordUsingPostResponses = {
|
||||
200: RBoolean;
|
||||
};
|
||||
|
||||
export type HotelStaffTypeMappingListUsingPostResponses = {
|
||||
200: RListRoomTypeMapping;
|
||||
};
|
||||
|
||||
export type HotelStaffTypeMappingPageListUsingPostResponses = {
|
||||
200: RPageRoomTypeMapping;
|
||||
};
|
||||
|
||||
export type HotelStaffTypeMappingUpdateUsingPostResponses = {
|
||||
200: RBoolean;
|
||||
};
|
||||
|
||||
export type OrderItem = {
|
||||
column?: string;
|
||||
asc?: boolean;
|
||||
};
|
||||
|
||||
export type PageRoomTypeMapping = {
|
||||
records?: RoomTypeMapping[];
|
||||
total?: number;
|
||||
size?: number;
|
||||
current?: number;
|
||||
orders?: OrderItem[];
|
||||
optimizeCountSql?: boolean;
|
||||
searchCount?: boolean;
|
||||
optimizeJoinOfCountSql?: boolean;
|
||||
maxLimit?: number;
|
||||
countId?: string;
|
||||
};
|
||||
|
||||
export type PcConfig = {
|
||||
/** 创建者创建人 */
|
||||
createBy?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新者更新人 */
|
||||
updateBy?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 主键 */
|
||||
id?: string;
|
||||
/** 配置信息id */
|
||||
pcConfigId?: string;
|
||||
/** 账号id */
|
||||
platformUserId?: string;
|
||||
/** 租户id */
|
||||
tenantId?: number;
|
||||
/** 组织id */
|
||||
organizationId?: string;
|
||||
/** 删除标志 true/false 删除/未删除 */
|
||||
delFlag?: number;
|
||||
/** 分页数量 */
|
||||
size?: number;
|
||||
/** 分页标识 从1开始 */
|
||||
current?: number;
|
||||
};
|
||||
|
||||
export type PcConfigChannel = {
|
||||
/** 创建者创建人 */
|
||||
createBy?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新者更新人 */
|
||||
updateBy?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 主键 */
|
||||
id?: string;
|
||||
/** 配置信息id */
|
||||
pcConfigId?: string;
|
||||
/** 系统渠道id */
|
||||
systemChannelId?: string;
|
||||
/** 是否绑定 0未绑定 1已绑定 */
|
||||
bindingFlag?: number;
|
||||
/** 绑定账号 */
|
||||
bindingUsername?: string;
|
||||
/** 绑定密码 */
|
||||
bindingPassword?: string;
|
||||
/** 当前登录token信息 */
|
||||
loginToken?: string;
|
||||
/** 删除标志 true/false 删除/未删除 */
|
||||
delFlag?: number;
|
||||
/** 分页数量 */
|
||||
size?: number;
|
||||
/** 分页标识 从1开始 */
|
||||
current?: number;
|
||||
};
|
||||
|
||||
export type RBoolean = {
|
||||
code?: number;
|
||||
msg?: string;
|
||||
data?: boolean;
|
||||
};
|
||||
|
||||
export type RListPcConfigChannel = {
|
||||
code?: number;
|
||||
msg?: string;
|
||||
data?: PcConfigChannel[];
|
||||
};
|
||||
|
||||
export type RListRoomTypeMapping = {
|
||||
code?: number;
|
||||
msg?: string;
|
||||
data?: RoomTypeMapping[];
|
||||
};
|
||||
|
||||
export type RoomTypeMapping = {
|
||||
/** 创建者创建人 */
|
||||
createBy?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 更新者更新人 */
|
||||
updateBy?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 主键 */
|
||||
id?: string;
|
||||
/** pms名称 */
|
||||
pmsName?: string;
|
||||
/** 携程渠道名称 */
|
||||
xcName?: string;
|
||||
/** 飞猪渠道名称 */
|
||||
fzName?: string;
|
||||
/** 美团渠道名称 */
|
||||
mtName?: string;
|
||||
/** 抖音酒店渠道名称 */
|
||||
dyHotelName?: string;
|
||||
/** 抖音温泉渠道名称 */
|
||||
dyHotSrpingName?: string;
|
||||
/** 配置信息id */
|
||||
pcConfigId?: string;
|
||||
/** 删除标志 true/false 删除/未删除 */
|
||||
delFlag?: number;
|
||||
/** 分页数量 */
|
||||
size?: number;
|
||||
/** 分页标识 从1开始 */
|
||||
current?: number;
|
||||
};
|
||||
|
||||
export type RPageRoomTypeMapping = {
|
||||
code?: number;
|
||||
msg?: string;
|
||||
data?: PageRoomTypeMapping;
|
||||
};
|
||||
|
||||
export type UpdatePasswordForm = {
|
||||
/** 旧密码 */
|
||||
oldPassword?: string;
|
||||
/** 新密码 */
|
||||
newPassword?: string;
|
||||
};
|
||||
Reference in New Issue
Block a user