Просмотр исходного кода

😁增加获取打印模板接口

zuohuaijun 2 лет назад
Родитель
Сommit
3d359aaa8e

+ 11 - 0
Admin.NET/Admin.NET.Core/Service/Print/SysPrintService.cs

@@ -36,6 +36,17 @@ public class SysPrintService : IDynamicApiController, ITransient
             .ToPagedListAsync(input.Page, input.PageSize);
     }
 
+    /// <summary>
+    /// 获取打印模板
+    /// </summary>
+    /// <param name="name"></param>
+    /// <returns></returns>
+    [DisplayName("获取打印模板")]
+    public async Task<SysPrint> GetPrint(string name)
+    {
+        return await _sysPrintRep.GetFirstAsync(u => u.Name == name);
+    }
+
     /// <summary>
     /// 增加打印模板
     /// </summary>

+ 85 - 0
Web/src/api-services/apis/sys-print-api.ts

@@ -19,6 +19,7 @@ import { Configuration } from '../configuration';
 import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
 import { AddPrintInput } from '../models';
 import { AdminResultSqlSugarPagedListSysPrint } from '../models';
+import { AdminResultSysPrint } from '../models';
 import { DeletePrintInput } from '../models';
 import { PagePrintInput } from '../models';
 import { UpdatePrintInput } from '../models';
@@ -172,6 +173,55 @@ export const SysPrintApiAxiosParamCreator = function (configuration?: Configurat
                 options: localVarRequestOptions,
             };
         },
+        /**
+         * 
+         * @summary 获取打印模板
+         * @param {string} name 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        apiSysPrintPrintNameGet: async (name: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+            // verify required parameter 'name' is not null or undefined
+            if (name === null || name === undefined) {
+                throw new RequiredError('name','Required parameter name was null or undefined when calling apiSysPrintPrintNameGet.');
+            }
+            const localVarPath = `/api/sysPrint/print/{name}`
+                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+            // authentication Bearer required
+            // http bearer authentication required
+            if (configuration && configuration.accessToken) {
+                const accessToken = typeof configuration.accessToken === 'function'
+                    ? await configuration.accessToken()
+                    : await configuration.accessToken;
+                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
+            }
+
+            const query = new URLSearchParams(localVarUrlObj.search);
+            for (const key in localVarQueryParameter) {
+                query.set(key, localVarQueryParameter[key]);
+            }
+            for (const key in options.params) {
+                query.set(key, options.params[key]);
+            }
+            localVarUrlObj.search = (new URLSearchParams(query)).toString();
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
+                options: localVarRequestOptions,
+            };
+        },
         /**
          * 
          * @summary 更新打印模板
@@ -271,6 +321,20 @@ export const SysPrintApiFp = function(configuration?: Configuration) {
                 return axios.request(axiosRequestArgs);
             };
         },
+        /**
+         * 
+         * @summary 获取打印模板
+         * @param {string} name 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysPrintPrintNameGet(name: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultSysPrint>>> {
+            const localVarAxiosArgs = await SysPrintApiAxiosParamCreator(configuration).apiSysPrintPrintNameGet(name, options);
+            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+                return axios.request(axiosRequestArgs);
+            };
+        },
         /**
          * 
          * @summary 更新打印模板
@@ -324,6 +388,16 @@ export const SysPrintApiFactory = function (configuration?: Configuration, baseP
         async apiSysPrintPagePost(body?: PagePrintInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSqlSugarPagedListSysPrint>> {
             return SysPrintApiFp(configuration).apiSysPrintPagePost(body, options).then((request) => request(axios, basePath));
         },
+        /**
+         * 
+         * @summary 获取打印模板
+         * @param {string} name 
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysPrintPrintNameGet(name: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultSysPrint>> {
+            return SysPrintApiFp(configuration).apiSysPrintPrintNameGet(name, options).then((request) => request(axios, basePath));
+        },
         /**
          * 
          * @summary 更新打印模板
@@ -377,6 +451,17 @@ export class SysPrintApi extends BaseAPI {
     public async apiSysPrintPagePost(body?: PagePrintInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSqlSugarPagedListSysPrint>> {
         return SysPrintApiFp(this.configuration).apiSysPrintPagePost(body, options).then((request) => request(this.axios, this.basePath));
     }
+    /**
+     * 
+     * @summary 获取打印模板
+     * @param {string} name 
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof SysPrintApi
+     */
+    public async apiSysPrintPrintNameGet(name: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultSysPrint>> {
+        return SysPrintApiFp(this.configuration).apiSysPrintPrintNameGet(name, options).then((request) => request(this.axios, this.basePath));
+    }
     /**
      * 
      * @summary 更新打印模板

+ 73 - 0
Web/src/api-services/models/admin-result-sys-print.ts

@@ -0,0 +1,73 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: 515096995@qq.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { SysPrint } from './sys-print';
+import {
+    SysPrint,
+} from ".";
+
+/**
+ * 全局返回结果
+ *
+ * @export
+ * @interface AdminResultSysPrint
+ */
+export interface AdminResultSysPrint {
+
+    /**
+     * 状态码
+     *
+     * @type {number}
+     * @memberof AdminResultSysPrint
+     */
+    code?: number;
+
+    /**
+     * 类型success、warning、error
+     *
+     * @type {string}
+     * @memberof AdminResultSysPrint
+     */
+    type?: string | null;
+
+    /**
+     * 错误信息
+     *
+     * @type {string}
+     * @memberof AdminResultSysPrint
+     */
+    message?: string | null;
+
+    /**
+     * @type {SysPrint}
+     * @memberof AdminResultSysPrint
+     */
+    result?: SysPrint;
+
+    /**
+     * 附加数据
+     *
+     * @type {any}
+     * @memberof AdminResultSysPrint
+     */
+    extras?: any | null;
+
+    /**
+     * 时间
+     *
+     * @type {Date}
+     * @memberof AdminResultSysPrint
+     */
+    time?: Date;
+}

+ 1 - 0
Web/src/api-services/models/index.ts

@@ -79,6 +79,7 @@ export * from './admin-result-sys-code-gen-config';
 export * from './admin-result-sys-config';
 export * from './admin-result-sys-dict-data';
 export * from './admin-result-sys-dict-type';
+export * from './admin-result-sys-print';
 export * from './admin-result-sys-user';
 export * from './admin-result-sys-wechat-pay';
 export * from './admin-result-wechat-pay-output';