123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import { useFetch } from '@/hooks/useFetch';
- import { PageResult,PageMoreResult } from '@/utils/page';
- import {
- CategoryListParams,
- CategoryListResult,
- EmployeeSearchParams,
- EmployeeDetailParams,
- EmployeeSearchResult,
- UserLoginParams,
- UserLoginResult,
- UserPasswordParams,
- UserInfoResult,
- ChatSubmitParams,
- ChatSubmitResult,
- ChatMessageParams,
- ChatMessageResult,
- ChatSessionParams,
- ChatSessionResult
- } from '@/utils/clientsApis';
- import {Result} from '@/utils/result';
- /**
- * 获取分类列表
- */
- export const getCategoryList = (params: CategoryListParams): Promise<Result<PageResult<CategoryListResult[]>>> => {
- const fetchService = useFetch();
- return fetchService.post('/category/list', { body: params });
- };
- /**
- * 获取智能体列表
- */
- export const getEmployeeSearch = (params: EmployeeSearchParams): Promise<Result<PageResult<EmployeeSearchResult[]>>> => {
- const fetchService = useFetch();
- return fetchService.post('/employee/search', { body: params });
- };
- /**
- * 获取智能体详情
- */
- export const getEmployeeDetail = (params: EmployeeDetailParams): Promise<Result<EmployeeSearchResult>> => {
- const fetchService = useFetch();
- return fetchService.post('/employee/detail', { body: params });
- };
- /**
- * 前台用户登陆
- */
- export const userLogin = (params: UserLoginParams): Promise<Result<UserLoginResult>> => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/user/login', { body: params });
- };
- /**
- * 前台用户修改密码
- */
- export const userPassword = (params: UserPasswordParams) => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/user/password', { body: params });
- };
- /**
- * 查看用户信息
- */
- export const getUserInfo = (): Promise<Result<UserInfoResult>> => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/user/info');
- };
- /**
- * 聊天提交内容
- */
- export const chatSubmit = (params: ChatSubmitParams) => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/chat/submit', { body: params });
- };
- /**
- * 查询会话下的聊天历史
- */
- export const getChatMessage = (params: ChatMessageParams) : Promise<Result<PageMoreResult<ChatMessageResult[]>>> => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/chat/message', { body: params });
- };
- /**
- * 聊天会话列表
- */
- export const getChatSession = (params: ChatSessionParams) : Promise<Result<PageMoreResult<ChatSessionResult[]>>> => {
- const fetchService = useFetch();
- return fetchService.post('/gpts/chat/session', { body: params });
- };
|