代码优化

master
xiaochanghai 1 year ago
parent 82490db710
commit 05a3e0a264
  1. 3
      Tiobon.Core.Common/Attribute/FromFilterAttribute.cs
  2. 2
      Tiobon.Core.Repository/BASE/BaseRepository.cs
  3. 4
      Tiobon.Core.Services/AdvertisementServices.cs
  4. 6
      Tiobon.Core.Tests/Common_Test/HttpHelper_Should.cs

@ -91,8 +91,9 @@ namespace Tiobon.Core.Common
queryFilter.PredicateValues[i] = v; queryFilter.PredicateValues[i] = v;
} }
} }
catch (Exception ex) catch (Exception)
{ {
throw;
//LoggerHelper.SendLogError($"QueryFilter.PredicateValues[{i}] [{queryFilter.PredicateValues[i]}] 反序列化失败\r\n" + //LoggerHelper.SendLogError($"QueryFilter.PredicateValues[{i}] [{queryFilter.PredicateValues[i]}] 反序列化失败\r\n" +
// $"请求地址: {bindingContext.HttpContext.Request.GetEncodedUrl()}\r\n" + // $"请求地址: {bindingContext.HttpContext.Request.GetEncodedUrl()}\r\n" +
// $"错误信息: {ex}"); // $"错误信息: {ex}");

@ -1,5 +1,4 @@
using System.Data; using System.Data;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Reflection; using System.Reflection;
using SqlSugar; using SqlSugar;
@ -10,7 +9,6 @@ using Tiobon.Core.Model;
using Tiobon.Core.Model.Models; using Tiobon.Core.Model.Models;
using Tiobon.Core.Model.Tenants; using Tiobon.Core.Model.Tenants;
using Tiobon.Core.Repository.UnitOfWorks; using Tiobon.Core.Repository.UnitOfWorks;
using static Org.BouncyCastle.Math.EC.ECCurve;
namespace Tiobon.Core.Repository.Base namespace Tiobon.Core.Repository.Base
{ {

@ -10,8 +10,8 @@ namespace Tiobon.Core.Services
public void ReturnExp() public void ReturnExp()
{ {
int a = 1; //int a = 1;
int b = 0; //int b = 0;
// int c = a / b; // int c = a / b;
} }

@ -7,9 +7,9 @@ namespace Tiobon.Core.Tests.Common_Test
{ {
[Fact] [Fact]
public void Get_Async_Test() public async void Get_Async_Test()
{ {
var responseString = HttpHelper.GetAsync("http://apk.neters.club/api/Tiobon").Result; var responseString = (await HttpHelper.GetAsync("http://apk.neters.club/api/Tiobon"));
Assert.NotNull(responseString); Assert.NotNull(responseString);
} }
@ -17,7 +17,7 @@ namespace Tiobon.Core.Tests.Common_Test
[Fact] [Fact]
public void Post_Async_Test() public void Post_Async_Test()
{ {
var responseString = HttpHelper.PostAsync("http://apk.neters.club/api/Login/swgLogin", "{\"name\":\"admin\",\"pwd\":\"admin\"}").Result; var responseString = HttpHelper.PostAsync("http://apk.neters.club/api/Login/swgLogin", "{\"name\":\"admin\",\"pwd\":\"admin\"}");
Assert.NotNull(responseString); Assert.NotNull(responseString);
} }

Loading…
Cancel
Save