C# 接口

时间:2024-04-23 07:38:34

文章目录

  • 接口开发
    • 简介
    • 注册接口
      • 1. 前端界面赋值实体

接口开发

简介

首先部署一个IIS服务,前端向后端接口传递数据,后端访问IIS服务地址,发送第三方平台

注册接口

1. 前端界面赋值实体

#region 文档注册
try
  {
      if (ViewModel.SendDepartment != "中心")
      {
          基础.Model.聚合Model1cs 聚合model = new 基础.Model.聚合Model1cs();
          聚合model.model = 赋值model();
          聚合model.报告model = 赋值报告model();
          if (聚合model.model.医嘱id != null)
          {
              基础.http Http = new 基础.http();
              string res = Http.HttpPost(文档注册回传, JsonConvert.SerializeObject(聚合model));
      }
  }
   catch (Exception)
  {
      //throw new Exception(e.ToString());
  }
  #endregion

访问后端API地址

string 文档注册回传 = "api/HHInterface/HDH";