| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc.Filters; |
| | | using NetTaste; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | if (resultContext.Result is ObjectResult objectResult) |
| | | { |
| | | var apiResponse = new ApiResponse<object>( |
| | | context.HttpContext.Response.StatusCode, |
| | | context.HttpContext.Response.StatusCode == 200 ? "请求成功" : "错误", |
| | | objectResult.Value |
| | | ); |
| | | context.HttpContext.Response.StatusCode, |
| | | context.HttpContext.Response.StatusCode == 200 ? "请求成功" : "错误", |
| | | objectResult.Value); |
| | | |
| | | //if (resultContext.Result is SqlSugarPagedList) |
| | | //{ |
| | | // apiResponse.count = ((SqlSugarPagedList)resultContext.Result).Total; |
| | | //} |
| | | |
| | | var json = JsonConvert.SerializeObject(apiResponse); |
| | | context.HttpContext.Response.ContentType = "application/json"; |