搜索、小助手推荐位
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { api } from '@/apis';
|
||||
import type { ResultDomain, Resource, ResourceSearchParams, PageParam, ResourceVO, UserCollection } from '@/types';
|
||||
import type { ResultDomain, Resource, PageParam, ResourceVO, UserCollection, TaskItemVO } from '@/types';
|
||||
|
||||
/**
|
||||
* 资源API服务
|
||||
@@ -20,7 +20,7 @@ export const resourceApi = {
|
||||
* @param filter 筛选条件
|
||||
* @returns Promise<ResultDomain<Resource>>
|
||||
*/
|
||||
async getResourceList(filter?: ResourceSearchParams): Promise<ResultDomain<Resource>> {
|
||||
async getResourceList(filter?: Resource): Promise<ResultDomain<Resource>> {
|
||||
const response = await api.get<Resource>('/news/resources/list', filter);
|
||||
return response.data;
|
||||
},
|
||||
@@ -31,7 +31,7 @@ export const resourceApi = {
|
||||
* @param pageParam 分页参数
|
||||
* @returns Promise<ResultDomain<Resource>>
|
||||
*/
|
||||
async getResourcePage(pageParam: PageParam, filter?: ResourceSearchParams): Promise<ResultDomain<Resource>> {
|
||||
async getResourcePage(pageParam: PageParam, filter?: Resource): Promise<ResultDomain<Resource>> {
|
||||
const response = await api.post<Resource>('/news/resources/page', {
|
||||
pageParam,
|
||||
filter,
|
||||
@@ -45,7 +45,7 @@ export const resourceApi = {
|
||||
* @param pageParam 分页参数
|
||||
* @returns Promise<ResultDomain<ResourceVO>>
|
||||
*/
|
||||
async getResourcePageOrderByViewCount(pageParam: PageParam, filter?: ResourceSearchParams): Promise<ResultDomain<ResourceVO>> {
|
||||
async getResourcePageOrderByViewCount(pageParam: PageParam, filter?: Resource): Promise<ResultDomain<ResourceVO>> {
|
||||
const response = await api.post<ResourceVO>('/news/resources/page/view-count', {
|
||||
pageParam,
|
||||
filter,
|
||||
@@ -218,6 +218,16 @@ export const resourceApi = {
|
||||
|
||||
const response = await api.get<Resource>('/news/resources/search', params);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 联合搜索文章和课程
|
||||
* @param request 搜索请求参数(包含pageParam和filter)
|
||||
* @returns Promise<ResultDomain<TaskItemVO>>
|
||||
*/
|
||||
async searchItems(request: { pageParam: PageParam; filter: Resource }): Promise<ResultDomain<TaskItemVO>> {
|
||||
const response = await api.post<TaskItemVO>('/news/resources/search', request);
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user