zoukankan      html  css  js  c++  java
  • 接口 C# abp 接口在web层 swagger

    一、后端代码


        /// <summary>
        /// 办公用品使用申请
        /// </summary>
        public class OAOfficeSupplyApplyApiDto : OASignFlowApiDto
        {
            /// <summary>
            /// Id,添加时传-1/0都可以 随意
            /// </summary>
            public int? Id { get; set; }
    
            /// <summary>
            /// 名称
            /// </summary>
            [Required(ErrorMessage = "名称不能为空")]
            public string Name { get; set; }
    
            /// <summary>
            /// 备注
            /// </summary>
            public string Mark { get; set; }
    
            /// <summary>
            /// 办公用品使用申请关联的商品集合
            /// </summary>
            public List<OAOfficeSupplyApplyGoodsApiDto> OAOfficeSupplyApplyGoodsApiDtos { get; set; }
        }
    
    	/// <summary>
    	/// 办公用品使用申请关联的商品
    	/// </summary>
    	public class OAOfficeSupplyApplyGoodsApiDto
        {
    		/// <summary>
    		/// 商品Id
    		/// </summary>
    		public int SupplyId { get; set; }
    
    		/// <summary>
    		/// 商品名称
    		/// </summary>
    		public string SupplyName { get; set; }
    
    		/// <summary>
    		/// 价格
    		/// </summary>
    		public decimal? Price { get; set; }
    
    		/// <summary>
    		/// 数量
    		/// </summary>
    		public int? Num { get; set; }
    
    		/// <summary>
    		/// 备注
    		/// </summary>
    		public string Mark { get; set; }
    
    		/// <summary>
    		/// 总金额,添加时不用传,仅供查询使用
    		/// </summary>
    		public decimal TotalPrice { get; set; }
    	}
    

    二、前端测试

            var model = {
                "Id": 0,
                "Name": "测试2",
                "Mark": "备注1",
                "SignStepId": "112",
                "SignFlowId": "28",
                "ShouldUserIds": "421",
                "OAOfficeSupplyApplyGoodsApiDtos": [
                    {
                        "SupplyId": "5",
                        "SupplyName": "笔",
                        "Price": "1",
                        "Num": "2",
                        "Mark": "备注2"
                    }
                ]
            };
            $.post("/apis/OAIndividual/SaveOAOfficeSupplyApply", model, function () { });
    

    游览器传输的数据

    三、postman测试

  • 相关阅读:
    场景调研
    12.8
    12.7
    12.6
    12.5
    12.4
    12.3
    重启oracle数据库的操作方法
    oracle创建dblink方法
    SQL*Loader 详解
  • 原文地址:https://www.cnblogs.com/guxingy/p/13878375.html
Copyright © 2011-2022 走看看