EDP .Net开发框架--WebApi

平台下载地址:https://gitee.com/alwaysinsist/edp


按分类管理EDP所提供的WebApi接口,以供其他应用调用。WebApi接口不仅可以进行访问控制管理,同时还提供了版本管理,同一WebApi接口支持多个不同版本以满足接口调用方的多版本支持。

WebApi接口的数据是通过调用业务方法来获取的,而业务方法是基于业务对象的,因此WebApi获取的数据行、列同样是受权限管控的。

WebApi开发

public class StudentAPI : WebApiBase

继承基类WebApiBase

定义接口方法
点击查看代码

复制代码
/// <summary>
/// 保存学生信息
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public ResultModel<bool> SaveStudent(StudentSaveModel param) {
    StudentModel item = new StudentModel();
    param.CopyTo(item);
    return this.bll_Student.SaveStudent(item.ID, item);
}

StudentSaveModel为定义的输入参DTO

WebApi管理

WebApi分类

WebApi

  • 新增WebApi接口

    选择程序集后,接口类中会列出所选程序集中包含接口方法的类,选择类后会列出该接口类下所有的接口方法以供选择。

  • 编辑WebApi接口

    在编辑WebApi接口的界面会显示接口的基本信息,以及列出该接口的所有版本。同时提供接口版本的管理功能,如下图:新增接口版本。

WebApi调试与使用

  • WebApi调试

    接口参数描述

    接口调用结果显示

  • WebApi使用

    在这里介绍一下第三方的接口调用,以Psotman为例。

    登录接口请求

    登录接口请求返回结果

    业务接口请求

    业务接口请求返回结果

相关推荐
wxm63114 小时前
PLC总控改造(2)
webapi
Murphy202321 天前
.net8 Swashbuckle.AspNetCore WEBAPI 配置要点记录
.net·swagger·webapi·swashbuckle
.NET修仙日记22 天前
Acme.ReturnOh:让.NET API返回值处理更优雅,统一响应格式一步到位
c#·.net·webapi
ChaITSimpleLove1 个月前
aiagent-webapi 命令的详细使用说明
dotnet·webapi·ai agent·agent framework·maf·projecttemp
wstcl2 个月前
像asp.net core webapi一样在asp.net frameworks中使用Swagger,方便调试接口
后端·asp.net·swagger·webapi
xiaoid4 个月前
C#向jave平台的API接口推送
c#·post·webapi
csdn_aspnet5 个月前
使用 .NET 8 构建 RESTful Web API
restful·webapi·.net8
csdn_aspnet5 个月前
在 .Net 8 WEBAPI 中实现实体框架的 Code First 方法
webapi·.net8
csdn_aspnet5 个月前
.Net 8 Web API CRUD 操作
webapi·.net8
csdn_aspnet6 个月前
使用 Entity Framework Code First 方法创建 ASP.NET Core 5.0 Web API
.netcore·webapi