/** * @description 搜索结果 */ import { getUrl } from 'src/utils/getUrl'; import Request from 'src/utils/requests'; import * as defs from '../../baseClass'; export class Params { /** page */ page?: number; /** offset */ offset?: number; /** pageSize */ pageSize?: number; /** doNotCount */ doNotCount?: boolean; /** 责任人 ID */ ownerIdList?: Array; /** 搜索关键词 */ keyword?: string; /** 排序字段,不传则为综合排序,创建时间排序则传gmtCreate,热度则传hot */ orderBy?: string; /** env */ env: 'DEV' | 'PROD'; } export const init = new defs.PagedData(); export async function request(params = {}, bodyParams = {}) { return Request({ url: '/api/dip/search/list', params: bodyParams, method: 'post', }); } export function createFetchAction(types, stateKey) { return (params = {}, bodyParams, meta?: any) => { return { types, meta, stateKey, method: 'POST', url: getUrl('/api/dip/search/list', params, 'POST'), params: bodyParams, init, }; }; }