32 lines
651 B
TypeScript
Raw Normal View History

2022-05-12 02:45:43 +08:00
import request from '@/web/utils/request'
2022-04-16 21:14:03 +08:00
import {
SearchParams,
SearchResponse,
SearchTypes,
MultiMatchSearchParams,
MultiMatchSearchResponse,
} from '@/shared/api/Search'
2022-03-13 14:40:38 +08:00
// 搜索
export function search(params: SearchParams): Promise<SearchResponse> {
return request({
url: '/search',
method: 'get',
2022-03-29 00:11:05 +08:00
params: {
...params,
type: SearchTypes[params.type ?? SearchTypes.All],
2022-03-29 00:11:05 +08:00
},
2022-03-13 14:40:38 +08:00
})
}
// 搜索多重匹配
export function multiMatchSearch(
params: MultiMatchSearchParams
): Promise<MultiMatchSearchResponse> {
return request({
url: '/search/multimatch',
method: 'get',
params: params,
})
}