/** * @description 校验SQL代码 */ import { getUrl } from 'src/utils/getUrl'; import Request from 'src/utils/requests'; import * as defs from '../../baseClass'; export class Params { /** 项目ID */ projectId: number; /** 校验规则 */ rule: string; } export const init = new defs.CodeValidateDTO(); export async function request(params = {}, bodyParams = {}) { return Request({ url: '/api/editor/validate', params: bodyParams, method: 'post', }); } export function createFetchAction(types, stateKey) { return (params = {}, bodyParams, meta?: any) => { return { types, meta, stateKey, method: 'POST', url: getUrl('/api/editor/validate', params, 'POST'), params: bodyParams, init, }; }; }