UNPKG

amis-model-design

Version:

amis模型设计器

73 lines (72 loc) 2.44 kB
/** * @file MixedApiStrategy * @desc API混合构建:查询使用 JSONQL,增删改使用 RestfulAPI */ import { MainStore } from '../base/MainStore'; import { ModelStore } from '../base/ModelStore'; import { ApiBuilder } from './ApiBuilder'; import type { ApiStrategyInterface } from './ApiStrategyInterface'; import type { Api } from '../type'; export interface MixedApiStrategyOptions { apiPrefix?: string; /** * Restful接口生成 model 协议地址,如 model://dsKey.key */ useApiSchema?: boolean; } export declare class MixedApiStrategy implements ApiStrategyInterface { readonly store: MainStore; readonly model: ModelStore; readonly options: MixedApiStrategyOptions; strategy: "mixed"; constructor(store: MainStore, model: ModelStore, options: MixedApiStrategyOptions); setOptions(options: Partial<MixedApiStrategyOptions>): void; get apiPrefix(): string; /** JSONQL设计态的API */ get jsonqlPrefix(): string; /** RestfulAPI */ get restfulPrefix(): string; /** 数据源和模型相关信息 */ get modelInfo(): { value: string; label: string; dsId: string; dsKey: string; dsLabel: string; mId: string; mKey: string; mLabel: string; }; /** FROM子句,SELECT子句使用from为key,其他情况使用table为key */ get FROMClause(): string; get prefix(): string; parseQueryStr(ab: ApiBuilder): string; /** 列表查询接口 */ listApi(ab: ApiBuilder): Api; /** 选项类数据源接口 */ optionsApi(ab?: ApiBuilder): Api; /** 自动补全联想列表接口 */ autoCompleteApi(ab?: ApiBuilder): Api; /** 单条详情查询接口 */ detailApi(ab: ApiBuilder): Api; /** 新增单条接口 */ storeApi(): Api; /** 编辑单条接口 */ updateApi(ab?: ApiBuilder): Api; /** 批量编辑 */ bulkSaveApi(ab: ApiBuilder): Api; /** 快速编辑单条数据, 可以复用编辑单条的接口 */ quickSaveItemApi(ab: ApiBuilder): Api; /** 快速编辑多条数据 */ quickSaveApi(ab: ApiBuilder): Api; /** 单条删除接口 */ deleteApi(ab: ApiBuilder): Api; /** 批量删除接口 */ bulkDeleteApi(ab: ApiBuilder): Api; saveOrderApi(): string; exportApi(): Api; importApi(): Api; importAsyncApi(): Api; donwloadImportTemplateApi(): Api; truncatApi(): Api; }