😎获取文件接口增加是否清除过滤器参数
This commit is contained in:
parent
8409fa8fbc
commit
e5f771d5bf
@ -194,11 +194,14 @@ public class SysFileService : IDynamicApiController, ITransient
|
|||||||
/// 获取文件 🔖
|
/// 获取文件 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
|
/// <param name="isClearFilter"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[DisplayName("获取文件")]
|
[DisplayName("获取文件")]
|
||||||
public async Task<SysFile> GetFile([FromQuery] long id)
|
public async Task<SysFile> GetFile([FromQuery] long id, [FromQuery] bool isClearFilter = false)
|
||||||
{
|
{
|
||||||
var file = await _sysFileRep.CopyNew().GetByIdAsync(id);
|
var file = isClearFilter
|
||||||
|
? await _sysFileRep.CopyNew().AsQueryable().ClearFilter().FirstAsync(u => u.Id == id)
|
||||||
|
: await _sysFileRep.CopyNew().GetByIdAsync(id);
|
||||||
return file ?? throw Oops.Oh(ErrorCodeEnum.D8000);
|
return file ?? throw Oops.Oh(ErrorCodeEnum.D8000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -229,10 +229,11 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
*
|
*
|
||||||
* @summary 获取文件 🔖
|
* @summary 获取文件 🔖
|
||||||
* @param {number} [id]
|
* @param {number} [id]
|
||||||
|
* @param {boolean} [isClearFilter]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
apiSysFileFileGet: async (id?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
apiSysFileFileGet: async (id?: number, isClearFilter?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
const localVarPath = `/api/sysFile/file`;
|
const localVarPath = `/api/sysFile/file`;
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
@ -257,6 +258,10 @@ export const SysFileApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
localVarQueryParameter['id'] = id;
|
localVarQueryParameter['id'] = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isClearFilter !== undefined) {
|
||||||
|
localVarQueryParameter['isClearFilter'] = isClearFilter;
|
||||||
|
}
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
for (const key in localVarQueryParameter) {
|
for (const key in localVarQueryParameter) {
|
||||||
query.set(key, localVarQueryParameter[key]);
|
query.set(key, localVarQueryParameter[key]);
|
||||||
@ -875,11 +880,12 @@ export const SysFileApiFp = function(configuration?: Configuration) {
|
|||||||
*
|
*
|
||||||
* @summary 获取文件 🔖
|
* @summary 获取文件 🔖
|
||||||
* @param {number} [id]
|
* @param {number} [id]
|
||||||
|
* @param {boolean} [isClearFilter]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileFileGet(id?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSysFile>>> {
|
async apiSysFileFileGet(id?: number, isClearFilter?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultSysFile>>> {
|
||||||
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileFileGet(id, options);
|
const localVarAxiosArgs = await SysFileApiAxiosParamCreator(configuration).apiSysFileFileGet(id, isClearFilter, options);
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
@ -1085,11 +1091,12 @@ export const SysFileApiFactory = function (configuration?: Configuration, basePa
|
|||||||
*
|
*
|
||||||
* @summary 获取文件 🔖
|
* @summary 获取文件 🔖
|
||||||
* @param {number} [id]
|
* @param {number} [id]
|
||||||
|
* @param {boolean} [isClearFilter]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
*/
|
*/
|
||||||
async apiSysFileFileGet(id?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysFile>> {
|
async apiSysFileFileGet(id?: number, isClearFilter?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysFile>> {
|
||||||
return SysFileApiFp(configuration).apiSysFileFileGet(id, options).then((request) => request(axios, basePath));
|
return SysFileApiFp(configuration).apiSysFileFileGet(id, isClearFilter, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -1256,12 +1263,13 @@ export class SysFileApi extends BaseAPI {
|
|||||||
*
|
*
|
||||||
* @summary 获取文件 🔖
|
* @summary 获取文件 🔖
|
||||||
* @param {number} [id]
|
* @param {number} [id]
|
||||||
|
* @param {boolean} [isClearFilter]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
* @throws {RequiredError}
|
* @throws {RequiredError}
|
||||||
* @memberof SysFileApi
|
* @memberof SysFileApi
|
||||||
*/
|
*/
|
||||||
public async apiSysFileFileGet(id?: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysFile>> {
|
public async apiSysFileFileGet(id?: number, isClearFilter?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysFile>> {
|
||||||
return SysFileApiFp(this.configuration).apiSysFileFileGet(id, options).then((request) => request(this.axios, this.basePath));
|
return SysFileApiFp(this.configuration).apiSysFileFileGet(id, isClearFilter, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user