From fe8594a19f7148f0313dcd334c2efc6c0126f868 Mon Sep 17 00:00:00 2001 From: dev01 Date: Wed, 9 Nov 2022 11:06:17 +0800 Subject: [PATCH] =?UTF-8?q?[FrontedWebApi][=E5=9C=96=E8=B3=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20API=20=E6=8E=A5=E5=8F=A3=20FromBody=E8=A3=9C?= =?UTF-8?q?=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/GraphManageController.cs | 8 ++++---- FrontendWebApi/Models/GraphManage.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FrontendWebApi/ApiControllers/GraphManageController.cs b/FrontendWebApi/ApiControllers/GraphManageController.cs index aa62a28..53abdb0 100644 --- a/FrontendWebApi/ApiControllers/GraphManageController.cs +++ b/FrontendWebApi/ApiControllers/GraphManageController.cs @@ -13,8 +13,8 @@ using System.IO; namespace FrontendWebApi.ApiControllers { - [Route("api/[controller]")] - [ApiController] + //[Route("api/[controller]")] + //[ApiController] public class GraphManageController : MyBaseApiController { private readonly IBackendRepository backendRepository; @@ -61,7 +61,7 @@ namespace FrontendWebApi.ApiControllers } [HttpPost] - public async Task>> SubSysList(int main_system_tag) + public async Task>> SubSysList([FromBody] int main_system_tag) { ApiResult> apiResult = new ApiResult>(); List sub_system_list = new List(); @@ -91,7 +91,7 @@ namespace FrontendWebApi.ApiControllers } [HttpPost] - public async Task>> GraManList(GraphInfo gi) + public async Task>> GraManList([FromBody] GraphInfo gi) { ApiResult> apiResult = new ApiResult>(); List graManList = new List(); diff --git a/FrontendWebApi/Models/GraphManage.cs b/FrontendWebApi/Models/GraphManage.cs index 950bca0..88ee01d 100644 --- a/FrontendWebApi/Models/GraphManage.cs +++ b/FrontendWebApi/Models/GraphManage.cs @@ -37,7 +37,7 @@ namespace FrontendWebApi.Models { public string code { get; set; } public string main_system_tag { get; set; } - public List sub_system_tag { get; set; } + public List sub_system_tag { get; set; } = new List{ }; public string keyWord { get; set; } } }